Skip to content

Instantly share code, notes, and snippets.

@naetherm
Created October 19, 2019 09:55
Show Gist options
  • Save naetherm/0d48a300a8c2feb52a1e9b20b133efe3 to your computer and use it in GitHub Desktop.
Save naetherm/0d48a300a8c2feb52a1e9b20b133efe3 to your computer and use it in GitHub Desktop.
hcc-2.9.0
# Submitter: Olaf Leidinger <[email protected]>
# Maintainer: Jakub Okoński <[email protected]>
# Maintainer: Rigo Reddig <[email protected]> ;)
pkgname=hcc-git
pkgver=2.9.0
pkgrel=1
pkgdesc="HCC is an Open Source, Optimizing C++ Compiler for Heterogeneous Compute"
arch=('x86_64')
url="https://github.com/RadeonOpenCompute/hcc"
license=('NCSAOSL')
depends=('rocr-runtime=2.9.0' z3)
makedepends=(git cmake gcc ninja z3)
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
options=(!staticlibs strip)
_srcver=2.9.0
source=(
"hcc.tar.gz::https://github.com/RadeonOpenCompute/hcc/archive/roc-hcc-$_srcver.tar.gz"
"llvm.tar.gz::https://github.com/RadeonOpenCompute/llvm/archive/roc-hcc-$_srcver.tar.gz"
"compiler-rt.tar.gz::https://github.com/RadeonOpenCompute/compiler-rt/archive/roc-hcc-$_srcver.tar.gz"
"hcc-clang-upgrade.tar.gz::https://github.com/RadeonOpenCompute/hcc-clang-upgrade/archive/roc-hcc-$_srcver.tar.gz"
"clang-tools-extra.tar.gz::https://github.com/RadeonOpenCompute/clang-tools-extra/archive/roc-hcc-$_srcver.tar.gz"
"lld.tar.gz::https://github.com/RadeonOpenCompute/lld/archive/roc-hcc-$_srcver.tar.gz"
"ROCm-Device-Libs.tar.gz::https://github.com/RadeonOpenCompute/ROCm-Device-Libs/archive/roc-hcc-$_srcver.tar.gz"
)
sha256sums=('3a9dade138a0a4c9c5e05e8b016553045cd49f8c3f5d8fd80431e316d02e5f2d'
'2d0104b4293c01598dafa1ebd3441cdf9b754e6f7819a48194ff864a1d263580'
'528da4e557c7394a65f3189673783ff51e1ac7d29f2b781fd161c468311d764a'
'd02d8f0d73836b71aaee0c58155a8ac189617f7e8ae40cb9971bcf881dc922d1'
'6f1cd12fca0799e35842a8b0560b47850a9b382d2efe185fc87e51b885b4be1a'
'f3205aed9861fa1bc6bcdfdf74074d6ccefd13e17775671325e15cb60a4744dc'
'4b08d4f5e5b5898ac986c63115b2061f24b8015a933a52dbe4900b69c90eaab5')
prepare() {
cd "$srcdir"
mv -T llvm-roc-hcc-$_srcver hcc-roc-hcc-$_srcver/compiler
mv -T compiler-rt-roc-hcc-$_srcver hcc-roc-hcc-$_srcver/compiler-rt
mv -T hcc-clang-upgrade-roc-hcc-$_srcver hcc-roc-hcc-$_srcver/clang
mv -T clang-tools-extra-roc-hcc-$_srcver hcc-roc-hcc-$_srcver/clang-tools-extra
mv -T lld-roc-hcc-$_srcver hcc-roc-hcc-$_srcver/lld
mv -T ROCm-Device-Libs-roc-hcc-$_srcver hcc-roc-hcc-$_srcver/rocdl
}
build() {
mkdir -p "$srcdir/build"
cd "$srcdir/build"
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$pkgdir/opt/rocm/hcc" \
-G Ninja \
"$srcdir/hcc-roc-hcc-$_srcver"
ninja
}
package() {
ninja -C "$srcdir/build" install
# add links
mkdir -p "$pkgdir/usr/bin"
for fn in hcc hcc-config
do
ln -s /opt/rocm/hcc/bin/$fn "$pkgdir/usr/bin/$fn"
done
# additional link to make hcc demos happy
mkdir -p "$pkgdir/opt/rocm/include"
ln -s /opt/rocm/hcc/include "$pkgdir/opt/rocm/include/hcc"
# additional link to make clang-ocl work
ln -s /opt/rocm/hcc/bin "$pkgdir/opt/rocm/hcc/bin/x86_64"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment