blob: bac66654fb506e81095d2d63947d6a2168439c5d (
plain)
1 # Description: Optimized BLAS library
2 # URL: https://www.openblas.net/
3 # Maintainer: Tim Biermann, tbier at posteo dot de
4 # Depends on: gcc-fortran
5
6 name=openblas
7 version=0.3.21
8 release=2
9 source=(https://github.com/xianyi/OpenBLAS/archive/v$version/OpenBLAS-$version.tar.gz
10 openblas-0.3.21-clang16.patch)
11
12 build () {
13 cd OpenBLAS-$version
14
15 patch -Np1 -i $SRC/openblas-0.3.21-clang16.patch
16
17 export MAKE_NB_JOBS=-1 \
18 COMMON_OPT=" " \
19 FCOMMON_OPT=" "
20
21 local flags=(
22 PREFIX=$PKG/usr
23 NO_LAPACK=1
24 NO_LAPACKE=1
25 NO_STATIC=1
26 NO_AFFINITY=1
27 USE_OPENMP=1
28 DYNAMIC_ARCH=1
29 NUM_THREADS=64
30 MAJOR_VERSION=3
31 USE_THREAD=1
32 CFLAGS="$CFLAGS $CPPFLAGS"
33 )
34
35 make "${flags[@]}"
36
37 make "${flags[@]}" install
38
39 # Symlink to provide blas & cblas
40 cd $PKG/usr/lib/
41 local _lapackver='3.11.0'
42 # BLAS
43 ln -sf libopenblasp-r$version.so libblas.so
44 ln -sf libopenblasp-r$version.so libblas.so.${_lapackver:0:1}
45 ln -sf libopenblasp-r$version.so libblas.so.${_lapackver}
46 # CBLAS
47 ln -sf libopenblasp-r$version.so libcblas.so
48 ln -sf libopenblasp-r$version.so libcblas.so.${_lapackver:0:1}
49 ln -sf libopenblasp-r$version.so libcblas.so.${_lapackver}
50 # LAPACK
51 # provided by lapack
52 # LAPACKE
53 # provided by lapack
54 #rm -r $PKG/usr/include/lapack*
55
56 # fix paths
57 sed -i 's|'$PKG'||g' $PKG/usr/lib/cmake/$name/*.cmake
58 sed -i 's|'$PKG'||g' $PKG/usr/lib/pkgconfig/openblas.pc
59
60 # remove host CPU info if built with DYNAMIC_ARCH=1
61 sed -i '/#define OPENBLAS_NEEDBUNDERSCORE/,/#define OPENBLAS_VERSION/{//!d}' \
62 $PKG/usr/include/openblas_config.h
63
64 # provide pkgconfig files for blas and cblas
65 ln -s openblas.pc $PKG/usr/lib/pkgconfig/blas.pc
66 ln -s openblas.pc $PKG/usr/lib/pkgconfig/cblas.pc
67 }
|