diff --git a/extra/suitesparse/APKBUILD b/extra/suitesparse/APKBUILD new file mode 100644 index 0000000..b6ce5c0 --- /dev/null +++ b/extra/suitesparse/APKBUILD @@ -0,0 +1,77 @@ +# Alpine-Contributor: Jakub Jirutka +# Alpine-Maintainer: Jakub Jirutka +# Maintainer: Felix Lionardo +pkgname=suitesparse +_pkgname=SuiteSparse +pkgver=7.11.0 +pkgrel=0 +pkgdesc="A collection of sparse matrix libraries" +url="http://faculty.cse.tamu.edu/davis/suitesparse.html" +arch="all" +license="BSD-3-Clause AND LGPL-2.1-or-later AND GPL-2.0-or-later" +depends=" + gmp + mpfr + openblas + " +depends_dev=" + gmp-dev + mpfr-dev + openblas-dev + " +makedepends=" + $depends_dev + cmake + m4 + " +subpackages=" + $pkgname-static + $pkgname-dev + $pkgname-graphblas + " +source="$pkgname-$pkgver.tar.gz::https://github.com/qnx-ports/SuiteSparse/archive/refs/heads/qnx-v$pkgver.tar.gz" +builddir="$srcdir/$_pkgname-qnx-v$pkgver" + + +_flags="BLAS=-lopenblas LAPACK=-lopenblas" + +# Do not include the Partition module (it's optional and Julia doesn't need it). +# Do not try to override optimization level. SuiteSparse is a huge library +# heavily optimized for performance, so compiling with -Os doesn't make sense. +# Actually, the build scripts currently override -Os with -O3 anyway, +# but better to not rely on it. +export CFLAGS="${CFLAGS/-Os/} -DNPARTITION" +export CPPFLAGS=${CPPFLAGS/-Os/} +export CXXFLAGS=${CXXFLAGS/-Os/} + +build() { + make library $_flags CMAKE_OPTIONS="\ + -G 'Unix Makefiles' \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_INCLUDEDIR=/usr/include \ + -DCMAKE_INSTALL_LIBDIR=/usr/lib \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + " +} + +check() { + make tests || true +} + +package() { + make install $_flags DESTDIR="$pkgdir" +} + +graphblas() { + pkgdesc="Graph algorithms in the language of linear algebra" + license="Apache-2.0 AND GPL-3.0-or-later" + + amove usr/lib/libgraphblas.so.* + amove usr/lib/liblagraph.so.* + amove usr/lib/liblagraphx.so.* +} + + +sha512sums=" +99cb7d899e70e634eefba112a6b1e3195ecfa39fe561c1406c3cdd73c0aed29e9fe5f4b09bc6ca96ab746c9d2879853880f7694529f252ee4eb215a08cccd75e suitesparse-7.11.0.tar.gz +"