archrelease: copy trunk to community-any
[ArchLinux/community.git] / rccl / repos / community-x86_64 / PKGBUILD
blob1ab8843d3a1ebcc30a259ec65466485788cdc402
1 # Maintainer: Torsten Keßler <tpkessler at archlinux dot org>
2 # Contriubtor: Markus Näther <naetherm@informatik.uni-freiburg.de>
3 # Contributor: acxz <akashpatel2008 at yahoo dot com>
5 pkgname=rccl
6 pkgver=5.4.3
7 pkgrel=1
8 pkgdesc="ROCm Communication Collectives Library"
9 arch=('x86_64')
10 url='https://rccl.readthedocs.io/en/rocm-5.4.3/'
11 license=('custom')
12 depends=('hip' 'rocm-smi-lib')
13 makedepends=('rocm-cmake' 'python')
14 _git='https://github.com/ROCmSoftwarePlatform/rccl'
15 source=("$pkgname-$pkgver.tar.gz::$_git/archive/rocm-$pkgver.tar.gz")
16 sha256sums=('a2524f602bd7b3b6afeb8ba9aff660216ee807fa836e46442d068b5ed5f51a4d')
17 options=(!lto)
18 _dirname="$(basename $_git)-$(basename ${source[0]} .tar.gz)"
20 build() {
21   # Compile source code for supported GPU archs in parallel
22   export HIPCC_COMPILE_FLAGS_APPEND="-parallel-jobs=$(nproc)"
23   export HIPCC_LINK_FLAGS_APPEND="-parallel-jobs=$(nproc)"
24   # -fcf-protection is not supported by HIP, see
25   # https://docs.amd.com/bundle/ROCm-Compiler-Reference-Guide-v5.4/page/Appendix_A.html
26   CXXFLAGS="${CXXFLAGS} -fcf-protection=none" \
27   cmake \
28     -Wno-dev \
29     -B build \
30     -S "$_dirname" \
31     -DCMAKE_BUILD_TYPE=None \
32     -DCMAKE_CXX_COMPILER=/opt/rocm/hip/bin/hipcc \
33     -DCMAKE_INSTALL_PREFIX=/opt/rocm
34   cmake --build build
37 package() {
38   DESTDIR="$pkgdir" cmake --install build
40   echo "/opt/rocm/$pkgname/lib" > "$pkgname.conf"
41   install -Dm644 "$pkgname.conf" "$pkgdir/etc/ld.so.conf.d/$pkgname.conf"
43   install -Dm644 "$srcdir/$_dirname/LICENSE.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"