【环境搭建】ubuntu18.04安装PCL, VTK

1,手动编译安装

sudo apt-get update
sudo apt-get install git build-essential linux-libc-dev
sudo apt-get install cmake cmake-gui 
sudo apt-get install libusb-1.0-0-dev libusb-dev libudev-dev
sudo apt-get install mpi-default-dev openmpi-bin openmpi-common  
sudo apt-get install libflann1.8 libflann-dev
sudo apt-get install libeigen3-dev
sudo apt-get install libboost-all-dev
sudo apt-get install libqhull* libgtest-dev
sudo apt-get install freeglut3-dev pkg-config
sudo apt-get install libxmu-dev libxi-dev 
sudo apt-get install mono-complete
sudo apt-get install qt-sdk openjdk-8-jdk openjdk-8-jre
sudo apt-get install qt4-dev-tools qt4-doc qt4-qtconfig qt4-demos qt4-designer qtcreator

# 开始安装
git clone https://github.com/PointCloudLibrary/pcl.git  # 查看最新版本号
cd pcl
mkdir release
cd release
cmake -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_PREFIX=/usr \
      -DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_examples=ON \
      -DCMAKE_INSTALL_PREFIX=/usr ..
make
sudo make install

可选项

sudo apt-get install libopenni-dev 
sudo apt-get install libopenni2-dev

https://blog.csdn.net/dantengc/article/details/78446600

2,手动编译VTK
安装qt-5.11.2

下载源码:https://vtk.org/download/

tar -xf VTK-7.1.1.tar.gz
cd VTK
mkdir build
cd build
cmake -DVTK_QT_VERSION:STRING=5 \
      -DQT_QMAKE_EXECUTABLE:PATH=/opt/Qt5.11.2/5.11.2/gcc_64/bin/qmake \
      -DVTK_Group_Qt:BOOL=ON \
      -DCMAKE_PREFIX_PATH:PATH=/opt/Qt5.11.2/5.11.2/gcc_64/lib/cmake  \
      -DBUILD_SHARED_LIBS:BOOL=ON ..
sudo make -j
sudo make install

qt中添加控件

sudo find / -name libQVTKWidgetPlugin.so

将空间拷贝至

/opt/Qt5.11.2/5.11.2/gcc_64/plugins/designer
/opt/Qt5.11.2/Tools/QtCreator/lib/Qt/plugins/designer

你可能感兴趣的:(环境搭建)