archrelease: copy trunk to community-any
[ArchLinux/community.git] / rocfft / trunk / PKGBUILD
blob78864352f1ec942f02c8062207db96b8b8ef28ae
1 # Maintainer: Torsten Keßler <tpkessler at archlinux dot org>
2 # Contributor: Jakub Okoński <jakub@okonski.org>
3 # Contributor: Markus Näther <naetherm@cs.uni-freiburg.de>
4 pkgname=rocfft
5 pkgver=5.5.0
6 pkgrel=1
7 pkgdesc='Next generation FFT implementation for ROCm'
8 arch=('x86_64')
9 url='https://rocfft.readthedocs.io/en/latest/library.html'
10 license=('MIT')
11 depends=('hip' 'python')
12 makedepends=('rocm-cmake')
13 _git='https://github.com/ROCmSoftwarePlatform/rocFFT'
14 source=("$pkgname-$pkgver.tar.gz::$_git/archive/rocm-$pkgver.tar.gz")
15 sha256sums=('9288152e66504b06082e4eed8cdb791b4f9ae2836b3defbeb4d2b54901b96485')
16 options=(!lto)
17 _dirname="$(basename "$_git")-$(basename "${source[0]}" ".tar.gz")"
19 build() {
20   # Compile source code for supported GPU archs in parallel
21   export HIPCC_COMPILE_FLAGS_APPEND="-parallel-jobs=$(nproc)"
22   export HIPCC_LINK_FLAGS_APPEND="-parallel-jobs=$(nproc)"
23   # -fcf-protection is not supported by HIP, see
24   # https://docs.amd.com/bundle/ROCm-Compiler-Reference-Guide-v5.5/page/Compiler_Options_and_Features.html#d2e2018
25   CXXFLAGS="${CXXFLAGS} -fcf-protection=none" \
26   cmake \
27     -Wno-dev \
28     -B build \
29     -S "$_dirname" \
30     -DCMAKE_BUILD_TYPE=None \
31     -DCMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc \
32     -DCMAKE_INSTALL_PREFIX=/opt/rocm
33   cmake --build build
36 package() {
37   DESTDIR="$pkgdir" cmake --install build
39   echo "/opt/rocm/$pkgname/lib" > "$pkgname.conf"
40   install -Dm644 "$pkgname.conf" "$pkgdir/etc/ld.so.conf.d/rocfft.conf"
42   install -Dm644 "$srcdir/$_dirname/LICENSE.md" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"