-
Notifications
You must be signed in to change notification settings - Fork 3
/
jla_build.sh
executable file
·63 lines (61 loc) · 1.07 KB
/
jla_build.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
#!/bin/bash
export AS_RLIMIT=300000000
root_PWD=$(pwd)
numThreads=2
prefix="../stage"
type="OptDebug"
all="no"
while true; do
case $1 in
-j)
if [ "x$2" = "x" ]; then
echo "Missing argument for '$1'"
exit 1
fi
numThreads=$2
shift
shift
;;
"--prefix="*)
prefix=${1#--prefix=}
shift
;;
"--type="*)
type=${1#--type=}
shift
;;
"--all")
all="yes"
shift
;;
"")
break
;;
*)
echo "Unknown option '$1'"
exit 1
esac
done
args="-DCMAKE_BUILD_TYPE=$type"
args+=" -DBOOST_ROOT=$HOME/programs"
args+=" -DCMAKE_INSTALL_PREFIX=$prefix"
args+=" -DBUILD_TESTING=on -DBUILD_EXAMPLES=on -DBUILD_BIN=on"
if test "$all" = "yes"; then
args+=" -DBUILD_BIN_BENCHMARK=on -DBUILD_BIN_ALL_ALG=on"
fi
args+= "$@"
./bootstrap.sh \
&& rm -rf build && mkdir build \
&& cd build && cmake ../ $args
res=$?
if [ $res -ne 0 ]; then
echo "Error during configuration"
exit $res
fi
time make -j $numThreads \
&& make install
res=$?
if [ $res -ne 0 ]; then
echo "Error during installation"
exit $res
fi