-
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
# Maintainer: Torsten Keßler <t dot kessler at posteo dot de>
# Contributor: acxz <akashpatel at yahoo dot com>
# Contributor: JP-Ellis <josh@jpellis.me>
pkgname=miopen-hip
pkgver=4.5.2
pkgrel=1
pkgdesc="AMD's Machine Intelligence Library (HIP backend)"
arch=('x86_64')
url="https://github.com/ROCmSoftwarePlatform/MIOpen"
license=('MIT')
depends=('rocblas' 'rocm-clang-ocl' 'hip')
makedepends=('cmake' 'rocm-cmake' 'miopengemm')
provides=('miopen')
conflicts=('miopen')
source=("$pkgname-$pkgver.tar.gz::$url/archive/rocm-$pkgver.tar.gz")
sha256sums=('cb49bdf215ed9881755239b6312d72f829c1a0edf510e6d1fbb206c41f5406fc')
_dirname="$(basename "$url")-$(basename "${source[0]}" .tar.gz)"
build() {
cd "$_dirname"
# -fcf-protection is not supported by HIP, see
# https://github.com/ROCm-Developer-Tools/HIP/blob/rocm-4.5.x/docs/markdown/clang_options.md
# -fPIC fixes linking errors with boost.
export CXX=/opt/rocm/llvm/bin/clang++
export CXXFLAGS="${CXXFLAGS} -fcf-protection=none -fPIC"
cmake -P install_deps.cmake \
--minimum --prefix "$srcdir/deps"
cmake -B build -Wno-dev \
-DMIOPEN_BACKEND=HIP \
-DCMAKE_INSTALL_PREFIX=/opt/rocm \
-DCMAKE_PREFIX_PATH="$srcdir/deps"
make -C build
}
package() {
DESTDIR="$pkgdir" make -C "$_dirname/build" install
install -d "$pkgdir/etc/ld.so.conf.d"
cat << EOF > "$pkgdir/etc/ld.so.conf.d/miopen.conf"
/opt/rocm/miopen/lib
EOF
install -Dm644 "$srcdir/$_dirname/LICENSE.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}