-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.sh
executable file
·75 lines (57 loc) · 1.72 KB
/
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
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
mkdir -p "$DIR/bin" "$DIR/include" "$DIR/share" "$DIR/test"
NCORES="$(cat /proc/cpuinfo | awk '/^processor/{print $3}' | wc -l)"
# Get data
if [ ! -d "$DIR/data" ]
then
git clone https://github.com/wvu-navLab/GnssData.git "$DIR/data"
fi
# Setup Eigen
if [ -d "$DIR/3rdparty/Eigen/build" ]
then
rm -rf "$DIR/3rdparty/Eigen/build"
fi
mkdir "$DIR/3rdparty/Eigen/build"
cd "$DIR/3rdparty/Eigen/build"
cmake -DCMAKE_INSTALL_PREFIX:PATH="$DIR" ../
make install -s -j $NCORES
ln -s "$DIR/include/eigen3" "$DIR/include/Eigen"
# Setup LibCluster
if [ -d "$DIR/3rdparty/LibCluster/build" ]
then
rm -rf "$DIR/3rdparty/LibCluster/build"
fi
mkdir "$DIR/3rdparty/LibCluster/build"
cd "$DIR/3rdparty/LibCluster/build"
cmake -DCMAKE_INSTALL_PREFIX="$DIR/" -DEIGEN_INCLUDE_DIRS="$DIR/include/Eigen/" ..
make -s -j $NCORES
make install
# Setup GTSAM
if [ -d "$DIR/3rdparty/RobustGNSS/gtsam/build" ]
then
rm -rf "$DIR/3rdparty/RobustGNSS/gtsam/build"
fi
mkdir "$DIR/3rdparty/RobustGNSS/gtsam/build"
cd "$DIR/3rdparty/RobustGNSS/gtsam/build"
cmake -DGTSAM_USE_SYSTEM_EIGEN="ON" -DGTSAM_EIGEN_INCLUDE_PREFIX="$DIR/include/Eigen/" -DCMAKE_INSTALL_PREFIX="$DIR" ..
make -s -j $NCORES
make install
# Setup GPSTk
if [ -d "$DIR/3rdparty/GPSTk/build" ]
then
rm -rf "$DIR/3rdparty/GPSTk/build"
fi
# mkdir "$DIR/3rdparty/GPSTk/build"
cd "$DIR/3rdparty/GPSTk"
./build.sh -c -x -e -i "$DIR"
# Setup Examples
if [ -d "$DIR/examples/build" ]
then
rm -rf "$DIR/examples/build"
fi
cd "$DIR/examples"
./build_examples.sh
echo -e "\n\n\n\n ----------------------------------------------- \n"
echo -e " build done. :-) "
echo -e "\n ----------------------------------------------- \n\n\n"