-
Notifications
You must be signed in to change notification settings - Fork 1
/
installCkon
executable file
·37 lines (30 loc) · 934 Bytes
/
installCkon
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
#!/bin/bash
if [ $# -ge 0 ]; then
if [ $# -ge 3 ]; then
echo "too many arguments."
echo "usage: $0 prefix [nCpu]"
exit
fi
prefix=$PWD
[ $# -ge 1 ] && prefix=$1
nCpu=1
[ $# -eq 2 ] && nCpu=$2
echo "using prefix $prefix and $nCpu CPU(s)"
./autogen.sh
autoreconf -v --force --install -Wall
mkdir -v build
cd build
# BOOST_ROOT set by `module load boost/1.54.0` in ~/.login works on PDSF
boostopts='--with-boost'
[ ! -z $BOOST_ROOT ] && boostopts=$boostopts"=$BOOST_ROOT"
boostopts=$boostopts' --with-boost-filesystem --with-boost-system'
boostopts=$boostopts' --with-boost-regex --with-boost-program-options'
../configure --prefix=$prefix $boostopts
make -j $nCpu CXXFLAGS="-Wall -Werror"
make install
echo "===> ckon build done."
else
echo "usage: $0 [prefix [nCpu]]"
echo 'prefix = install dir [default=$PWD]'
echo "nCpu = #cpu's for parallel build (-j) [default=1]"
fi