forked from OpenDroneMap/ODM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.sh
executable file
·153 lines (130 loc) · 4.72 KB
/
configure.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/bin/bash
if [[ $2 =~ ^[0-9]+$ ]] ; then
processes=$2
else
processes=$(nproc)
fi
install() {
## Set up library paths
export PYTHONPATH=$RUNPATH/SuperBuild/install/lib/python2.7/dist-packages:$RUNPATH/SuperBuild/src/opensfm:$PYTHONPATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RUNPATH/SuperBuild/install/lib
## Before installing
echo "Updating the system"
apt-get update
add-apt-repository -y ppa:ubuntugis/ppa
apt-get update
echo "Installing Required Requisites"
apt-get install -y -qq build-essential \
git \
cmake \
python-pip \
libgdal-dev \
gdal-bin \
libgeotiff-dev \
pkg-config \
libjsoncpp-dev \
python-gdal
echo "Getting CMake 3.1 for MVS-Texturing"
apt-get install -y software-properties-common python-software-properties
add-apt-repository -y ppa:george-edison55/cmake-3.x
apt-get update -y
apt-get install -y --only-upgrade cmake
echo "Installing OpenCV Dependencies"
apt-get install -y -qq libgtk2.0-dev \
libavcodec-dev \
libavformat-dev \
libswscale-dev \
python-dev \
python-numpy \
libtbb2 \
libtbb-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libjasper-dev \
libflann-dev \
libproj-dev \
libxext-dev \
liblapack-dev \
libeigen3-dev \
libvtk6-dev
echo "Removing libdc1394-22-dev due to python opencv issue"
apt-get remove libdc1394-22-dev
## Installing OpenSfM Requisites
echo "Installing OpenSfM Dependencies"
apt-get install -y -qq python-networkx \
libgoogle-glog-dev \
libsuitesparse-dev \
libboost-filesystem-dev \
libboost-iostreams-dev \
libboost-regex-dev \
libboost-python-dev \
libboost-date-time-dev \
libboost-thread-dev \
python-pyproj
pip install -U PyYAML \
exifread \
gpxpy \
xmltodict \
appsettings \
loky \
repoze.lru
echo "Installing Ecto Dependencies"
pip install -U catkin-pkg
apt-get install -y -qq python-empy \
python-nose \
python-pyside
echo "Installing OpenDroneMap Dependencies"
apt-get install -y -qq python-scipy \
liblas-bin
echo "Installing lidar2dems Dependencies"
apt-get install -y -qq swig2.0 \
python-wheel \
libboost-log-dev
echo "Installing split-merge Dependencies"
pip install -U scipy shapely numpy pyproj
pip install -U https://github.com/gipit/gippy/archive/1.0.0.zip psutil
echo "Compiling SuperBuild"
cd ${RUNPATH}/SuperBuild
mkdir -p build && cd build
cmake .. && make -j$processes
echo "Compiling build"
cd ${RUNPATH}
mkdir -p build && cd build
cmake .. && make -j$processes
echo "Configuration Finished"
}
uninstall() {
echo "Removing SuperBuild and build directories"
cd ${RUNPATH}/SuperBuild
rm -rfv build src download install
cd ../
rm -rfv build
}
reinstall() {
echo "Reinstalling ODM modules"
uninstall
install
}
usage() {
echo "Usage:"
echo "bash configure.sh <install|update|uninstall|help> [nproc]"
echo "Subcommands:"
echo " install"
echo " Installs all dependencies and modules for running OpenDroneMap"
echo " reinstall"
echo " Removes SuperBuild and build modules, then re-installs them. Note this does not update OpenDroneMap to the latest version. "
echo " uninstall"
echo " Removes SuperBuild and build modules. Does not uninstall dependencies"
echo " help"
echo " Displays this message"
echo "[nproc] is an optional argument that can set the number of processes for the make -j tag. By default it uses $(nproc)"
}
if [[ $1 =~ ^(install|reinstall|uninstall|usage)$ ]]; then
RUNPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
"$1"
else
echo "Invalid instructions." >&2
usage
exit 1
fi