-
Notifications
You must be signed in to change notification settings - Fork 31
/
build_orb.sh
69 lines (54 loc) · 2.02 KB
/
build_orb.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
#!/bin/bash
mkdir -p thirdParty && cd thirdParty
install_path=$(pwd)/install
mkdir -p ${install_path}
python_prefix=$(python -c "import sys; print(sys.prefix)")
python_include=${python_prefix}/include/python3.9/
python_lib=${python_prefix}/lib/libpython3.9.so
python_exe=${python_prefix}/bin/python
python_env=${python_prefix}/lib/python3.9/site-packages/
numpy_include=$(python -c "import numpy; print(numpy.get_include())")
echo ${python_env}
# # build pangolin
git clone -b v0.5 https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
mkdir -p build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=${install_path}
make install -j
# build opencv-4.2.0
cd ../../
wget https://github.com/opencv/opencv/archive/4.2.0.zip
unzip 4.2.0.zip
cd opencv-4.2.0
mkdir -p build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=${install_path}
make install -j
opencv_dir=${install_path}/lib/cmake/opencv4
# build orbslam2
cd ../../
cd ORB-SLAM2-PYBIND
bash build.sh ${opencv_dir} ${install_path}
cd ../
# # build pybind
# # build boost
wget -t 999 -c https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.zip
unzip boost_1_80_0.zip
cd boost_1_80_0
./bootstrap.sh --with-libraries=python --prefix=${install_path} --with-python=${python_exe}
# # ./b2
./b2 install --with-python include=${python_include} --prefix=${install_path}
# # build orbslam_pybind
cd ../pybind
mkdir -p build && cd build
cmake .. -DPYTHON_INCLUDE_DIRS=${python_include} \
-DPYTHON_LIBRARIES=${python_lib} \
-DPYTHON_EXECUTABLE=${python_exe} \
-DBoost_INCLUDE_DIRS=${install_path}/include/boost \
-DBoost_LIBRARIES=${install_path}/lib/libboost_python39.so \
-DORB_SLAM2_INCLUDE_DIR=${install_path}/include/ORB_SLAM2 \
-DORB_SLAM2_LIBRARIES=${install_path}/lib/libORB_SLAM2.so \
-DOpenCV_DIR=${install_path}/lib/cmake/opencv4 \
-DPangolin_DIR=${install_path}/lib/cmake/Pangolin \
-DPYTHON_NUMPY_INCLUDE_DIR=${numpy_include} \
-DCMAKE_INSTALL_PREFIX=${python_env}
make install -j