summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorRanieri Althoff2019-11-26 18:36:53 -0300
committerRanieri Althoff2019-11-26 18:40:05 -0300
commita0f3af8f39b262576e048fbe30b48cbd1dfca5a8 (patch)
tree4012f9f1d23a62a009acde8fe26e4b2a49d50dd5 /PKGBUILD
parenta2eeac274a2f0f48639a231d0bb28ae21443742a (diff)
downloadaur-a0f3af8f39b262576e048fbe30b48cbd1dfca5a8.tar.gz
v2.10.0
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD117
1 files changed, 50 insertions, 67 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 42f29088c90..1925403af1d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,21 +1,17 @@
# Maintainer: Ulysses R Ribeiro <ulyssesrr@gmail.com>
-_opencl_icd_loader_commit="7433f2acbf5bbc400f26494ff1dc895da6265bef"
+_opencl_icd_loader_commit="978b4b3a29a3aebc86ce9315d5c5963e88722d03"
pkgname=rocm-opencl-runtime
-pkgver=2.6.0
+pkgver=2.10.0
pkgrel=1
-pkgdesc="ROCm OpenCLâ„¢ Compatible Runtime"
+pkgdesc='ROCm OpenCLâ„¢ Compatible Runtime'
arch=('x86_64')
url="https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime"
license=('MIT')
-groups=()
depends=("rocr-runtime>=${pkgver}" "opencl-icd-loader")
-makedepends=(mesa cmake ninja gcc ocaml-findlib python2-z3 gtest git)
+makedepends=(mesa cmake ninja git)
provides=("${pkgname}" "opencl-driver")
conflicts=("rocm-opencl-git")
-replaces=()
-backup=()
-options=()
source=(
"rocm-opencl-runtime-${pkgver}.tar.gz::https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/roc-${pkgver}.tar.gz"
"rocm-opencl-driver-${pkgver}.tar.gz::https://github.com/RadeonOpenCompute/ROCm-OpenCL-Driver/archive/roc-${pkgver}.tar.gz"
@@ -24,100 +20,87 @@ source=(
"lld-roc-ocl-${pkgver}.tar.gz::https://github.com/RadeonOpenCompute/lld/archive/roc-ocl-${pkgver}.tar.gz"
"rocm-device-libs-${pkgver}.tar.gz::https://github.com/RadeonOpenCompute/ROCm-Device-Libs/archive/roc-ocl-${pkgver}.tar.gz"
"OpenCL-ICD-Loader-${_opencl_icd_loader_commit}.zip::https://github.com/KhronosGroup/OpenCL-ICD-Loader/archive/${_opencl_icd_loader_commit}.zip"
- "fix_rocm_opencl_build_order.patch"
+ 'fix_rocm_opencl_build_order.patch'
)
-#pkgver=2.6.0; sha256sum rocm-opencl-runtime-${pkgver}.tar.gz rocm-opencl-driver-${pkgver}.tar.gz llvm-roc-ocl-${pkgver}.tar.gz clang-roc-${pkgver}.tar.gz lld-roc-ocl-${pkgver}.tar.gz rocm-device-libs-${pkgver}.tar.gz OpenCL-ICD-Loader-*.zip fix_rocm_opencl_build_order.patch | cut -d ' ' -f 1
-sha256sums=(
- "da037b1c27b389a053a29954f9fb8c4acdc41dc104d686bcc9b6ad78445e48ba"
- "47f26ce3148dbcf93eb3a49736b3ce98616e3b3b36dafa64b7fa8ca5f50d0391"
- "ecceff93d7cf9e9a4f3e13db6c4902bb83ecb3b305c3b95ab1fa320e7f1b4e9a"
- "e613e157db7c869b2d2a8db871821cfa0809ba264b4036eca4c7d2aa65f37f27"
- "f736320af427d3611a4a9b527fd438d5d4a9284d0dedd1de90aa40e568628462"
- "d8b287cce02c1dd007dfbc4e4cea1dac619d2d249cbb2c66d3547c3b2d038e25"
- "b21a114e624231d1dfd95038def122b35d0ecbf9bc1c704b8c5aec88c5bf4842"
- "0f735299810e9e22cd57f5b96a7628a0f399d445a1f3bacefd8b890e84ca372f"
-)
+sha256sums=('7b38b1be2217d7b0ac552e4cfb5fe38660fa59ef61f2a46946bac6fba6efdf7c'
+ '00a50696732a4cd3b880cfb11a64d02c5dfd956a79796eacda166173c14eb97a'
+ 'c46ec3568b754a7aced6139bcc254d39ddb89016b282c467ae1b5536d8021540'
+ 'acdebf229a2120ad0ccdc48a6b0e863a6a4d89f46bb62e7296f2f16bbc4a04a7'
+ '105cedd4a31a6d6ad51043c384129a7705f9a5f65414e60a07c9193411b756f0'
+ 'ed56c5f742bd8b2fc7e1124434fa575f51573900444adc235ce6785f3eb56d9d'
+ '6c79fddd59e92182d7bc9048415b51e60e49f952b11eeffd69cccb3081359f78'
+ '0f735299810e9e22cd57f5b96a7628a0f399d445a1f3bacefd8b890e84ca372f')
prepare() {
# emulate repo opencl.xml layout
- cd $srcdir
-
- # <project path="opencl" name="ROCm-OpenCL-Runtime"/>
- ln -s $srcdir/ROCm-OpenCL-Runtime-roc-${pkgver} opencl
-
- #<project path="opencl/compiler/driver" name="ROCm-OpenCL-Driver"/>
- mkdir -p $srcdir/opencl/compiler/
- ln -s $srcdir/ROCm-OpenCL-Driver-roc-${pkgver} opencl/compiler/driver
-
- #<project path="opencl/compiler/llvm" name="llvm"/>
- mkdir -p $srcdir/opencl/compiler/
- ln -s $srcdir/llvm-roc-ocl-${pkgver} opencl/compiler/llvm
-
- #<project path="opencl/compiler/llvm/tools/clang" name="clang"/>
- mkdir -p $srcdir/opencl/compiler/llvm/tools/
- ln -s $srcdir/clang-roc-${pkgver} opencl/compiler/llvm/tools/clang
-
- #<project path="opencl/compiler/llvm/tools/lld" name="lld"/>
- mkdir -p $srcdir/opencl/compiler/llvm/tools/
- ln -s $srcdir/lld-roc-ocl-${pkgver} opencl/compiler/llvm/tools/lld
-
- #<project path="opencl/library/amdgcn" name="ROCm-Device-Libs"/>
- mkdir -p $srcdir/opencl/library/
- ln -s $srcdir/ROCm-Device-Libs-roc-ocl-${pkgver} opencl/library/amdgcn
-
- #<project path="opencl/api/opencl/khronos/icd" name="OpenCL-ICD-Loader"
- mkdir -p $srcdir/opencl/api/opencl/khronos/
- ln -s $srcdir/OpenCL-ICD-Loader-${_opencl_icd_loader_commit} opencl/api/opencl/khronos/icd
-
+ cd "$srcdir"
+
+ ln -s "$srcdir/ROCm-OpenCL-Runtime-roc-$pkgver" opencl
+
+ mkdir -p "$srcdir/opencl/compiler"
+ ln -s "$srcdir/ROCm-OpenCL-Driver-roc-$pkgver" opencl/compiler/driver
+ ln -s "$srcdir/llvm-roc-ocl-$pkgver" opencl/compiler/llvm
+
+ 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-roc-ocl-$pkgver" opencl/library/amdgcn
+
+ mkdir -p "$srcdir/opencl/api/opencl/khronos"
+ ln -s "$srcdir/OpenCL-ICD-Loader-$_opencl_icd_loader_commit" opencl/api/opencl/khronos/icd
+
# Fix build missing dependency
# https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/issues/64#issuecomment-473502685
- cd $srcdir/opencl
- patch --forward --strip=1 --input="${srcdir}/fix_rocm_opencl_build_order.patch"
+ cd "$srcdir/opencl"
+ patch -Np1 -i "${srcdir}/fix_rocm_opencl_build_order.patch"
}
build() {
MEM_AVAIL=`cat /proc/meminfo | grep MemTotal | awk {'print $2'}`
AVAIL_THREADS=`nproc`
# require ~1536MB per thread
- MAX_THREADS=`echo $(( ${MEM_AVAIL} / $(( 1024 * 1536 ))))`
- if [ ${MAX_THREADS} -lt ${AVAIL_THREADS} ]; then
- NUM_BUILD_THREADS=${MAX_THREADS}
+ MAX_THREADS=`echo $(( "$MEM_AVAIL" / $(( 1024 * 1536 ))))`
+ if [ "$MAX_THREADS" -lt "$AVAIL_THREADS" ]; then
+ NUM_BUILD_THREADS="$MAX_THREADS"
else
- NUM_BUILD_THREADS=${AVAIL_THREADS}
+ NUM_BUILD_THREADS="$AVAIL_THREADS"
fi
- if [ ${NUM_BUILD_THREADS} -lt 1 ]; then
+ if [ "$NUM_BUILD_THREADS" -lt 1 ]; then
NUM_BUILD_THREADS=1
fi
- mkdir -p $srcdir/build
- cd $srcdir/build
-
+
+ mkdir -p "$srcdir/build"
+ cd "$srcdir/build"
+
## mimic AMD official binaries LDFLAGS
#export LDFLAGS="-Wl,--no-as-needed"
-
+
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/rocm/opencl \
-DCLANG_ENABLE_STATIC_ANALYZER=ON \
-G Ninja \
- $srcdir/opencl
+ "$srcdir/opencl"
# -jNUM_BUILD_THREADS to avoid Out of Memory
- ninja -j$NUM_BUILD_THREADS
-
+ ninja "-j$NUM_BUILD_THREADS"
+
# FIXME Check why lld has to built manually since 2.3.0
ninja lld
}
package() {
- DESTDIR="$pkgdir/" ninja -C $srcdir/build install
+ DESTDIR="$pkgdir/" ninja -C "$srcdir/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"
- mkdir -p "$pkgdir/etc/ld.so.conf.d/"
+ 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*
+ rm -f "$pkgdir"/opt/rocm/opencl/lib/x86_64/libOpenCL.so*
}