-
Notifications
You must be signed in to change notification settings - Fork 24
/
vq_installer.bs
executable file
·60 lines (50 loc) · 1.2 KB
/
vq_installer.bs
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
#!/bin/bash
# installer shell script for vq.
default_num_processors=$(nproc)
#
default_debug="debug0"
num_processors=${1:-$default_num_processors}
debug_mode=${2:-$default_debug}
run_tests=${3:-"no_tests"}
#echo "num_proc: "$num_processors
#echo "debug_mode: "$debug_mode
echo "building with "$num_processors" processors in debug_mode: "$debug_mode
#
#
rm -rf build
mkdir build
cd build
## spp:
#cmake ..
## mpp:
if [ "${debug_mode}" == "debug0" ]
then
CC=mpicc CXX=mpicxx cmake ..
elif [ debug_mode -eq "debug1" ]
then
CC=mpicc CXX=mpicxx cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
elif "${debug_mode}" == "debug2" || $debug_mode == "debug" ]
then
# most-debugging, slowest.
CC=mpicc CXX=mpicxx cmake .. -DCMAKE_BUILD_TYPE=Debug
else
CC=mpicc CXX=mpicxx cmake ..
fi
make -j $num_processors
cd ..
#if [ "${run_tests}"=="tests" ]
#then
# echo "making tests..."
# cd build
# make test
# cd ..
#fi
## note on cmake options for debugging -- optimization:
#CC=mpicc CXX=mpicxx cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo
## Half and half
#
#CC=mpicc CXX=mpicxx cmake -DCMAKE_BUILD_TYPE=Release
## Most optimized, can’t do backtraces
#
#CC=mpicc CXX=mpicxx cmake -DCMAKE_BUILD_TYPE=Debug
## Least optimized