forked from JzHuai0108/ORB_SLAM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·99 lines (86 loc) · 2.7 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Example usage
# ./build.sh /opt/ros/kinetic/share/OpenCV-3.2.0-dev /usr/include/eigen3
OPENCV_CONFIG_PATH=$1
EIGEN3_INCLUDE_FOLDER=$2
if [[ -z $OPENCV_CONFIG_PATH ]] || [[ -z $EIGEN3_INCLUDE_FOLDER ]]; then
echo "Usage: " $0 " OPENCV_CONFIG_PATH EIGEN3_INCLUDE_FOLDER"
echo "Ex. " $0 " /opt/ros/kinetic/share/OpenCV-3.2.0-dev /usr/include/eigen3"
exit -1
else
echo "OPENCV_CONFIG_PATH " $OPENCV_CONFIG_PATH
echo "EIGEN3_INCLUDE_FOLDER " $EIGEN3_INCLUDE_FOLDER
fi
build_type=Release
FULL_PATH=`pwd`
INSTALL_FOLDER=$FULL_PATH/build/slam_devel
rm -rf build
mkdir -p $INSTALL_FOLDER
cd Thirdparty
echo "Configuring and building Thirdparty/Sophus ..."
git clone https://github.com/stevenlovegrove/Sophus.git
cd Sophus
git checkout b474f05
rm -rf build
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DEIGEN3_INCLUDE_DIR:PATH=$EIGEN3_INCLUDE_FOLDER -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_FOLDER/sophus
make -j4
make install
echo "Configuring and building Thirdparty/g2o ..."
cd ../..
git clone https://github.com/RainerKuemmerle/g2o.git
cd g2o
git checkout 4d23d59
rm -rf build
mkdir -p build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_FOLDER/g2o -DEIGEN3_INCLUDE_DIR:PATH=$EIGEN3_INCLUDE_FOLDER
make -j4
make install
echo "Configuring and building Thirdparty/DBoW2 ..."
cd ../../DBoW2
rm -rf build
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=$OPENCV_CONFIG_PATH
make -j
cd ../../libviso2
echo "Configuring and building Thirdparty/libviso2 ..."
rm -rf build
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=$OPENCV_CONFIG_PATH
make -j
cd ../../vikit_common
echo "Configuring and building Thirdparty/vikit_common ..."
rm -rf build
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=$OPENCV_CONFIG_PATH -DEIGEN_INCLUDE_DIR:PATH=$EIGEN3_INCLUDE_FOLDER
make -j
cd ../../vio_common
echo "Configuring and building Thirdparty/vio_common ..."
rm -rf build
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=$OPENCV_CONFIG_PATH -DEIGEN_INCLUDE_DIR:PATH=$EIGEN3_INCLUDE_FOLDER -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_FOLDER/vio_common
make -j
make install
cd ../..
echo "Configuring and building Thirdparty/vio_g2o ..."
cd vio_g2o
rm -rf build
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=$OPENCV_CONFIG_PATH -DEIGEN_INCLUDE_DIR:PATH=$EIGEN3_INCLUDE_FOLDER -DINSTALL_PREFIX=$INSTALL_FOLDER
make -j4
cd ../../..
# now in orbslam_dwo folder
echo "Configuring and building orbslam_dwo ..."
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=$build_type -DOpenCV_DIR=$OPENCV_CONFIG_PATH -DEIGEN3_INCLUDE_DIR:PATH=$EIGEN3_INCLUDE_FOLDER -DINSTALL_PREFIX=$INSTALL_FOLDER
make -j2
cd ../Thirdparty
rm -rf Sophus
rm -rf g2o