# Maintainer: Torsten Keßler # Contributor: Markus Näther # Contributor: acxz pkgname=hipsparse pkgver=5.1.0 pkgrel=1 pkgdesc='rocSPARSE marshalling library.' arch=('x86_64') url='https://rocmdocs.amd.com/en/latest/ROCm_Libraries/ROCm_Libraries.html#hipsparse' license=('MIT') depends=('hip' 'rocsparse') makedepends=('cmake' 'git' 'gcc-fortran') _git='https://github.com/ROCmSoftwarePlatform/hipSPARSE' source=("$pkgname-$pkgver.tar.gz::$_git/archive/rocm-$pkgver.tar.gz") sha256sums=('f41329534f2ff477a0db6b7f77a72bb062f117800970c122d676db8b207ce80b') _dirname="$(basename "$_git")-$(basename "${source[0]}" ".tar.gz")" build() { # -fcf-protection is not supported by HIP, see # https://github.com/ROCm-Developer-Tools/HIP/blob/rocm-5.0.x/docs/markdown/clang_options.md CXX=/opt/rocm/bin/hipcc \ CXXFLAGS="${CXXFLAGS} -fcf-protection=none" \ cmake -Wno-dev -S "$_dirname" \ -DCMAKE_CXX_STANDARD=20 \ -DCMAKE_INSTALL_PREFIX=/opt/rocm \ -Damd_comgr_DIR=/opt/rocm/lib/cmake/amd_comgr \ -DAMDDeviceLibs_DIR=/opt/rocm/lib/cmake/AMDDeviceLibs \ -Dhip_DIR=/opt/rocm/hip/lib/cmake/hip \ -Drocsparse_DIR=/opt/rocm/rocsparse/lib/cmake/rocsparse \ -DBUILD_CLIENTS_SAMPLES=OFF \ -DBUILD_CLIENTS_TESTS=OFF make } package() { DESTDIR="$pkgdir" make install install -Dm644 /dev/stdin "$pkgdir/etc/ld.so.conf.d/hipsparse.conf" << EOF /opt/rocm/hipsparse/lib EOF install -Dm644 "$srcdir/hipSPARSE-rocm-$pkgver/LICENSE.md" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" }