-
Notifications
You must be signed in to change notification settings - Fork 40
/
build_libraries.sh
executable file
·77 lines (66 loc) · 2.6 KB
/
build_libraries.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
set -e # Abort on error
WORKSPACE=`pwd`
if [[ z$1 != "z" ]]; then
PLATFORM=-$1
else
PLATFORM=""
fi
echo "Using platform $PLATFORM"
# Clean up old library build dirs and libraries for this platform
rm -rf library-build libraries${PLATFORM}
# Create new ones
mkdir -p libraries${PLATFORM}/include
mkdir -p libraries${PLATFORM}/lib
mkdir library-build
cd library-build
# Build phiprof
git clone https://github.com/fmihpc/phiprof/
cd phiprof/src
if [[ $PLATFORM == "-arriesgado" ]]; then
# Special workaround for missing include paths on arriesgado
make -j 4 CCC=mpic++ CCFLAGS="-I /usr/lib/gcc/riscv64-linux-gnu/11/include -fpic -O2 -std=c++17 -DCLOCK_ID=CLOCK_MONOTONIC -fopenmp -W -Wall -Wextra -pedantic"
elif [[ $PLATFORM == "-appleM1" ]]; then
make -j 4 CCC=mpic++ CC=appleLLVM CCFLAGS="-fpic -O2 -std=c++17 -DCLOCK_ID=CLOCK_MONOTONIC -fopenmp" LDFLAGS="-fopenmp"
else
make -j 4 CCC=mpic++
fi
cp ../include/* $WORKSPACE/libraries${PLATFORM}/include
cp ../lib/* $WORKSPACE/libraries${PLATFORM}/lib
cd ../..
# Build VLSV
if [[ $PLATFORM != "-appleM1" ]]; then
git clone https://github.com/fmihpc/vlsv.git
else
git clone -b appleM1Build https://github.com/ursg/vlsv.git
fi
cd vlsv
make
cp libvlsv.a $WORKSPACE/libraries${PLATFORM}/lib
cp *.h $WORKSPACE/libraries${PLATFORM}/include
cd ..
# Build papi
if [[ $PLATFORM != "-arriesgado" && $PLATFORM != "-appleM1" ]]; then # This fails on RISCV and MacOS
git clone https://github.com/icl-utk-edu/papi
cd papi/src
./configure --prefix=$WORKSPACE/libraries${PLATFORM} && make -j 4 CC=gcc && make install
cd ../..
fi
# Build jemalloc
wget https://github.com/jemalloc/jemalloc/releases/download/4.0.4/jemalloc-4.0.4.tar.bz2
tar xjf jemalloc-4.0.4.tar.bz2
cd jemalloc-4.0.4
./configure --prefix=$WORKSPACE/libraries${PLATFORM} --with-jemalloc-prefix=je_ && make -j 4 && make install
cd ..
# Build Zoltan
git clone https://github.com/sandialabs/Zoltan.git
mkdir zoltan-build
cd zoltan-build
if [[ $PLATFORM == "-arriesgado" ]]; then
../Zoltan/configure --prefix=$WORKSPACE/libraries${PLATFORM} --enable-mpi --with-mpi-compilers --with-gnumake --with-id-type=ullong --host=riscv64-unknown-linux-gnu --build=arm-linux-gnu && make -j 4 && make install
elif [[ $PLATFORM == "-appleM1" ]]; then
../Zoltan/configure --prefix=$WORKSPACE/libraries${PLATFORM} --enable-mpi --with-mpi-compilers --with-gnumake --with-id-type=ullong CC=mpicc CXX=mpic++ && make -j 4 && make install
else
../Zoltan/configure --prefix=$WORKSPACE/libraries${PLATFORM} --enable-mpi --with-mpi-compilers --with-gnumake --with-id-type=ullong && make -j 4 && make install
cd ..
fi