-
Notifications
You must be signed in to change notification settings - Fork 2
/
install.sh
executable file
·95 lines (84 loc) · 2.35 KB
/
install.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash
BAK_DIR=$(pwd)
BAK_MODE=$FLOATZONE_MODE
set -e
unset FLOATZONE_MODE
#Check we loaded env.sh
if [ -z $FLOATZONE_C ]
then
echo $FLOATZONE_C
echo "Env variables not found!"
exit 1
fi
#Checking if LLVM default is present
if [[ ! -f $DEFAULT_C ]]
then
mkdir -p $DEFAULT_LLVM_BUILD
cd $DEFAULT_LLVM_BUILD
cmake -DLLVM_ENABLE_PROJECTS="clang;compiler-rt;openmp" -DCMAKE_CXX_FLAGS=-DDEFAULTCLANG -DCMAKE_BUILD_TYPE=Release -GNinja -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_TARGETS_TO_BUILD="X86" -DCLANG_ENABLE_STATIC_ANALYZER=OFF -DCLANG_ENABLE_ARCMT=OFF $FLOATZONE_LLVM
ninja
cp $DEFAULT_LLVM_BUILD/projects/openmp/runtime/src/omp.h $DEFAULT_LLVM_BUILD/lib/clang/14.0.6/include
fi
#Checking Floatzone LLVM is present and compiled
if [[ ! -f $FLOATZONE_C ]]
then
#Doing the cmake of LLVM
mkdir -p $FLOATZONE_LLVM_BUILD
cd $FLOATZONE_LLVM_BUILD
cmake -DLLVM_ENABLE_PROJECTS="clang;compiler-rt;openmp" -DCMAKE_BUILD_TYPE=Release -GNinja -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_TARGETS_TO_BUILD="X86" -DCLANG_ENABLE_STATIC_ANALYZER=OFF -DCLANG_ENABLE_ARCMT=OFF $FLOATZONE_LLVM
ninja
cp $FLOATZONE_LLVM_BUILD/projects/openmp/runtime/src/omp.h $FLOATZONE_LLVM_BUILD/lib/clang/14.0.6/include
fi
#Always compile LLVM
cd $FLOATZONE_LLVM_BUILD
ninja
# If after compilation we still do not have clang, abort
if [[ ! -f $FLOATZONE_C ]]
then
echo "Missing clang, ABORT"
exit -1
fi
# Check XED
if [[ ! -f $FLOATZONE_XED_LIB_SO ]]
then
echo "Missing libxed.so, compiling it"
cd $FLOATZONE_XED
./mfile.py --shared #--extra-flags=-fPIC
if [[ ! -f $FLOATZONE_XED_LIB_SO ]]
then
echo "Missing libxed.so, ABORT"
exit -1
fi
fi
#Always compile wrap.so
cd $WRAP_DIR
make
if [[ ! -f $FLOATZONE_LIBWRAP_SO ]]
then
echo "Missing libwrap.so, ABORT"
exit -1
fi
#Check if SPEC2006 is installed
#if [[ ! -d $FLOATZONE_SPEC06 ]]
#then
# echo "Missing spec 2006 installation"
# mkdir -p /tmp/spec06
# sudo mount -o loop $FLOATZONE_SPEC06_ISO /tmp/spec06
# cd /tmp/spec06
# ./install.sh -f -d $FLOATZONE_SPEC06
# sudo umount /tmp/spec06
#fi
#
##Check if SPEC2017 is installed
#if [[ ! -d $FLOATZONE_SPEC17 ]]
#then
# echo "Missing spec 2017 installation"
# mkdir -p /tmp/spec17
# sudo mount -o loop $FLOATZONE_SPEC17_ISO /tmp/spec17
# cd /tmp/spec17
# ./install.sh -f -d $FLOATZONE_SPEC17
# sudo umount /tmp/spec17
#fi
#
cd $BAK_DIR
export FLOATZONE_MODE=$BAK_MODE