# Maintainer: Torsten Keßler # Contributor: Markus Näther pkgname=rocalution pkgver=5.4.1 pkgrel=1 pkgdesc='Next generation library for iterative sparse solvers for ROCm platform' arch=('x86_64') url='https://rocalution.readthedocs.io/en/master' license=('MIT') depends=('hip' 'rocsparse' 'rocblas' 'rocprim' 'rocrand' 'openmp') makedepends=('rocm-cmake') _git='https://github.com/ROCmSoftwarePlatform/rocALUTION' source=("$pkgname-$pkgver.tar.gz::$_git/archive/rocm-$pkgver.tar.gz" "$pkgname-remove-git.patch::$_git/commit/773e8be7354bbc961d86810dbb23e6248f6e513b.patch") sha256sums=('c11b76ccd89ea65f649fe283eb2fc9056c290e7a06ea234cb88c82dacf6f9608' '9daafee87896ef043b655542f36e078b9a3f3a4a106b69849cfd8add25637cca') _dirname="$(basename "$_git")-$(basename "${source[0]}" ".tar.gz")" prepare() { cd "$_dirname" patch -Np1 -i "$srcdir/$pkgname-remove-git.patch" } build() { # -fcf-protection is not supported by HIP, see # https://docs.amd.com/bundle/ROCm-Compiler-Reference-Guide-v5.4/page/Appendix_A.html CXXFLAGS="${CXXFLAGS} -fcf-protection=none" \ cmake \ -Wno-dev \ -B build \ -S "$_dirname" \ -DCMAKE_BUILD_TYPE=None \ -DCMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc \ -DCMAKE_INSTALL_PREFIX=/opt/rocm \ -DROCM_PATH=/opt/rocm \ -DHIP_ROOT_DIR=/opt/rocm/hip \ -DSUPPORT_HIP=ON \ -DSUPPORT_OMP=ON \ -DSUPPORT_MPI=OFF \ -DBUILD_SHARED_LIBS=ON cmake --build build } package() { DESTDIR="$pkgdir" cmake --install build echo "/opt/rocm/$pkgname/lib" > "$pkgname.conf" install -Dm644 "$pkgname.conf" "$pkgdir/etc/ld.so.conf.d/rocalution.conf" install -Dm644 "$_dirname/LICENSE.md" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" }