-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpcl_install_script.sh
executable file
·81 lines (66 loc) · 3.12 KB
/
pcl_install_script.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
#!/bin/bash
# This script assumes that cuda has been already installed
# and Nvidia drivers are working.
# Update repos and get git
sudo apt-get update
sudo apt-get install -y git
sudo apt-get install openjdk-8-jdk
mkdir ./tensorLibs
cd tensorLibs
git clone https://github.com/PointCloudLibrary/pcl.git pcl-trunk
# Get all libraries/dependecies
sudo apt-get install -y g++ cmake cmake-gui doxygen mpi-default-dev openmpi-bin openmpi-common libflann1.8 libflann-dev
sudo apt-get install -y libeigen3-dev libboost-all-dev libusb-dev libgtest-dev git-core freeglut3-dev pkg-config
# in some more recent ubuntu installations might need to install libusb-1.0-0-dev
sudo apt-get install -y build-essential libxmu-dev libxi-dev libusb-1.0-0-dev graphviz libudev-dev
sudo apt-get install -y phonon-backend-gstreamer phonon-backend-vlc
# QT, not completly sure about this but it worked.
sudo apt-get install -y build-essential libgl1-mesa-dev
sudo apt-get install -y qtdeclarative5-dev qt5-default qttools5-dev
# VTK from source. Tested with v 7.0.0
# while building, check MD5 downloads succeed otherwise will not build and
# cause issues later on
git clone https://gitlab.kitware.com/vtk/vtk.git
cd vtk && git checkout v7.0.0
mkdir build && cd build
cmake -DVTK_QT_VERSION:STRING=5 -DQT_QMAKE_EXECUTABLE:PATH=/usr/lib/x86_64-linux-gnu/qt5/bin/qmake -DVTK_Group_Qt:BOOL=ON -DCMAKE_PREFIX_PATH:PATH=/usr/lib/x86_64-linux-gnu/cmake/ -DBUILD_SHARED_LIBS:BOOL=ON -DVTK_RENDERING_BACKEND=OpenGL ..
make -j4 && sudo make install
# This is optional in my case, but worth installing
cd ../../ # go back to tensorLibs dir
git clone https://github.com/occipital/OpenNI2.git
cd OpenNI2 && make
cd Packaging
# Following line might cause issues in some OpenNI branches
# solution here: https://github.com/occipital/OpenNI2/issues/86
# basically need to edit some python files that create documentation
python ReleaseVersion.py x64 #For 64 bits OS
cd ..
echo "export OPENNI2_INCLUDE=$PWD/Packaging/OpenNI-Linux-x64-2.2/Include" >> ~/.bashrc
echo "export OPENNI2_REDIST=$PWD/Packaging/OpenNI-Linux-x64-2.2/Redist" >> ~/.bashrc
echo "export OPENNI2_LIB=$PWD/Bin/x64-Release" >> ~/.bashrc
echo "export OPENNI2_INC=$PWD/Include" >> ~/.bashrc
echo "export PATH=\$PATH:$PWD/Bin/x64-Release" >> ~/.bashrc
echo "export PATH=\$PATH:$PWD/Bin/x64-Release/OpenNI2" >> ~/.bashrc
cd ..
# Get qhull
git clone https://github.com/qhull/qhull.git
cd qhull/build/
cmake ..
make && sudo make install
cd ../
make && sudo make install
echo "export LD_LIBRARY_PATH=$PWD/lib:\$LD_LIBRARY_PATH" >> ~/.bashrc
## If error during qhull libraries install
# Need to fix manually the -lm flags in Makefile
##cd src/libqhull && make
##make && sudo make install
## Need to fix manually the -lm flags in Makefile
# also need to fix rbox_r.c include of "libqhull/random_r.h" -> "random_r.h"
# cd ../libqhull_r/ && make && sudo make install
# go to root dir -> tensorLibs
cd ../
cd pcl-trunk
source ~/.bashrc
mkdir build && cd build
cmake -DBUILD_GPU=ON -DBUILD_CUDA=ON -DBUILD_gpu_kinfu=OFF -DBUILD_examples=OFF -DBUILD_OPENNI2=ON -DBUILD_examples=ON -DPCL_VERSION=1.8 -DWITH_VTK=ON -DWITH_QT=ON ..
make -j4 && sudo make install