123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- # Maintainer: Alexander Susha <isushik94@gmail.com>
- _base=xtensor-blas
- pkgname=xtensor-${_base}-git
- pkgver=0.19.1.9.g7ceb791
- pkgrel=1
- pkgdesc="QuantStack tools library - Multi-dimensional arrays with broadcasting and lazy computing."
- arch=('x86_64')
- url="https://github.com/QuantStack/${_base}"
- license=('BSD-3-Clause')
- depends=('xtensor>=0.19.0' 'blas' 'lapack')
- makedepends=('cmake')
- source=("git+${url}")
- md5sums=('SKIP')
- provides=("$[_base]=$(printf ${pkgver} | cut -d'.' -f1,2,3)")
- replaces=("$[_base]")
- conflicts=("${_base}")
- # From UPC: Building And Using Static And Shared "C"
- # Libraries.html
- # #+begin_QUOTE
- # we need that all jump calls ("goto", in assembly speak)
- # and subroutine calls will use relative addresses, and not
- # absolute addresses. Thus, we need to use ... ~-fPIC~ or
- # ~-fpic~
- # #+end_QUOTE
- #
- # From makepkg.conf
- # -march (or -mcpu) builds exclusively for an architecture
- # -mtune optimizes for an architecture, but builds for
- # whole processor family
- #
- # -O3 optimises
- #
- # -D-FORTIFY-SOURCE=2
- # | https://stackoverflow.com/a/16604146
- # |- man 7 feature_test_macros
- # checks to be performed to detect some buffer overflow
- # errors when employing various string and memory
- # manipulation functions ... some conforming programs
- # might fail
- #
- # -fcf-protection
- # | Info pages for gcc (gnu compiler collection)
- # intended to protect against such threats as
- # Return-oriented Programming (ROP), and similarly
- # call/jmp-oriented programming (COP/JOP)
- #
- # -pipe
- # | Info pages for gcc (controlling the kind of output)
- # Use pipes rather than temporary files for communication
- # between the various stages of compilation
- #
- # -fno-plt
- # | Info pages for gcc (code generation conventions)
- # leads to more efficient code by eliminating PLT stubs and
- # exposing GOT loads to optimizations
- #
- # -fopenmp
- # | Info pages for gcc (controlling c dialect)
- # Enable handling of OpenMP directives
- #
- safe_flags="-Wp,-D_FORTIFY_SOURCE=2,-D_GLIBCXX_ASSERTIONS"
- safe_flags+=" -fcf-protection -fno-plt"
- safe_flags+=" -fstack-clash-protection -Wformat"
- safe_flags+=" -Werror=format-security"
- generic_flags="-pipe -fno-plt -fPIC -fopenmp -march=native"
- generic_flags+=" -mtune=native ${safe_flags}"
- opt_flags="${generic_flags} -O3"
- generic_flags="${generic_flags} -O2"
- COPTFLAGS="${opt_flags}"
- CXXOPTFLAGS="$COPTFLAGS"
- FOPTFLAGS="$COPTFLAGS"
- CPPFLAGS="$generic_flags"
- CXXFLAGS="$CPPFLAGS"
- CFLAGS="$generic_flags"
- FFLAGS="$generic_flags"
- FCFLAGS="$generic_flags"
- F90FLAGS="$generic_flags"
- F77FLAGS="$generic_flags"
- export LANG=en_IE.UTF-8
- export LC_ALL=en_IE.UTF-8
- pkgver() {
- cd "${srcdir}/${_base}"
- git describe --tags --match '*.*' | tr '-' '.'
- }
- build() {
- cd "${_base}"
- [ ! -d build ] && mkdir build
- cd build
- cmake \
- -DCMAKE_INSTALL_PREFIX=${pkgdir}/usr \
- -DCMAKE_INSTALL_LIBDIR=lib \
- ..
- make
- }
- package() {
- cd "${_base}/build"
- make install
- }
|