Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 105 lines (95 sloc) 3.1 KB
#!/bin/bash
ubuntu_version=`lsb_release -rs | sed 's/\.//'`
install_common_dependencies()
{
# install most dependencies via apt-get
sudo apt-get -y update
sudo apt-get -y upgrade
# We explicitly set the C++ compiler to g++, the default GNU g++ compiler. This is
# needed because we depend on system-installed libraries built with g++ and linked
# against libstdc++. In case `c++` corresponds to `clang++`, code will not build, even
# if we would pass the flag `-stdlib=libstdc++` to `clang++`.
sudo apt-get -y install cmake pkg-config libboost-serialization-dev libboost-filesystem-dev libboost-system-dev libboost-program-options-dev libboost-test-dev libeigen3-dev libode-dev
export CXX=g++
export MAKEFLAGS="-j `nproc`"
}
install_python_binding_dependencies()
{
sudo apt-get -y install python${PYTHONV}-dev python${PYTHONV}-pip
# install additional python dependencies via pip
sudo -H pip${PYTHONV} install -vU pygccxml pyplusplus
# install castxml
wget -q -O- https://data.kitware.com/api/v1/file/5b68c2c28d777f06857c1f48/download | tar zxf - -C ${HOME}
export PATH=${HOME}/castxml/bin/castxml:${PATH}
sudo apt-get -y install libboost-python-dev
if [[ $ubuntu_version > 1710 ]]; then
sudo apt-get -y install libboost-numpy-dev python${PYTHONV}-numpy
fi
}
install_app_dependencies()
{
sudo apt-get -y install python${PYTHONV}-pyqt5.qtopengl freeglut3-dev libassimp-dev python${PYTHONV}-opengl python${PYTHONV}-flask python${PYTHONV}-celery libccd-dev
# install additional python dependencies via pip
sudo -H pip${PYTHONV} install -vU PyOpenGL-accelerate
# install fcl
if ! pkg-config --atleast-version=0.5.0 fcl; then
if [[ $ubuntu_version > 1604 ]]; then
sudo apt-get -y install libfcl-dev
else
wget -O - https://github.com/flexible-collision-library/fcl/archive/0.5.0.tar.gz | tar zxf -
cd fcl-0.5.0; cmake .; sudo -E make install; cd ..
fi
fi
}
install_ompl()
{
if [ -z $2 ]; then
OMPL="ompl"
else
OMPL="omplapp"
fi
wget -O - https://bitbucket.org/ompl/ompl/downloads/$OMPL-@PROJECT_VERSION@-Source.tar.gz | tar zxf -
cd $OMPL-@PROJECT_VERSION@-Source
mkdir -p build/Release
cd build/Release
cmake ../.. -DPYTHON_EXEC=/usr/bin/python${PYTHONV}
if [ ! -z $1 ]; then
make update_bindings
fi
make
sudo make install
}
for i in "$@"
do
case $i in
-a|--app)
APP=1
PYTHON=1
shift
;;
-p|--python)
PYTHON=1
shift
;;
*)
# unknown option -> show help
echo "Usage: `basename $0` [-p] [-a]"
echo " -p: enable Python bindings"
echo " -a: enable OMPL.app (implies '-p')"
;;
esac
done
if [[ ! -z $PYTHON ]]; then
# the default version of Python in 17.10 and above is version 3
if [[ $ubuntu_version > 1704 ]]; then
PYTHONV=3
fi
fi
install_common_dependencies
if [ ! -z $PYTHON ]; then
install_python_binding_dependencies
fi
if [ ! -z $APP ]; then
install_app_dependencies
fi
install_ompl $PYTHON $APP