ubuntu16.04LTS + QT5 + CUDA8.0 + PCL + OpenCV3.2

1:Install QT5   ##### need or download .run or .deb file. Just use commands as following:
    sudo apt-get install build-essential

    sudo apt-get install cmake qt5-default qtcreator

2:Download and install cuda8.0 from org:
    ##### https://developer.nvidia.com/cuda-80-ga2-download-archive
    ##### cuda8.0 is easier than 9.0 to config. cuda8.0 and opencv3.2 may be safe, opencv3.2 and cuda9.0 lead error.

    sudo dpkg -i cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb
    sudo dpkg -i cuda-repo-ubuntu1604-8-0-local-cublas-performance-update_8.0.61-1_amd64.deb
    sudo apt-get update
    sudo apt-get install cuda

    gedit ~/.bashrc and add following at the end
    export PATH=$PATH:/usr/local/cuda-8.0/bin
    source ~/.bashrc

3:Install pcl1.8   
    #####https://blog.csdn.net/dantengc/article/details/78446600
    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 libvtk6
    sudo apt-get install ibvtk6-dev libvtk6-qt-dev
    sudo apt-get install libqhull* libgtest-dev  
    sudo apt-get install freeglut3-dev pkg-config  
    sudo apt-get install libxmu-dev libxi-dev libproj9 libproj-dev
    sudo apt-get install mono-complete  libopenni-dev
    sudo apt-get install qt-sdk openjdk-8-jdk openjdk-8-jre  

    git clone https://github.com/PointCloudLibrary/pcl.git 

    mkdir build

    cd build

    cmake -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_GPU=ON  -DBUILD_CUDA=ON -DBUILD_OPENNI=ON -DBUILD_gpu_kinfu=ON -DBUILD_gpu-kinfu_large_scale=ON -DBUILD_apps=ON 

     -DBUILD_examples=ON -DCMAKE_INSTALL_PREFIX=/usr .. 

     make -j2         ###### Dot install anything when compling pcl, or you may occurre troubles
     sudo make install

4:Download and install OpenCV3.2 

    #####cuda8.0 and opencv3.2 are compatible. opencv3.2 and cuda9.0 are not.

    ####OpenCV3.2 : https://opencv.org/releases.html

    cd opencv3.2

    mkdir build

    cd build

    cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_CUDA=ON  -D                     WITH_OPENMP=ON -D WITH_QT=ON -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-8.0 -D CUDA_ARCH_BIN=5.0     -D WITH_GTK=ON -D WITH_VTK=OFF ..      

    #####-D WITH_VTK=OFF may not use. cuda may lead errors. so we can make cuda off , vtk off when errors                because of them.

     #####  -DCUDA_ARCH_BIN=5.0 5.0 is for GT940M, and 6.2 is for TX2. TX2 is so powerful!

     Nvidia GPU compute capability: https://blog.csdn.net/xiaxuesong666/article/details/79192162

5:Config xxxxlidar sdk env
   sudo apt-get install libproj-dev libpcap-dev libboost-all-dev libyaml-cpp-dev libjpeg-dev libgdal-dev libpq-dev              libvtk6-dev libvtk6-qt-dev libpcl-dev 

   if occurs error "'nullptr' was not declared in this scope", please :
   add two followings commands in ~/.bashrc and source it
   alias gcc='gcc -std=gnu++0x'
   alias g++='g++ -std=gnu++0x'

猜你喜欢

转载自blog.csdn.net/gaoxiaochuan89/article/details/80611445