-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-trunk.sh
executable file
·31 lines (23 loc) · 1.16 KB
/
build-trunk.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
bld_dir="/home/ivladak/build/LCA-gcc-gomp"
src_dir="/home/ivladak/src/LCA-gcc-gomp"
h_bld_dir="$bld_dir/host"
a_bld_dir="$bld_dir/accel"
prefix=$HOME/local/LCA
# install nvptx tools
cd $HOME/src/nvptx-tools && ./configure --prefix=$prefix && make -j9 && make install || exit 1
# Make a symlink so GCC builds newlib automaically
ln -sf $HOME/src/nvptx-newlib/newlib $src_dir/newlib
rm -r "$a_bld_dir"
# Build accel GCC:
mkdir -p "$a_bld_dir" && cd "$a_bld_dir" || exit 2
$src_dir/configure --prefix=$prefix --target=nvptx-none --enable-as-accelerator-for=x86_64-pc-linux-gnu --disable-sjlj-exceptions --enable-newlib-io-long-long --with-build-time-tools=$prefix/nvptx-none/bin &&
make -j20 && make install || exit 3
rm -r "$h_bld_dir"
# Build host GCC:
mkdir -p "$h_bld_dir" && cd "$h_bld_dir" || exit 4
rm $src_dir/newlib &&
$src_dir/configure --disable-multilib --enable-languages=c,c++,fortran,lto --prefix=$prefix --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --enable-offload-targets=nvptx-none --disable-bootstrap &&
make -j20 && make install || exit 5
export COMPUTE_PROFILE=1
CUDA_VISIBLE_DEVICES=-1
export LD_LIBRARY_PATH=$prefix/lib64