summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoracxz2020-04-25 19:49:38 -0400
committeracxz2020-04-25 19:49:38 -0400
commit84c7ba1f0edab22b6a76b6df1ae5bb26914df76f (patch)
tree3f694ced0e384c6754d8543e10e00f38cc6a750f
downloadaur-84c7ba1f0edab22b6a76b6df1ae5bb26914df76f.tar.gz
add llvm-amdgpu
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD48
2 files changed, 63 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..4c6c39eeed1
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = llvm-amdgpu
+ pkgdesc = Radeon Open Compute - LLVM toolchain (llvm, clang, lld)
+ pkgver = 3.3.0
+ pkgrel = 1
+ url = https://github.com/RadeonOpenCompute/llvm-project
+ arch = x86_64
+ license = custom:Apache 2.0 with LLVM Exception
+ makedepends = cmake
+ makedepends = python
+ depends = z3
+ source = https://github.com/RadeonOpenCompute/llvm-project/archive/rocm-ocl-3.3.0.tar.gz
+ sha256sums = a2bef7042e8e2f2cd8548cb246b88322e1c77188839983dcac8312d56f544dc8
+
+pkgname = llvm-amdgpu
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..769c9fb7a1c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,48 @@
+# Maintainer: acxz <akashpatel2008 at yahoo dot com>
+
+pkgname=llvm-amdgpu
+pkgdesc='Radeon Open Compute - LLVM toolchain (llvm, clang, lld)'
+pkgver=3.3.0
+pkgrel=1
+arch=('x86_64')
+url='https://github.com/RadeonOpenCompute/llvm-project'
+license=('custom:Apache 2.0 with LLVM Exception')
+depends=(z3)
+makedepends=(cmake python)
+source=("$url/archive/rocm-ocl-$pkgver.tar.gz")
+sha256sums=('a2bef7042e8e2f2cd8548cb246b88322e1c77188839983dcac8312d56f544dc8')
+_dirname="$(basename "$url")-$(basename "${source[0]}" .tar.gz)"
+
+build() {
+ # building LLVM/Clang requires ~1.5G per unit
+ THREADS=$(( ($(getconf _PHYS_PAGES) * $(getconf PAGESIZE)) / 1610612736 ))
+ if [ "$THREADS" -lt 1 ]; then
+ THREADS=1
+ fi
+ NPROC=$(nproc)
+ if [ "$THREADS" -gt $(nproc) ]; then
+ THREADS="$NPROC"
+ fi
+
+ cmake -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX='/opt/rocm/llvm' \
+ -DLLVM_HOST_TRIPLE=$CHOST \
+ -DLLVM_BUILD_LLVM_DYLIB=ON \
+ -DLLVM_BUILD_UTILS=ON \
+ -DLLVM_ENABLE_BINDINGS=OFF \
+ -DLLVM_ENABLE_OCAMLDOC=OFF \
+ -DLLVM_ENABLE_PROJECTS='llvm;clang;lld' \
+ -DLLVM_LINK_LLVM_DYLIB=ON \
+ -DLLVM_TARGETS_TO_BUILD='AMDGPU;X86' \
+ -DOCAMLFIND=NO \
+ "$_dirname/llvm"
+ MAKEFLAGS="$MAKEFLAGS -j$THREADS" make
+}
+
+check() {
+ make check
+}
+
+package() {
+ DESTDIR="$pkgdir" make install
+}