aboutsummaryrefslogtreecommitdiffstats
path: root/community/lapack/APKBUILD
blob: a67797c416d55cce9da0c75b5d94016a23f5da02 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=lapack
pkgver=3.9.1
pkgrel=0
pkgdesc="Linear Algebra PACKage"
url="https://www.netlib.org/lapack/"
arch="all"
license="BSD-3-Clause"
options="!check" # Tests broken
makedepends="gfortran cmake"
subpackages="$pkgname-dev:_dev blas blas-dev"
source="https://github.com/Reference-LAPACK/lapack/archive/v$pkgver/lapack-v$pkgver.tar.gz"

build() {
	cmake -B build \
	    -DCMAKE_BUILD_TYPE=None \
	    -DCMAKE_INSTALL_PREFIX=/usr \
	    -DCMAKE_INSTALL_LIBDIR=lib \
	    -DCMAKE_SKIP_RPATH=ON \
	    -DBUILD_SHARED_LIBS=ON \
	    -DBUILD_TESTING=ON \
	    -DCMAKE_Fortran_COMPILER=gfortran \
	    -DLAPACKE=ON \
	    -DCBLAS=ON \
	    -DBUILD_DEPRECATED=ON
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

_dev() {
	default_dev

	mkdir -p "$pkgdir"/usr/lib \
		"$pkgdir"/usr/include  \
		"$pkgdir"/usr/lib/pkgconfig \
		"$pkgdir"/usr/lib/cmake

	# Move development files meant for blas-dev
	mv "$subpkgdir"/usr/lib/libblas.so \
		"$subpkgdir"/usr/lib/libcblas.so \
		"$pkgdir"/usr/lib

	mv "$subpkgdir"/usr/lib/pkgconfig/*blas* \
		"$pkgdir"/usr/lib/pkgconfig

	mv "$subpkgdir"/usr/lib/cmake/*blas-* \
		"$pkgdir"/usr/lib/cmake

	mv "$subpkgdir"/usr/include/*blas* \
		"$pkgdir"/usr/include
}

blas() {
	depends=""
	pkgdesc="The Basic Linear Algebra Subprograms library"

	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libblas.so.* \
		"$pkgdir"/usr/lib/libcblas.so.* \
		"$subpkgdir"/usr/lib
}

sha512sums="
1c70892ce22eb1f5c0be1e0384d00dc876622e6254e853616eb7c0379c5d1ecf2f1f94d06389dbfba06b78484daf625d899306a9dc0b31a0646320c814022fdb  lapack-v3.9.1.tar.gz
"