blob: afdf05dbef93470630aba8caff20c472ae59d4ae (
plain)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
#!/hint/bash
# shellcheck disable=SC2034
# Maintainer : bartus <arch-user-repoᘓbartus.33mail.com>
# Contributor: pingplug <pingplug@foxmail.com>
# Contributor: cornholio <vigo.the.unholy.carpathian@gmail.com>
##### Configuration Options
# Specify GPU compute capability Fermi (2.x) or Kepler (3.x) or Maxwell (5.x)
#_GPU_TARGET=Fermi
#_GPU_TARGET=Kepler
#_GPU_TARGET=Maxwell
#_GPU_TARGET=Pascal
#_GPU_TARGET=Volta
# Can also be one of these: sm_20 sm_30 sm_50 sm_60 sm_70 etc.
#_GPU_TARGET=sm_30
##### End
pkgname=magma
pkgver=2.5.1
pkgrel=1
pkgdesc="Provides a dense linear algebra library similar to LAPACK but for heterogeneous/hybrid architectures, starting with current 'Multicore+GPU' systems (with CUDA)"
arch=('x86_64')
url="https://icl.cs.utk.edu/magma/"
license=('custom')
depends=('blas' 'lapack')
checkdepends=('python')
makedepends=('gcc-fortran' 'cmake' 'cuda')
options=('staticlibs')
source=("http://icl.cs.utk.edu/projectsfiles/${pkgname}/downloads/${pkgname}-${pkgver}.tar.gz")
sha256sums=('ce32c199131515336b30c92a907effe0c441ebc5c5bdb255e4b06b2508de109f')
build() {
#prepare() {
_CMAKE_FLAGS=(\
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/magma \
)
if [[ -n "${_GPU_TARGET}" ]] ; then
_CMAKE_FLAGS+=(-DGPU_TARGET=${_GPU_TARGET})
fi
if [[ -f "/usr/lib/ccache/bin/nvcc-ccache" ]] ; then
_CMAKE_FLAGS+=( \
-DCUDA_NVCC_EXECUTABLE=/usr/lib/ccache/bin/nvcc-ccache \
)
fi
if _cuda_gcc=$(basename $(readlink /opt/cuda/bin/gcc)) ; then
if [[ -L "/usr/lib/ccache/bin/$_cuda_gcc" ]] ; then
_CMAKE_FLAGS+=( \
-DCUDA_HOST_COMPILER=/usr/lib/ccache/bin/$_cuda_gcc \
)
fi
fi
#}
#
#build() {
cd "${srcdir}/magma-${pkgver}"
mkdir build-shared && pushd build-shared
cmake \
${_CMAKE_FLAGS[@]} \
-DBUILD_SHARED_LIBS:BOOL=ON \
..
make magma magma_sparse
popd
mkdir build-static && pushd build-static
cmake \
${_CMAKE_FLAGS[@]} \
-DBUILD_SHARED_LIBS:BOOL=OFF \
..
make magma magma_sparse
popd
}
package() {
cd "${srcdir}/magma-${pkgver}/build-shared"
# do not build test
sed -i "s/install: preinstall/install: magma_sparse/g" Makefile
make DESTDIR="${pkgdir}" install
cd "${srcdir}/magma-${pkgver}/build-static"
# do not build test
sed -i "s/install: preinstall/install: magma_sparse/g" Makefile
make DESTDIR="${pkgdir}" install
mkdir -p ${pkgdir}/opt/magma/example
cp -ru ${srcdir}/magma-${pkgver}/example/* ${pkgdir}/opt/magma/example/
mkdir -p ${pkgdir}/opt/magma/testing
cp -ru ${srcdir}/magma-${pkgver}/testing/* ${pkgdir}/opt/magma/testing/
rm -rf ${pkgdir}/opt/magma/lib/pkgconfig
mkdir -p ${pkgdir}/usr/share/licenses/magma
cp ${srcdir}/magma-${pkgver}/COPYRIGHT ${pkgdir}/usr/share/licenses/magma/LICENSE
}
# vim:set ts=2 sw=2 et:
|