-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_llvm_copy.sh
51 lines (48 loc) · 1.45 KB
/
install_llvm_copy.sh
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
module load ninja
ROOTDIR=`pwd`
export CCACHE_DIR=/dev/shm/rydahl1/ccache
mkdir -p $CCACHE_DIR
TARGETDIR=/dev/shm/rydahl1/LLVM
SRCDIR=/g/g92/rydahl1/LLVM2/llvm-project
if [ -d $TARGETDIR/build ] && [ -d $TARGETDIR/install/bin ]; then
source recompile.sh
exit(0)
fi
#cd $SRCDIR
#git apply $ROOTDIR/patches/*.patch
mkdir -p $TARGETDIR
cd $TARGETDIR
rm -rf build
mkdir build
rm -rf install
mkdir install
INSTALLDIR=$TARGETDIR/install
cd build
module load rocm
cmake \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$INSTALLDIR \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CXX_LINK_FLAGS="-Wl,-rpath,$LD_LIBRARY_PATH" \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_BUILD_EXAMPLES=ON \
-DLLVM_LIT_ARGS=-v \
-DLLVM_LIBC_FULL_BUILD=1 \
-DLLVM_TARGETS_TO_BUILD="host;AMDGPU;NVPTX" \
-DLLVM_ENABLE_PROJECTS="clang;lld;openmp;pstl" \
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libc" \
-DLIBOMPTARGET_ENABLE_DEBUG=ON \
-DLIBCXX_ENABLE_OPENMP_OFFLOAD=ON \
-DLIBC_GPU_ARCHITECTURES="gfx906;gfx90a;sm_70;sm_80" \
-DLIBC_GPU_TEST_ARCHITECTURE=gfx906 \
-DLIBC_GPU_VENDOR_MATH=ON \
$SRCDIR/llvm
ninja install -j 63
export LLVMPATH=$TARGETDIR/install/
export PATH=$TARGETDIR/install/bin/:$PATH
export LD_LIBRARY_PATH=$TARGETDIR/install/lib/:$LD_LIBRARY_PATH
cd $ROOTDIR
module load rocm
#ninja check-clang