blob: 5b7493c0d2368b3cb28995c449c6a15c2fbbeb69 (
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
97
98
99
100
|
# Maintainer: Gustavo Alvarez <sl1pkn07@gmail.com>
pkgbase=libcutensor
pkgname=(
'libcutensor'
'libcutensor-common'
'libcutensor-cuda11.0'
'libcutensor-cuda11.8'
)
pkgver=2.0.0.7
pkgrel=1
pkgdesc="GPU-accelerated tensor linear algebra library"
arch=('x86_64')
url='https://developer.nvidia.com/cutensor'
license=('custom:NVIDIA')
source=("libcutensor-linux-x86_64-${pkgver}.tar.xz::https://developer.download.nvidia.com/compute/cutensor/redist/libcutensor/linux-x86_64/libcutensor-linux-x86_64-${pkgver}-archive.tar.xz")
sha256sums=('df6338aed18e5b6ae0c49521053d1606d2a41e187d7f5eccf9180af6bbc4ef68')
_create_links() {
# create soname links
find "${pkgdir}" -type f -name '*.so*' -print0 | while read -d $'\0' _lib; do
_soname=$(dirname "${_lib}")/$(readelf -d "${_lib}" | grep -Po 'SONAME.*: \[\K[^]]*' || true)
_base=$(echo ${_soname} | sed -r 's/(.*)\.so.*/\1.so/')
[[ -e "${_soname}" ]] || ln -s $(basename "${_lib}") "${_soname}"
[[ -e "${_base}" ]] || ln -s $(basename "${_soname}") "${_base}"
done
}
# build() {
# exit
# }
package_libcutensor() {
depends=(
'gcc-libs'
'cuda'
"libcutensor-common=${pkgver}"
)
conflicts=('libcutensor-cuda12')
cd "libcutensor-linux-x86_64-${pkgver}-archive"
install -Dm644 lib/12/libcutensor_static.a "${pkgdir}/opt/cuda/targets/x86_64-linux/lib/libcutensor_static.a"
install -Dm644 lib/12/libcutensor_static.a "${pkgdir}/opt/cuda/targets/x86_64-linux/lib/libcutensorMg_static.a"
install -Dm755 "lib/12/libcutensor.so.${pkgver:0:5}" "${pkgdir}/opt/cuda/targets/x86_64-linux/lib/libcutensor.so.${pkgver:0:5}"
install -Dm755 "lib/12/libcutensorMg.so.${pkgver:0:5}" "${pkgdir}/opt/cuda/targets/x86_64-linux/lib/libcutensorMg.so.${pkgver:0:5}"
_create_links
install -d "${pkgdir}/usr/share/licenses/${pkgname}"
ln -s /usr/share/licenses/libcutensor-common/license.txt "${pkgdir}/usr/share/licenses/${pkgname}/license.txt"
}
package_libcutensor-cuda11.0() {
pkgdesc+=" (CUDA 11.0)"
depends=(
'gcc-libs'
'cuda-11.0'
"libcutensor-common=${pkgver}"
)
cd "libcutensor-linux-x86_64-${pkgver}-archive"
install -Dm644 lib/11.0/libcutensor_static.a "${pkgdir}/opt/cuda-11.0/targets/x86_64-linux/lib/libcutensor_static.a"
install -Dm644 lib/11.0/libcutensorMg_static.a "${pkgdir}/opt/cuda-11.0/targets/x86_64-linux/lib/libcutensorMg_static.a"
install -Dm755 "lib/11.0/libcutensor.so.${pkgver:0:5}" "${pkgdir}/opt/cuda-11.0/targets/x86_64-linux/lib/libcutensor.so.${pkgver:0:5}"
install -Dm755 "lib/11.0/libcutensorMg.so.${pkgver:0:5}" "${pkgdir}/opt/cuda-11.0/targets/x86_64-linux/lib/libcutensorMg.so.${pkgver:0:5}"
_create_links
install -d "${pkgdir}/usr/share/licenses/${pkgname}"
ln -s /usr/share/licenses/libcutensor-common/license.txt "${pkgdir}/usr/share/licenses/${pkgname}/license.txt"
}
package_libcutensor-cuda11.8() {
pkgdesc+=" (CUDA 11.8)"
depends=(
'gcc-libs'
'cuda-11.8'
"libcutensor-common=${pkgver}"
)
cd "libcutensor-linux-x86_64-${pkgver}-archive"
install -Dm644 lib/11/libcutensor_static.a "${pkgdir}/opt/cuda-11.0/targets/x86_64-linux/lib/libcutensor_static.a"
install -Dm644 lib/11/libcutensorMg_static.a "${pkgdir}/opt/cuda-11.0/targets/x86_64-linux/lib/libcutensorMg_static.a"
install -Dm755 "lib/11/libcutensor.so.${pkgver:0:5}" "${pkgdir}/opt/cuda-11.0/targets/x86_64-linux/lib/libcutensor.so.${pkgver:0:5}"
install -Dm755 "lib/11/libcutensorMg.so.${pkgver:0:5}" "${pkgdir}/opt/cuda-11.0/targets/x86_64-linux/lib/libcutensorMg.so.${pkgver:0:5}"
_create_links
install -d "${pkgdir}/usr/share/licenses/${pkgname}"
ln -s /usr/share/licenses/libcutensor-common/license.txt "${pkgdir}/usr/share/licenses/${pkgname}/license.txt"
}
package_libcutensor-common() {
pkgdesc+=" (Common bits)"
arch=('any')
cd "libcutensor-linux-x86_64-${pkgver}-archive"
for i in $(find include -type f); do install -Dm644 ${i} "${pkgdir}/usr/${i}"; done
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
|