-
Notifications
You must be signed in to change notification settings - Fork 386
/
Copy pathinstall_all_conda.sh
executable file
·68 lines (46 loc) · 2.06 KB
/
install_all_conda.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
#!/usr/bin/env bash
# Author: Luigi Freda
# This file is part of https://github.com/luigifreda/pyslam
#N.B: this install script allows you to run main_slam.py and all the scripts
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # get script dir
SCRIPT_DIR=$(readlink -f $SCRIPT_DIR) # this reads the actual path if a symbolic directory is used
ROOT_DIR="$SCRIPT_DIR"
# ====================================================
# import the bash utils
. "$ROOT_DIR"/bash_utils.sh
# ====================================================
STARTING_DIR=`pwd`
cd "$ROOT_DIR"
print_blue "Running install_all_conda.sh"
#set -e
# clean the old .env file if it exists
if [ -f "$ROOT_DIR/.env" ]; then
rm "$ROOT_DIR/.env"
fi
set_env_var "$ROOT_DIR/.env" USE_CONDA 1
# check that conda is activated
if ! command -v conda &> /dev/null ; then
print_red "ERROR: conda could not be found! Did you installe/activate conda?"
exit 1
fi
# 1. install system packages
./install_system_packages.sh
# 2. create a pyslam environment within conda (this will set the env var USING_CONDA_PYSLAM)
./pyenv-conda-create.sh
# 3. activate the created python virtual environment
. pyenv-activate.sh
# Check if the current conda environment is "pyslam"
if [ "$CONDA_DEFAULT_ENV" != "$ENV_NAME" ]; then
print_red "ERROR: The current conda environment is not '$ENV_NAME'. Please activate the '$ENV_NAME' environment and try again."
exit 1
fi
# 4. set up git submodules
./install_git_modules.sh
export WITH_PYTHON_INTERP_CHECK=ON # in order to detect the correct python interpreter
# 5. install pip packages: some unresolved dep conflicts found in requirement-pip3.txt may be managed by the following command:
. install_pip3_packages.sh
# 6. build and install cpp stuff
. install_cpp.sh # use . in order to inherit python env configuration and other environment vars
# 7. build and install thirdparty
. install_thirdparty.sh # use . in order to inherit python env configuration and other environment vars
cd "$STARTING_DIR"