2019-06-11 23:45:47 +02:00
|
|
|
# Description: Optimized BLAS library
|
2020-06-27 18:26:39 +00:00
|
|
|
# URL: https://www.openblas.net/
|
2019-06-11 23:45:47 +02:00
|
|
|
# Maintainer: Tim Biermann, tbier at posteo dot de
|
|
|
|
# Depends on: gcc-fortran
|
|
|
|
|
|
|
|
name=openblas
|
2022-08-08 22:34:19 +02:00
|
|
|
version=0.3.21
|
2020-02-10 09:19:13 +01:00
|
|
|
release=1
|
2019-08-10 11:06:51 +02:00
|
|
|
source=(https://github.com/xianyi/OpenBLAS/archive/v$version/OpenBLAS-$version.tar.gz)
|
2019-06-11 23:45:47 +02:00
|
|
|
|
|
|
|
build () {
|
|
|
|
cd OpenBLAS-$version
|
2020-02-04 16:01:47 +00:00
|
|
|
make NO_LAPACK=1 NO_LAPACKE=1 NO_STATIC=1 NO_AFFINITY=1 \
|
|
|
|
USE_OPENMP=1 DYNAMIC_ARCH=1 NUM_THREADS=64 MAJOR_VERSION=3 \
|
2019-06-11 23:45:47 +02:00
|
|
|
CFLAGS="$CFLAGS $CPPFLAGS" libs netlib shared
|
|
|
|
make PREFIX=$PKG/usr install
|
|
|
|
|
2020-01-20 18:30:03 +00:00
|
|
|
# Symlink to provide blas, cblas
|
2019-06-11 23:45:47 +02:00
|
|
|
cd $PKG/usr/lib/
|
2020-06-14 23:12:22 +00:00
|
|
|
local _lapackver='3.10.0'
|
2019-06-11 23:45:47 +02:00
|
|
|
# BLAS
|
2020-02-04 16:01:47 +00:00
|
|
|
ln -sf libopenblasp-r$version.so libblas.so
|
|
|
|
ln -sf libopenblasp-r$version.so libblas.so.${_lapackver:0:1}
|
|
|
|
ln -sf libopenblasp-r$version.so libblas.so.${_lapackver}
|
2019-06-11 23:45:47 +02:00
|
|
|
# CBLAS
|
2020-02-04 16:01:47 +00:00
|
|
|
ln -sf libopenblasp-r$version.so libcblas.so
|
|
|
|
ln -sf libopenblasp-r$version.so libcblas.so.${_lapackver:0:1}
|
|
|
|
ln -sf libopenblasp-r$version.so libcblas.so.${_lapackver}
|
2019-06-11 23:45:47 +02:00
|
|
|
# LAPACK
|
2020-01-20 17:55:22 +00:00
|
|
|
# provided by lapack
|
2019-06-11 23:45:47 +02:00
|
|
|
# LAPACKE
|
2020-01-20 17:55:22 +00:00
|
|
|
# provided by lapack
|
2020-02-10 09:19:13 +01:00
|
|
|
rm -r $PKG/usr/include/lapack*
|
2020-02-04 16:01:47 +00:00
|
|
|
|
2019-06-11 23:45:47 +02:00
|
|
|
# fix paths
|
|
|
|
sed -i 's|'$PKG'||g' $PKG/usr/lib/cmake/$name/*.cmake
|
|
|
|
sed -i 's|'$PKG'||g' $PKG/usr/lib/pkgconfig/openblas.pc
|
|
|
|
|
|
|
|
# remove host CPU info if built with DYNAMIC_ARCH=1
|
|
|
|
sed -i '/#define OPENBLAS_NEEDBUNDERSCORE/,/#define OPENBLAS_VERSION/{//!d}' \
|
|
|
|
$PKG/usr/include/openblas_config.h
|
2020-02-04 16:01:47 +00:00
|
|
|
|
|
|
|
# provide pkgconfig files for blas and cblas
|
|
|
|
ln -s openblas.pc $PKG/usr/lib/pkgconfig/blas.pc
|
|
|
|
ln -s openblas.pc $PKG/usr/lib/pkgconfig/cblas.pc
|
2019-06-11 23:45:47 +02:00
|
|
|
}
|