-
-
Notifications
You must be signed in to change notification settings - Fork 515
Expand file tree
/
Copy pathinstall_all.sh
More file actions
executable file
·68 lines (54 loc) · 2 KB
/
install_all.sh
File metadata and controls
executable file
·68 lines (54 loc) · 2 KB
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_"
SCRIPTS_DIR="$ROOT_DIR/scripts"
# ====================================================
# import the bash utils
. "$ROOT_DIR"/bash_utils.sh
# ====================================================
STARTING_DIR=`pwd`
cd "$ROOT_DIR"
#set -e
# if we are not under docker
if [ ! -f /.dockerenv ]; then
echo "Insert your sudo password (if prompted)..."
keep_sudo_alive
fi
# Ensure the sudo background process is killed when the script exits
trap stop_sudo_alive EXIT
# Check if conda is installed
if command -v conda &> /dev/null; then
CONDA_INSTALLED=true
else
CONDA_INSTALLED=false
fi
if [[ -n "$PIXI_PROJECT_NAME" ]]; then
PIXI_ACTIVATED=true
else
PIXI_ACTIVATED=false
fi
print_blue '================================================'
print_blue "Installing pySLAM"
print_blue '================================================'
# check that conda is activated
if [ "$CONDA_INSTALLED" = true ]; then
print_blue "Installing pySLAM by using conda"
. "$SCRIPTS_DIR"/install_all_conda.sh
elif [ "$PIXI_ACTIVATED" = true ]; then
print_blue "Installing pySLAM by using pixi"
. "$SCRIPTS_DIR"/install_all_pixi.sh
else
print_blue "Installing pySLAM by using venv"
. "$SCRIPTS_DIR"/install_all_venv.sh
fi
print_blue '================================================'
print_blue "Building and installing pyslam C++ core"
print_blue '================================================'
# NOTE: activation of pySLAM python environment has been done in one of the sourced scripts:
# install_all_conda.sh, install_all_pixi.sh, install_all_venv.sh
"$ROOT_DIR"/build_cpp_core.sh
cd "$STARTING_DIR"