summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorRanieri Althoff2020-01-23 05:28:29 -0300
committerRanieri Althoff2020-01-23 05:30:27 -0300
commitf65dd3f6e16f73461c4944d15a55bcb3a41dd9e9 (patch)
tree2a0c0917457706afefcc436c797fa2ed2a883bc9 /PKGBUILD
parentb8a1a32f68d73efcef3f46029df4e7a1d80ca203 (diff)
downloadaur-f65dd3f6e16f73461c4944d15a55bcb3a41dd9e9.tar.gz
v3.0.0
- v3.0.0 finally! Split into rocm-opencl-runtime (OpenCL libs) and rocm-device-libs (LLVM bitcode) for smaller packages
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD139
1 files changed, 83 insertions, 56 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 11e6238e0e5..769cc651597 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,100 +1,127 @@
# Maintainer: Ranieri Althoff <ranisalt+aur at gmail dot com>
-_opencl_icd_loader_commit="978b4b3a29a3aebc86ce9315d5c5963e88722d03"
-pkgname=rocm-opencl-runtime
-pkgver=2.10.0
-pkgrel=2
+_opencl_icd_loader_commit='978b4b3a29a3aebc86ce9315d5c5963e88722d03'
+
+pkgbase=rocm-opencl-runtime
+pkgname=(rocm-device-libs rocm-opencl-runtime)
+pkgver=3.0.0
+pkgrel=1
pkgdesc='ROCm OpenCLâ„¢ Compatible Runtime'
arch=('x86_64')
url='https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime'
license=('MIT')
depends=("rocr-runtime>=${pkgver}" 'opencl-icd-loader')
makedepends=(mesa cmake ninja git)
-provides=("${pkgname}" 'opencl-driver')
+provides=("$pkgname" 'opencl-driver')
conflicts=('rocm-opencl-git')
source=(
- "rocm-opencl-runtime::git+https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime#tag=roc-${pkgver}"
- "rocm-opencl-driver::git+https://github.com/RadeonOpenCompute/ROCm-OpenCL-Driver#tag=roc-${pkgver}"
- "llvm-ocl-${pkgver}.tar.gz::https://github.com/RadeonOpenCompute/llvm/archive/roc-ocl-${pkgver}.tar.gz"
- "clang-${pkgver}.tar.gz::https://github.com/RadeonOpenCompute/clang/archive/roc-${pkgver}.tar.gz"
- "lld-ocl-${pkgver}.tar.gz::https://github.com/RadeonOpenCompute/lld/archive/roc-ocl-${pkgver}.tar.gz"
- "rocm-device-libs::git+https://github.com/RadeonOpenCompute/ROCm-Device-Libs#tag=roc-ocl-${pkgver}"
+ "rocm-opencl-runtime::git+https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime#tag=roc-$pkgver"
+ "llvm-roc-ocl-$pkgver.tar.gz::https://github.com/RadeonOpenCompute/llvm-project/archive/roc-ocl-$pkgver.tar.gz"
+ "rocm-device-libs::git+https://github.com/RadeonOpenCompute/ROCm-Device-Libs#tag=roc-ocl-$pkgver"
+ "rocm-comgr::git+https://github.com/RadeonOpenCompute/ROCm-CompilerSupport#tag=roc-$pkgver"
+ "rocm-cmake::git+https://github.com/RadeonOpenCompute/rocm-cmake#tag=roc-$pkgver"
"opencl-icd-loader::git+https://github.com/KhronosGroup/OpenCL-ICD-Loader#commit=${_opencl_icd_loader_commit}"
+ 'change-install-location.patch'
'fix_rocm_opencl_build_order.patch'
)
sha256sums=('SKIP'
+ '7715db8fd6322bdda4a75a9220cb6c747ca7e93e94ff158d7689d10f984efa45'
+ 'SKIP'
'SKIP'
- 'c46ec3568b754a7aced6139bcc254d39ddb89016b282c467ae1b5536d8021540'
- 'acdebf229a2120ad0ccdc48a6b0e863a6a4d89f46bb62e7296f2f16bbc4a04a7'
- '105cedd4a31a6d6ad51043c384129a7705f9a5f65414e60a07c9193411b756f0'
'SKIP'
'SKIP'
+ 'f90a725a14dd972c86a6919e776e7a3a9dc1792031a9ba89d26a4068975034e6'
'0f735299810e9e22cd57f5b96a7628a0f399d445a1f3bacefd8b890e84ca372f')
prepare() {
- # emulate repo opencl.xml layout
- cd "$srcdir"
-
- ln -s "$srcdir/rocm-opencl-runtime" opencl
-
- mkdir -p "$srcdir/opencl/compiler"
- ln -s "$srcdir/rocm-opencl-driver" opencl/compiler/driver
- ln -s "$srcdir/llvm-roc-ocl-$pkgver" opencl/compiler/llvm
+ cd "$srcdir/rocm-opencl-runtime"
- mkdir -p "$srcdir/opencl/compiler/llvm/tools"
- ln -s "$srcdir/clang-roc-$pkgver" opencl/compiler/llvm/tools/clang
- ln -s "$srcdir/lld-roc-ocl-$pkgver" opencl/compiler/llvm/tools/lld
-
- mkdir -p "$srcdir/opencl/library"
- ln -s "$srcdir/rocm-device-libs" opencl/library/amdgcn
-
- mkdir -p "$srcdir/opencl/api/opencl/khronos"
- ln -s "$srcdir/opencl-icd-loader" opencl/api/opencl/khronos/icd
+ mkdir -p api/opencl/khronos
+ ln -s "$srcdir/opencl-icd-loader" api/opencl/khronos/icd
+ patch -Np1 -i "$srcdir/change-install-location.patch"
# Fix build missing dependency
# https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/issues/64#issuecomment-473502685
- cd "$srcdir/opencl"
- patch -Np1 -i "${srcdir}/fix_rocm_opencl_build_order.patch"
+ patch -Np1 -i "$srcdir/fix_rocm_opencl_build_order.patch"
}
build() {
- mkdir -p "$srcdir/build"
- cd "$srcdir/build"
-
- if check_buildoption "ccache" "y"; then
- CMAKE_FLAGS="-DROCM_CCACHE_BUILD=ON"
- fi
-
- cmake $CMAKE_FLAGS \
- -DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_INSTALL_PREFIX=/opt/rocm/opencl \
- -DCLANG_ENABLE_STATIC_ANALYZER=ON \
- -G Ninja \
- "$srcdir/opencl"
+ CMAKE_FLAGS='-DCMAKE_BUILD_TYPE=Release'
# building LLVM/Clang requires ~1.5G per unit
THREADS=$(( ($(getconf _PHYS_PAGES) * $(getconf PAGESIZE)) / 1610612736 ))
if [ "$THREADS" -lt 1 ]; then
THREADS=1
fi
+ msg2 "Building LLVM on $THREADS threads..."
+ cd "$srcdir/llvm-project-roc-ocl-$pkgver"
+ mkdir -p build && cd build
+ cmake $CMAKE_FLAGS \
+ -DLLVM_ENABLE_BINDINGS=OFF \
+ -DLLVM_ENABLE_OCAMLDOC=OFF \
+ -DLLVM_ENABLE_PROJECTS='clang;lld' \
+ -DLLVM_TARGETS_TO_BUILD='AMDGPU' \
+ -DOCAMLFIND=NO \
+ -G Ninja \
+ ../llvm
ninja "-j$THREADS"
+ LLVM_DIR="$srcdir/llvm-project-roc-ocl-$pkgver/build"
+ CMAKE_FLAGS="$CMAKE_FLAGS -DLLVM_DIR='$LLVM_DIR'"
- # FIXME Check why lld has to built manually since 2.3.0
- ninja lld
+ if check_buildoption "ccache" "y"; then
+ CMAKE_FLAGS="$CMAKE_FLAGS -DROCM_CCACHE_BUILD=ON"
+ fi
+
+ msg2 'Building prepare builtins...'
+ cd "$srcdir/rocm-device-libs/utils"
+ cmake $CMAKE_FLAGS -G Ninja ..
+ ninja
+
+ msg2 'Building device libs...'
+ cd "$srcdir/rocm-device-libs"
+ mkdir -p build && cd build
+ cmake $CMAKE_FLAGS \
+ -DCMAKE_INSTALL_PREFIX=/opt/rocm \
+ -DPREPARE_BUILTINS="$srcdir/rocm-device-libs/utils/utils/prepare-builtins/prepare-builtins" \
+ -G Ninja \
+ ..
+ ninja
+
+ msg2 'Building rocm-comgr...'
+ cd "$srcdir/rocm-comgr"
+ mkdir -p build && cd build
+ cmake $CMAKE_FLAGS \
+ -DAMDDeviceLibs_DIR="$srcdir/rocm-device-libs/build" \
+ -DClang_DIR="$LLVM_DIR/lib/cmake/clang" \
+ -G Ninja \
+ ../lib/comgr
+ ninja
+
+ msg2 'Building rocm-opencl-runtime...'
+ cd "$srcdir/rocm-opencl-runtime"
+ mkdir -p build && cd build
+ cmake $CMAKE_FLAGS \
+ -DCMAKE_INSTALL_PREFIX=/opt/rocm \
+ -DCMAKE_MODULE_PATH="$srcdir/rocm-cmake/share/rocm/cmake" \
+ -DUSE_COMGR_LIBRARY=ON \
+ -Damd_comgr_DIR="$srcdir/rocm-comgr/build/lib/cmake/amd_comgr" \
+ -G Ninja \
+ ..
+ ninja
}
-package() {
- DESTDIR="$pkgdir/" ninja -C "$srcdir/build" install
+package_rocm-device-libs() {
+ DESTDIR="$pkgdir/" ninja -C "$srcdir/rocm-device-libs/build" install
+}
+
+package_rocm-opencl-runtime() {
+ DESTDIR="$pkgdir/" ninja -C "$srcdir/rocm-opencl-runtime/build" install
# OpenCL vendor file
mkdir -p "$pkgdir/etc/OpenCL/vendors"
- echo "/opt/rocm/opencl/lib/x86_64/libamdocl64.so" > "$pkgdir/etc/OpenCL/vendors/rocm-opencl64.icd"
+ echo "/opt/rocm/lib/x86_64/libamdocl64.so" > "$pkgdir/etc/OpenCL/vendors/rocm-opencl64.icd"
mkdir -p "$pkgdir/etc/ld.so.conf.d"
- echo "/opt/rocm/opencl/lib" > "$pkgdir/etc/ld.so.conf.d/rocm-opencl.conf"
-
- # Discard AMD's OpenCL ICD Loader
- # https://wiki.archlinux.org/index.php/GPGPU#OpenCL_ICD_loader_(libOpenCL.so)
- rm -f "$pkgdir"/opt/rocm/opencl/lib/x86_64/libOpenCL.so*
+ echo "/opt/rocm/lib" > "$pkgdir/etc/ld.so.conf.d/rocm-opencl.conf"
}