• 制作U盘安装盘

    1
    http://vickyzhang.blog.51cto.com/5930715/1751000
  • 安装gcc、make、git、Gtk2.0

    1
    2
    3
    4
    5
    6
    7
    8
    yum -y install gcc
    yum -y install gcc-c++
    yum -y install make
    yum -y install git
    yum -y groupinstall "Development Tools"
    yum -y kernel-devel
    yum -y install libgnomeui-devel //解决 No package ‘gtk+-2.0′ found问题
    yum -y install libX* //有时,Linux/CentOS系统没有g++包或g++的部分包
  • 安装cmake

    1
    2
    sudo yum install cmake 
    sudo yum install cmake-gui
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
wget https://cmake.org/files/v3.6/cmake-3.6.0.tar.gz    //下载

tar -xzvf cmake-3.6.0.tar.gz //解压

cd cmake-3.6.0 //进入目录

./bootstrap --prefix=/home/software/cmake_install //设置安装路径

gmake

make install

vi /etc/profile
//在文件末尾处增加一下三行代码
#cmake tools
PATH=/home/software/cmake_install/bin:$PATH
export PATH

source /etc/profile //source命令使刚修改的文件生效

echo $PATH //接着使用echo命令查看PATH的值

cmake --version //检查cmake是否成功安装
  • 安装openGL

    1
    2
    yum list mesa*      // 它会列出所有可用的mesa包 
    yum install mesa* // 安装所有可用的mesa包
  • 安装freeglut

    1
    yum install freeglut*
  • 安装python

    1
    yum install python-devel
  • 安装tcl、tk

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    tar -zxvf tcl8.5.9-src.tar.gz
    cd tcl8.5.9/
    cd unix/
    ./configure --prefix=/usr/local/tcl/ --enable-shared
    make
    make install

    tar -zxvf tk8.5.9-src.tar.gz
    cd tk8.5.9/
    cd unix/
    ./configure --prefix=/usr/local/tk/ --with-tcl=/usr/local/tcl/lib/ --enable-shared
    make
    make install
  • 安装XCB:

    1
    2
    3
    4
    5
    6
    yum whatprovides "*/libxcb-xlib.so"

    tar -xvzf libxcb-1.11.1.tar
    ./configure
    make
    make install
  • 安装qt-everywhere-opensource-src-5.7.0.tar

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    tar -zxvf qt-everywhere-opensource-src-5.7.0.tar
    vi .bash_profile

    QTDIR=/home/software/qt-everywhere-opensource-src-5.7.0
    export PATH=$QTDIR/bin:$PATH
    export MANPATH=$QTDIR/man:$MANPATH
    export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
    export LIBGL_ALWAYS_INDIRECT=y
    source .bash_profile

    cd qt-everywhere-opensource-src-5.7.0
    ./configure
    gmake
    gmake install
  • 安装vtk

    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
    //官网(http://vtk.org/VTK/resources/software.html#latest)下载
    VTK-6.0.0.tar.gz //source
    VTKData-6.0.0.tar.gz //data

    // 解压 VTK-6.0.0.tar.gz和VTKData-6.0.0.tar.gz至VTK-6.0.0
    tar -xzvf VTK-6.0.0.tar.gz
    tar -xzvf VTKData-6.0.0.tar.gz

    // 在同级目录建立VTK-build目录并进入执行makefile的创建
    mkdir VTK-build
    cd VTK-build
    cmake ../VTK-6.0.0

    //跳出配置页面进行配置后,执行make
    make

    //出现错误,In file included from /usr/include/GL/glx.h:333:0,from /home/mildred/Work/3DKF/VTK/Rendering/vtkXOpenGLRenderWindow.cxx:31:/usr/include/GL/glxext.h:480:143: error: ‘GLintptr’ has not been declared

    //The solution is to define GLX_GLXEXT_LEGACY during the build. This is done but commented in the file Rendering/vtkXOpenGLRenderWindow.cxx for VTK 5.x or Rendering/OpenGL/vtkXOpenGLRenderWindow.cxx for VTK 6.x.

    //Either uncomment the line (this is for example an ArchLinux patch for the package):

    //--- a/Rendering/OpenGL/vtkXOpenGLRenderWindow.cxx.orig 2014-11-23 22:16:50.000000000 +0100

    //+++ b/Rendering/OpenGL/vtkXOpenGLRenderWindow.cxx 2014-11-23 22:16:59.000000000 +0100 @@ -27,7 +27,7 @@

    // define GLX_GLXEXT_LEGACY to prevent glx.h to include glxext.h provided by
    // the system
    // #define GLX_GLXEXT_LEGACY
    // #define GLX_GLXEXT_LEGACY
    // #include "GL/glx.h"

    // #include "vtkgl.h"

    //Or, if you don't want to be invasive on the source code, you can add the flags to the compiler command line. For example by adding -DCMAKE_C_FLAGS=-DGLX_GLXEXT_LEGACY -DCMAKE_CXX_FLAGS=-DGLX_GLXEXT_LEGACY to your cmake command line. Your cmake command will look like:

    cmake -DCMAKE_C_FLAGS=-DGLX_GLXEXT_LEGACY -DCMAKE_CXX_FLAGS=-DGLX_GLXEXT_LEGACY -Wno-dev ../VTK-6.0.0

//编译完后,执行安装

1
make install

//在用户目录下设置vtk-lib的路径

1
2
vi .bash_profile
export LD_LIBRARY_PATH=/usr/lib:/usr/lib64:/usr/local/lib:$LD_LIBRARY_PATH

//使更新后的配置生效

1
source .bash_profile

Ok, 终于成功运行。

@2016年12月14日21:16:30,北配楼402