The compilation process is divided into three steps:
1th Step: Prepare the compilation environment
2nd step: CMake Generation Project
3rd step: Compile and install
1th Step: Prepare the compilation environment
Ubuntu needs to install three packages before compiling VTK7.1: Qt5,x11,opengl,cmake
1. Install Qt5, download qt-opensource-linux-x64-5.7.1.run from QT official website, address: https://www.qt.io/download-open-source/#section-2
Switch to run at Ubuntu Command Terminal:
sudo chmod u+x qt-opensource-linux-x64-5.7. 1 . Runsudo. /qt-opensource-linux-x64-5.7. 1. Run
Then follow the prompts to set the installation path to complete the installation.
2. Install X11: Run command at Ubuntu Command Terminal:
sudo apt-get install Libx11-dev libxext-dev libxtst-dev libxrender-dev libxmu-dev Libxmuu-dev
3. Install OpenGL: Run command on Ubuntu Terminal:
sudo apt-get install build-essential libgl1-mesa-dev libglu1-mesa-dev Libglut-dev
4. Install CMake: Run command at Ubuntu Command Terminal:
sudo apt-get
2nd step: CMake Generation Project
1. When you are ready to compile the environment, download the VTK source code vtk-7.1.0.zip and download it on the VTK website. Switch to the source code directory and run the command at the terminal:
sudo unzip-o-d/home/source/vtk vtk-7.1. 0. zip
2. Open the CMake software GUI interface and set "where is the source code:" for the directory where the sources are located, such as/HOME/SOURCE/VTK. Set "where to build the binaries:" for the catalog generated for the project, for example:/home/source/vtk_build
3. Click the "Configure" button and select "CurrentGenerator" as "Unix makefiles" In the popup dialog box.
4. Select "VTK_GROUP_QT" option, click "Configure" button again, prompt warning message, need to set Qt installation path, set the path, click "Configure" button again
5. Set the "cmake_install_prefix" directory to the directory where you want to install VTK
5. Prompt "ConfigureDone", click "Generate" button, in Vtk_build will generate project file
3rd step: Compile and install
The command terminal switches to the Vtk_build directory and then runs the command at the terminal:
sudo makesudo make install
The middle needs to wait a long time to compile, about 1 hours or so
Disclaimer This blog article is not special note are original, reproduced please indicate the author and the original address
Ubuntu 16.04 Compilation VTK7.1