-
Notifications
You must be signed in to change notification settings - Fork 402
/
Copy pathinstall_system_packages.sh
executable file
·115 lines (86 loc) · 3.45 KB
/
install_system_packages.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/usr/bin/env bash
# Author: Luigi Freda
# This file is part of https://github.com/luigifreda/pyslam
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"
# ====================================================
#set -e
print_blue '================================================'
print_blue "Configuring and installing system packages ..."
# NOTE: in order to detect macOS use:
if [[ "$OSTYPE" == "darwin"* ]]; then
## MacOS
echo "Installing macOs packages with brew..."
# Check if brew is installed
if ! command -v brew &> /dev/null; then
# brew is not installed
print_red "❌ ERROR: brew could not be found!"
print_red "1. Install Homebrew: https://brew.sh/"
exit 1
fi
# install required packages
brew update
brew install wget
brew install doxygen
brew install eigen
#brew install opencv
brew install glew
brew install pkg-config
brew install suite-sparse
brew install pyenv
brew install zlib bzip2
brew install rsync
brew install readline
brew install pyenv
brew install libomp # need to add -L/opt/homebrew/opt/libomp/lib -I/opt/homebrew/opt/libomp/include
brew install boost # for serialization
brew install tmux
brew install flann
brew install catch2
#brew install numpy
#brew install open3d # We built open3d from source for different issues
brew install x265 libjpeg libde265 libheif # for pillow-heif
else
## Linux
sudo apt-get update
install_package rsync
install_package wget
install_package unzip
# system packages
install_packages build-essential cmake
install_package python3-sdl2
install_package python3-tk
install_package python3-dev
install_package libsuitesparse-dev
install_package libprotobuf-dev
install_packages libavcodec-dev libavformat-dev libavutil-dev libpostproc-dev libswscale-dev
install_package libglew-dev
install_package libeigen3-dev # pangolin installation
install_package libopencv-dev # orbslam2_features compilation
install_package libgtk2.0-dev # needed by opencv when built from source
install_package pkg-config
install_package python3-gi
install_package cmake
install_package build-essential
install_packages liblz4-dev libzstd-dev
install_package libhdf5-dev # needed when building h5py wheel from src is required (arm64)
install_packages libboost-serialization-dev libboost-system-dev libboost-filesystem-dev
install_package tmux # for launching tmux sessions
install_package libqt5gui5 # for qt5 support
install_package libomp-dev
# detect CUDA VERSION
. cuda_config.sh
if [ "$CUDA_VERSION" != "0" ]; then
# if CUDA is installed then install the required packages
sudo apt install -y cuda-command-line-tools-$CUDA_VERSION_STRING_WITH_HYPHENS cuda-libraries-$CUDA_VERSION_STRING_WITH_HYPHENS
sudo apt install -y libcusparse-dev-$CUDA_VERSION_STRING_WITH_HYPHENS libcusolver-dev-$CUDA_VERSION_STRING_WITH_HYPHENS
fi
fi
print_blue "System package configuration and installation... Done!"
cd "$STARTING_DIR"