-
Notifications
You must be signed in to change notification settings - Fork 350
/
install_cpp.sh
executable file
·70 lines (51 loc) · 1.87 KB
/
install_cpp.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
#!/usr/bin/env bash
# NOTE: If you get build errors related to python interpreter check under Linux then run the following command:
# export WITH_PYTHON_INTERP_CHECK=ON
# ====================================================
# import the utils
. bash_utils.sh
# ====================================================
#set -e
#echo ROOT_DIR: $ROOT_DIR
cd $ROOT_DIR # from bash_utils.sh
# ====================================================
# check if we have external options
EXTERNAL_OPTIONS=$@
if [[ -n "$EXTERNAL_OPTIONS" ]]; then
echo "external option: $EXTERNAL_OPTIONS"
fi
# check if we want to add a python interpreter check
if [[ -n "$WITH_PYTHON_INTERP_CHECK" ]]; then
echo "WITH_PYTHON_INTERP_CHECK: $WITH_PYTHON_INTERP_CHECK "
EXTERNAL_OPTIONS="$EXTERNAL_OPTIONS -DWITH_PYTHON_INTERP_CHECK=$WITH_PYTHON_INTERP_CHECK"
fi
OpenCV_DIR="$ROOT_DIR/thirdparty/opencv/install/lib/cmake/opencv4"
if [[ -d "$OpenCV_DIR" ]]; then
EXTERNAL_OPTIONS="$EXTERNAL_OPTIONS -DOpenCV_DIR=$OpenCV_DIR"
fi
echo "EXTERNAL_OPTIONS: $EXTERNAL_OPTIONS"
# ====================================================
# check if want to use conda or venv
if [ -z $USING_CONDA_PYSLAM ]; then
if [[ -z "${USE_PYSLAM_ENV}" ]]; then
USE_PYSLAM_ENV=0
fi
if [ $USE_PYSLAM_ENV -eq 1 ]; then
. pyenv-activate.sh
fi
else
echo "Using conda pyslam..."
. pyenv-conda-activate.sh
fi
print_blue '================================================'
print_blue "Building and installing cpp ..."
CURRENT_USED_PYENV=$(get_virtualenv_name)
print_blue "currently used pyenv: $CURRENT_USED_PYENV"
cd cpp
# build utils
cd utils
. build.sh $EXTERNAL_OPTIONS # use . in order to inherit python env configuration
cd ..
cd ..
# NOTE: If you get build errors related to python interpreter check under Linux then run the following command:
# export WITH_PYTHON_INTERP_CHECK=ON