OpenDroneMap-ODM/configure.sh

148 wiersze
4.8 KiB
Bash
Czysty Zwykły widok Historia

2015-11-16 13:47:29 +00:00
#!/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"
2019-04-24 22:33:12 +00:00
add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
2018-01-11 02:21:18 +00:00
apt-get update
echo "Installing Required Requisites"
2018-01-11 02:21:18 +00:00
apt-get install -y -qq build-essential \
git \
cmake \
python-pip \
libgdal-dev \
gdal-bin \
libgeotiff-dev \
2017-06-27 16:43:36 +00:00
pkg-config \
libjsoncpp-dev \
2019-04-24 22:33:12 +00:00
python-gdal \
grass-core \
libssl-dev \
liblas-bin \
swig2.0 \
python-wheel \
libboost-log-dev
echo "Getting CMake 3.1 for MVS-Texturing"
2018-01-11 02:21:18 +00:00
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"
2018-01-11 02:21:18 +00:00
apt-get install -y -qq libgtk2.0-dev \
libavcodec-dev \
libavformat-dev \
libswscale-dev \
python-dev \
libtbb2 \
libtbb-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libjasper-dev \
libflann-dev \
libproj-dev \
libxext-dev \
liblapack-dev \
libeigen3-dev \
2017-06-22 13:20:29 +00:00
libvtk6-dev
echo "Removing libdc1394-22-dev due to python opencv issue"
2018-01-11 02:21:18 +00:00
apt-get remove libdc1394-22-dev
echo "Installing OpenSfM Dependencies"
apt-get install -y -qq libgoogle-glog-dev \
libsuitesparse-dev \
libboost-filesystem-dev \
libboost-iostreams-dev \
libboost-regex-dev \
libboost-python-dev \
libboost-date-time-dev \
libboost-thread-dev
2019-04-25 00:01:44 +00:00
pip install -U PyYAML==3.13 \
exifread \
gpxpy \
xmltodict \
2017-10-26 13:30:31 +00:00
appsettings \
loky \
2019-04-29 15:52:39 +00:00
repoze.lru \
rasterio \
attrs==19.1.0 \
2019-06-05 19:27:59 +00:00
pyodm==1.5.2b1 \
2019-08-08 02:57:48 +00:00
Pillow \
networkx \
scipy==1.2.1 \
numpy==1.15.4 \
shapely \
pyproj==2.2.2 \
psutil \
2019-08-08 02:57:48 +00:00
joblib
2019-05-12 14:56:09 +00:00
# Fix: /usr/local/lib/python2.7/dist-packages/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
pip install --upgrade cryptography
python -m easy_install --upgrade pyOpenSSL
echo "Compiling SuperBuild"
cd ${RUNPATH}/SuperBuild
mkdir -p build && cd build
2017-09-22 17:51:12 +00:00
cmake .. && make -j$processes
echo "Compiling build"
cd ${RUNPATH}
mkdir -p build && cd build
2017-09-22 17:51:12 +00:00
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:"
2017-09-22 17:51:12 +00:00
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"
2017-09-22 17:51:12 +00:00
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