2020-12-21 16:14:26 +00:00
|
|
|
# Maintainer: Felix Yan <felixonmars@archlinux.org>
|
|
|
|
# Contributor: Giuseppe Borzi <gborzi _AT_ ieee _DOT_ org>
|
|
|
|
|
|
|
|
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
|
|
|
# - set build targets
|
|
|
|
|
2023-02-04 02:42:14 +00:00
|
|
|
pkgbase=openblas
|
|
|
|
pkgname=(openblas openblas64)
|
2020-12-21 16:14:26 +00:00
|
|
|
_pkgname=OpenBLAS
|
2023-04-14 22:49:30 +00:00
|
|
|
pkgver=0.3.23
|
|
|
|
pkgrel=1
|
2023-02-04 02:42:14 +00:00
|
|
|
_blasver=3.9.0
|
2020-12-21 16:14:26 +00:00
|
|
|
pkgdesc="An optimized BLAS library based on GotoBLAS2 1.13 BSD"
|
|
|
|
arch=('x86_64')
|
|
|
|
url="https://www.openblas.net/"
|
|
|
|
license=('BSD')
|
|
|
|
depends=('gcc-libs')
|
2023-02-04 02:42:14 +00:00
|
|
|
makedepends=('cmake' 'perl' 'gcc-fortran')
|
|
|
|
#checkdepends=('cblas')
|
2023-04-14 22:49:30 +00:00
|
|
|
source=(${_pkgname}-v${pkgver}.tar.gz::https://github.com/xianyi/OpenBLAS/archive/v${pkgver}.tar.gz)
|
|
|
|
sha512sums=('ea64c693e57eb63cc2a88e4d6ab2d8cf9ab84ae6a15048fb12090a3570dd41053e62e99c1ff9d3e02dd67ca93233591ab41b8c017d06585d0a69222e1ad3023f')
|
2020-12-21 16:14:26 +00:00
|
|
|
|
|
|
|
build() {
|
2023-02-04 02:42:14 +00:00
|
|
|
[[ $CARCH == "aarch64" ]] && CORE="ARMV8"
|
|
|
|
[[ $CARCH == "armv7h" ]] && CORE="ARMV7"
|
2020-12-21 16:14:26 +00:00
|
|
|
|
2023-02-04 02:42:14 +00:00
|
|
|
cmake -B build -S $_pkgname-$pkgver \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
|
|
-DBUILD_SHARED_LIBS=ON \
|
|
|
|
-DBUILD_WITHOUT_LAPACK=ON \
|
|
|
|
-DBUILD_WITHOUT_CBLAS=ON \
|
|
|
|
-DBUILD_TESTING=OFF \
|
|
|
|
-DNO_AFFINITY=ON \
|
|
|
|
-DUSE_OPENMP=1 \
|
|
|
|
-DNO_WARMUP=1 \
|
|
|
|
-DCORE=$CORE \
|
|
|
|
-DNUM_THREADS=64 \
|
|
|
|
-DDYNAMIC_ARCH=ON
|
|
|
|
cmake --build build
|
2020-12-21 16:14:26 +00:00
|
|
|
|
2023-02-04 02:42:14 +00:00
|
|
|
cmake -B build64 -S $_pkgname-$pkgver \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
|
|
-DBUILD_SHARED_LIBS=ON \
|
|
|
|
-DBUILD_WITHOUT_LAPACK=ON \
|
|
|
|
-DBUILD_WITHOUT_CBLAS=ON \
|
|
|
|
-DBUILD_TESTING=OFF \
|
|
|
|
-DNO_AFFINITY=ON \
|
|
|
|
-DUSE_OPENMP=1 \
|
|
|
|
-DNO_WARMUP=1 \
|
|
|
|
-DCORE=$CORE \
|
|
|
|
-DNUM_THREADS=64 \
|
|
|
|
-DDYNAMIC_ARCH=ON \
|
|
|
|
-DINTERFACE64=1
|
|
|
|
cmake --build build64
|
2020-12-21 16:14:26 +00:00
|
|
|
}
|
|
|
|
|
2021-04-24 20:09:26 +00:00
|
|
|
check() {
|
|
|
|
cd $_pkgname-$pkgver
|
|
|
|
# TODO
|
|
|
|
#make CFLAGS="$CPPFLAGS $CFLAGS -lcblas" TARGET=CORE2 tests
|
|
|
|
}
|
|
|
|
|
2023-02-04 02:42:14 +00:00
|
|
|
package_openblas() {
|
|
|
|
provides=("blas=$_blasver")
|
|
|
|
conflicts=('blas')
|
2020-12-21 16:14:26 +00:00
|
|
|
|
2023-02-04 02:42:14 +00:00
|
|
|
DESTDIR="$pkgdir" cmake --install build
|
|
|
|
install -Dm644 $_pkgname-$pkgver/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
|
2020-12-21 16:14:26 +00:00
|
|
|
|
|
|
|
cd "$pkgdir"/usr/lib/
|
2023-02-04 02:42:14 +00:00
|
|
|
ln -s libopenblas.so.${pkgver%.*} libblas.so
|
|
|
|
ln -s libopenblas.so.${pkgver%.*} libblas.so.3
|
2020-12-21 16:14:26 +00:00
|
|
|
ln -s openblas.pc "$pkgdir"/usr/lib/pkgconfig/blas.pc
|
2023-02-04 02:42:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package_openblas64() {
|
|
|
|
pkgdesc+=" (64-bit integers)"
|
|
|
|
provides=("blas64=$_blasver")
|
|
|
|
conflicts=('blas64')
|
2020-12-21 16:14:26 +00:00
|
|
|
|
2023-02-04 02:42:14 +00:00
|
|
|
DESTDIR="$pkgdir" cmake --install build64
|
|
|
|
install -Dm644 $_pkgname-$pkgver/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
|
|
|
|
|
|
|
|
cd "$pkgdir"/usr/lib/
|
|
|
|
ln -s libopenblas_64.so.${pkgver%.*} libblas64.so
|
|
|
|
ln -s libopenblas_64.so.${pkgver%.*} libblas64.so.3
|
|
|
|
ln -s libopenblas_64.so.${pkgver%.*} libopenblas64_.so # Needed by julia
|
|
|
|
ln -s openblas64.pc "$pkgdir"/usr/lib/pkgconfig/blas64.pc
|
2020-12-21 16:14:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# vim:set ts=2 sw=2 et:
|