summaryrefslogtreecommitdiff
path: root/libs/rocm-hipamd/MAKEPKG
blob: d355e8b13b6c3341201ed2b5c42bd620f6ae43a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/mkpkg
# description: HIP Runtime (AMD GPU compute - CLR/hipamd)
# url: https://github.com/ROCm/rocm-systems

name=rocm-hipamd
_name=therock
version=10.0
release=2
depends=(rocm-rocminfo rocm-rocr-runtime rocm-llvm)
makedeps=(cmake ninja python3 py-cppheaderparser py-ply)
source=(
    https://github.com/ROCm/rocm-systems/releases/download/$_name-$version/clr.tar.gz
    https://github.com/ROCm/rocm-systems/releases/download/$_name-$version/hip.tar.gz
    fix-os-posix-basename.awk
)
sha256sums=(
    "07caed9d726232008a2120da24f4e4bbc4998accbeadd309181fce04a9da9f99"
    "373958090db3cab854fa8a0baa5e4f9afe0ea423def204b241bfcbe74f6ce0ca"
    "0af885dac36e4f2314f226eb7b618dbf468919c3d2d13915c9cc2635c09753d5"
)

patch() {
    awk -f "$SRC/fix-os-posix-basename.awk" \
        clr/rocclr/os/os_posix.cpp > os_posix.cpp.tmp
    mv os_posix.cpp.tmp clr/rocclr/os/os_posix.cpp

    sed -i 's/__attribute__((tls_model("initial-exec")))//g' \
        clr/rocclr/thread/thread.cpp \
        clr/rocclr/thread/thread.hpp \
        clr/rocclr/platform/activity.cpp \
        clr/rocclr/platform/activity.hpp

    sed -i '1i #include <functional>' \
        clr/hipamd/src/hrr/playback/hrr_playback.cpp
}

build() {
    
    cmake -S clr -B build -G Ninja -Wno-dev \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_INSTALL_LIBDIR=lib \
        -DCMAKE_C_COMPILER=/usr/lib/rocm/llvm/bin/clang \
        -DCMAKE_CXX_COMPILER=/usr/lib/rocm/llvm/bin/clang++ \
        -DCMAKE_PREFIX_PATH="/usr;/usr/lib/rocm/llvm" \
        -DCLR_BUILD_HIP=ON \
        -DCLR_BUILD_OCL=OFF \
        -DHIP_COMMON_DIR="$PWD/hip" \
        -DHIP_PLATFORM=amd \
        -DROCM_PATH=/usr \
        -DHIP_ENABLE_ROCPROFILER_REGISTER=OFF \
        -DHIPCC_BIN_DIR=/nonexistent

    ninja -C build
    DESTDIR=$PKG ninja -C build install
}

signify() {
    untrusted comment: public key
    RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3
}

# vim: filetype=sh