-
Notifications
You must be signed in to change notification settings - Fork 17
/
do_build_samurai
executable file
·94 lines (78 loc) · 1.87 KB
/
do_build_samurai
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
#! /bin/bash
# perform builds for samurai
#--------------------------------------------------------------------
# usage function
#
function usage() {
echo
echo "Perform builds for specified package"
echo "Usage:"
echo " $scriptName [options below]"
echo " -h : help"
echo " -d : turn debugging on"
echo " -p ? : prefix for installing samurai"
echo " default is /usr/local/lrose"
echo " -l ? : set lrose install dir"
echo " default is /usr/local/lrose"
echo " -i : perform install after build"
echo " -3 : use cmake3 instead of cmake"
echo
}
scriptName=$(basename $0)
debug=false
prefix=/bell-scratch/mmbell/community
LROSE_INSTALL_DIR=/bell-scratch/mmbell/community
do_install=false
use_cmake3=false
# Parse command line options.
while getopts hdi3p:l: OPT; do
case "$OPT" in
h)
usage
exit 0
;;
d)
debug=true
;;
p)
prefix=$OPTARG
;;
l)
LROSE_INSTALL_DIR=$OPTARG
;;
i)
do_install=true
;;
3)
use_cmake3=true
;;
\?)
# getopts issues an error message
echo "Problems with command line usage"
usage
exit 1
;;
esac
done
echo "===>> Building samurai <<==="
echo " prefix: $prefix"
echo " lrose_install_dir: $LROSE_INSTALL_DIR"
echo " do_install: $do_install"
export LROSE_ROOT_DIR=$LROSE_INSTALL_DIR
# clean up
/bin/rm -f CMakeCache.txt
# create makefiles
if [ "$use_cmake3" = "true" ]
then
echo "Note - using cmake3"
cmake3 -DCMAKE_INSTALL_PREFIX=${prefix} .
else
cmake -DCMAKE_INSTALL_PREFIX=${prefix} .
fi
# do the build
make -j 8
# do the install
if [ "$do_install" = "true" ]
then
make install
fi