PKGBUILDs/community/openblas/PKGBUILD

61 lines
1.9 KiB
Bash
Raw Normal View History

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
# - clear Makefile.arm (bad cflags overrides)
# - fix library symlinking
2020-12-21 16:14:26 +00:00
pkgname=openblas
_pkgname=OpenBLAS
pkgver=0.3.21
2021-04-24 20:09:26 +00:00
pkgrel=1
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')
makedepends=('perl' 'gcc-fortran')
2021-04-24 20:09:26 +00:00
checkdepends=('cblas')
provides=('blas=3.9.0')
2020-12-21 16:14:26 +00:00
conflicts=('blas')
source=(${_pkgname}-v${pkgver}.tar.gz::https://github.com/xianyi/OpenBLAS/archive/v${pkgver}.tar.gz)
sha512sums=('4625c8e6ccfa9120281fd714d3f6b7c3ba2265470c1be76121d6b25dc3dacb899d26e5d9a417ddc616d23909f1411495aa995ef8d8d6df8511cd5cefbabcb1c5')
2020-12-21 16:14:26 +00:00
build() {
2021-04-24 20:09:26 +00:00
cd $_pkgname-$pkgver
2020-12-21 16:14:26 +00:00
truncate -s 0 Makefile.arm
[[ $CARCH == "aarch64" ]] && CONFIG="TARGET=ARMV8"
[[ $CARCH == "armv7h" ]] && CONFIG="TARGET=ARMV7"
2020-12-21 16:14:26 +00:00
make NO_STATIC=1 NO_LAPACK=1 NO_LAPACKE=1 NO_CBLAS=1 NO_AFFINITY=1 USE_OPENMP=1 \
CFLAGS="$CPPFLAGS $CFLAGS" $CONFIG \
NUM_THREADS=64 MAJOR_VERSION=3 libs shared
}
2021-04-24 20:09:26 +00:00
check() {
cd $_pkgname-$pkgver
# TODO
#make CFLAGS="$CPPFLAGS $CFLAGS -lcblas" TARGET=CORE2 tests
}
2020-12-21 16:14:26 +00:00
package() {
2021-04-24 20:09:26 +00:00
cd $_pkgname-$pkgver
2020-12-21 16:14:26 +00:00
make PREFIX="$pkgdir"/usr NUM_THREADS=64 MAJOR_VERSION=3 install
rm -f "$pkgdir"/usr/include/cblas.h "$pkgdir"/usr/include/lapack*
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
cd "$pkgdir"/usr/lib/
ln -s $(readlink "libopenblas.so.3") libblas.so
ln -s $(readlink "libopenblas.so.3") libblas.so.3
2020-12-21 16:14:26 +00:00
sed -i -e "s%$pkgdir%%" "$pkgdir"/usr/lib/cmake/openblas/OpenBLASConfig.cmake
sed -i -e "s%$pkgdir%%" "$pkgdir"/usr/lib/pkgconfig/openblas.pc
ln -s openblas.pc "$pkgdir"/usr/lib/pkgconfig/blas.pc
rmdir "$pkgdir"/usr/bin
}
# vim:set ts=2 sw=2 et: