diff options
-rw-r--r-- | .SRCINFO | 21 | ||||
-rw-r--r-- | PKGBUILD | 62 | ||||
-rw-r--r-- | adjust_rpath.patch | 19 | ||||
-rw-r--r-- | aomp-amdgpu.install | 17 | ||||
-rw-r--r-- | disable_ocl_tests.patch | 16 |
5 files changed, 112 insertions, 23 deletions
@@ -1,19 +1,26 @@ pkgbase = aomp-amdgpu pkgdesc = Clang/LLVM based compiler with added support for the OpenMP API on Radeon GPUs - pkgver = 3.5.0 + pkgver = 11.6.2 pkgrel = 1 url = https://github.com/ROCm-Developer-Tools/aomp arch = x86_64 - license = Apache-2.0 + license = Apache + makedepends = git makedepends = cmake - depends = pciutils + makedepends = python + depends = z3 depends = numactl + depends = pciutils depends = libelf depends = libffi - depends = python - depends = openmpi - source = aomp-amdgpu-3.5.0.tar.gz::https://github.com/ROCm-Developer-Tools/aomp/archive/rocm-3.5.0.tar.gz - sha256sums = e4526489833896bbc47ba865e0d115fab278ce269789a8c99a97f444595f5f6a + options = staticlibs + options = !strip + source = aomp-amdgpu-11.6.2.tar.gz::https://github.com/ROCm-Developer-Tools/aomp/archive/rel_11.6-2.tar.gz + source = disable_ocl_tests.patch + source = adjust_rpath.patch + sha256sums = e4623ecfbe743676d068b17b113aadce4524a79be31b0540a216f9597cbd9fe5 + sha256sums = bf3aab8fc2c828554ba76ab1876179130704f1c35906228fcf7e94239f5e4170 + sha256sums = 94c670cd991c95a7b6312feb77d32a11c1ac1b839218bcd251042563b7af1a44 pkgname = aomp-amdgpu @@ -1,23 +1,53 @@ -# Maintainer: acxz <akashpatel2008 at yahoo dot com> +# Maintainer: Torsten Keßler <t dot kessler at posteo dot de> +# Contributor: acxz <akashpatel2008 at yahoo dot com> + pkgname=aomp-amdgpu -pkgver=3.5.0 +pkgdesc='Clang/LLVM based compiler with added support for the OpenMP API on Radeon GPUs' +_pkgver=11.6-2 +pkgver=11.6.2 pkgrel=1 -pkgdesc="Clang/LLVM based compiler with added support for the OpenMP API on -Radeon GPUs" arch=('x86_64') -url="https://github.com/ROCm-Developer-Tools/aomp" -license=('Apache-2.0') -depends=('pciutils' 'numactl' 'libelf' 'libffi' 'python' 'openmpi') -makedepends=('cmake') -source=("$pkgname-$pkgver.tar.gz::https://github.com/ROCm-Developer-Tools/aomp/archive/rocm-$pkgver.tar.gz") -sha256sums=('e4526489833896bbc47ba865e0d115fab278ce269789a8c99a97f444595f5f6a') - -build() { - cd ${srcdir}/aomp-rocm-$pkgver - nohup make +url='https://github.com/ROCm-Developer-Tools/aomp' +license=('Apache') +depends=(z3 numactl pciutils libelf libffi) +makedepends=(git cmake python) +source=("${pkgname}-${pkgver}.tar.gz::$url/archive/rel_$_pkgver.tar.gz" + 'disable_ocl_tests.patch' + 'adjust_rpath.patch') +sha256sums=('e4623ecfbe743676d068b17b113aadce4524a79be31b0540a216f9597cbd9fe5' + 'bf3aab8fc2c828554ba76ab1876179130704f1c35906228fcf7e94239f5e4170' + '94c670cd991c95a7b6312feb77d32a11c1ac1b839218bcd251042563b7af1a44') +options=(staticlibs !strip) +_dirname="$(basename "$url")-$(basename ${source[0]} .tar.gz)" + +prepare() { + mv "$_dirname" aomp + cd aomp/bin + + AOMP_REPOS="$srcdir" \ + ./clone_aomp.sh + + cd "$srcdir/opencl-on-vdi" + patch -Np1 -i "$srcdir/disable_ocl_tests.patch" + + cd "$srcdir/aomp" + patch -Np1 -i "$srcdir/adjust_rpath.patch" } package() { - cd ${srcdir}/aomp-rocm-$pkgver - make DESTDIR="$pkgdir" install + cd aomp/bin + + #FORTIFY_SOURCE breaks flang-runtime + export CPPFLAGS="$(sed -e 's/-D_FORTIFY_SOURCE=2//' <<< "$CPPFLAGS")" + AOMP="$pkgdir/opt/rocm/aomp" \ + AOMP_REPOS="$srcdir" \ + ./build_aomp.sh + + #Fix symlink created by the build script + ln -fs "/opt/rocm/aomp_$_pkgver" "$pkgdir/opt/rocm/aomp" + + #Export AOMP variable for rocminfo + install -Dm777 /dev/stdin "$pkgdir/etc/profile.d/aomp-amdgpu.sh" <<EOF +export AOMP=/opt/rocm/aomp +EOF } diff --git a/adjust_rpath.patch b/adjust_rpath.patch new file mode 100644 index 000000000000..8431f713edf0 --- /dev/null +++ b/adjust_rpath.patch @@ -0,0 +1,19 @@ +*** aomp/bin/aomp_common_vars.bak 2020-07-04 10:03:07.970529403 +0200 +--- aomp/bin/aomp_common_vars 2020-07-04 10:03:39.017229414 +0200 +*************** +*** 43,49 **** + AOMP_APPLY_ROCM_PATCHES=${AOMP_APPLY_ROCM_PATCHES:-1} + + #Set common rpath for build scripts +! AOMP_ORIGIN_RPATH_NO_DTAGS="-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON -DCMAKE_INSTALL_RPATH=\$ORIGIN:\$ORIGIN/../lib:\$ORIGIN/../hsa/lib:\$ORIGIN/../../lib64:\$ORIGIN/../../hsa/lib:$AOMP_INSTALL_DIR/lib:$AOMP_INSTALL_DIR/hsa/lib" + AOMP_ORIGIN_RPATH="-DCMAKE_SHARED_LINKER_FLAGS='-Wl,--disable-new-dtags' $AOMP_ORIGIN_RPATH_NO_DTAGS" + + CUDA=${CUDA:-/usr/local/cuda} +--- 43,49 ---- + AOMP_APPLY_ROCM_PATCHES=${AOMP_APPLY_ROCM_PATCHES:-1} + + #Set common rpath for build scripts +! AOMP_ORIGIN_RPATH_NO_DTAGS="-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON -DCMAKE_INSTALL_RPATH=\$ORIGIN:\$ORIGIN/../lib:\$ORIGIN/../hsa/lib:\$ORIGIN/../../lib64:\$ORIGIN/../../hsa/lib:/opt/rocm/aomp/lib:/opt/rocm/aomp/hsa/lib" + AOMP_ORIGIN_RPATH="-DCMAKE_SHARED_LINKER_FLAGS='-Wl,--disable-new-dtags' $AOMP_ORIGIN_RPATH_NO_DTAGS" + + CUDA=${CUDA:-/usr/local/cuda} diff --git a/aomp-amdgpu.install b/aomp-amdgpu.install new file mode 100644 index 000000000000..4558ed2fd4a2 --- /dev/null +++ b/aomp-amdgpu.install @@ -0,0 +1,17 @@ +post_install() { + source /etc/profile.d/aomp-amdgpu.sh + export AOMP=/opt/rocm/aomp + + cat << EOF + +To compile C/C++ code with OpenMP offloading use + +$AOMP/bin/hipcc -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=$($AOMP/bin/mygpu) + +followed by additional flags and the source file. +EOF +} + +post_updgrade() { + post_install +} diff --git a/disable_ocl_tests.patch b/disable_ocl_tests.patch new file mode 100644 index 000000000000..854bd4ce8ab8 --- /dev/null +++ b/disable_ocl_tests.patch @@ -0,0 +1,16 @@ +*** opencl-on-vdi/khronos/icd/CMakeLists.txt.bak 2020-07-04 09:58:27.756892980 +0200 +--- opencl-on-vdi/khronos/icd/CMakeLists.txt 2020-07-04 09:58:43.310243549 +0200 +*************** +*** 127,137 **** + target_include_directories (OpenCL PRIVATE ${CMAKE_CURRENT_BINARY_DIR} loader) + target_link_libraries (OpenCL ${CMAKE_DL_LIBS}) + +- include (CTest) +- if (BUILD_TESTING) +- add_subdirectory (test) +- endif() +- + install (TARGETS OpenCL + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +--- 127,132 ---- |