位置: 编程技术 - 正文
推荐整理分享VTK安装详细步骤(vtk下载步骤),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:vtk安装包,vtk安装包,vtk下载步骤,vt7.3安装教程,vt安装方法,vtk user guide,vtk下载步骤,vtk安装教程,内容如对您有帮助,希望把文章链接给更多的朋友!
以前安装VTK很顺,这次VTK安装很不顺。同样都是安装vtk-5..1.tar.gz版本,难道因为我这个杂牌的组装电脑配置问题?无论如何,最终还是让我折腾出来了。安装过程涉及库太多,OpenGL,Mesa这2个难点。写在这里,给后来人一点指引,一起探讨。
系统环境:
Ubuntu ..5
CMake 2.8.7
FLTK-1.3.3
Mesa-.3.5,已安装在/usr/local/Mesa-.3.5。安装方法见:“编译安装Mesa的详细步骤”。
安装步骤:
1. 下载vtk-5..1.tar.gz,地址: 拷贝vtk-5..1.tar.gz至目录/usr/local/src/下,
sudo tar -xvf vtk-5..1.tar.gz
解压后的文件夹名称是: VTK5..1,在和它同级的目录建一个binVTK5..1文件夹用来编译。
sudo mkdir binVTK5..1
cd binVTK5..1
sudo ccmake ../VTK5..1/
出现如下错误:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.Please set them or make sure they are set and tested correctly in the CMake files:OPENGL_INCLUDE_DIR (ADVANCED) used as include directory in directory /usr/src/VTK5..1 used as include directory in directory /usr/src/VTK5..1/Wrapping
used as include directory in directory /usr/src/VTK5..1/Utilities
按e键,可以看到提示:
这里有个VTK_DATA_ROOT_NOTFOUND,这个问题完全可以忽略。VTK_DATA_ROOT这里不用设置,也不会影响后面的编译结果的。不过如果你想设置也是可以的,回忆到刚刚下载vtk的网页中有“VTKData”字样的连接供下载,多半有关系,于是回到下载页面,大概如下:
下载“VTKData5..1.tar.gz”,并拷贝到目录/install下。解压,将解压后的文件夹路径/install/vtkdata-5..1设置到cmake的窗口中的“VTK_DATA_ROOT”和“VTK_LARGE_DATA_ROOT”中(2个一样)。
编译,还是前面一样的错误,一点也不意外!因为这里显然关键问题是缺少OPENGL的一些库文件。需要将Mesa编译后的lib路径设置给vtk。没装Mesa之前,没发现哪里有GL库,Mesa安装以后会出现GL目录(在/usr/local/Mesa-.3.5/include/目录下)。
这里我已将Mesa安装单独写在另一个帖子中:“编译安装Mesa的详细步骤”。 现假定Mesa已经被成功make install到了/usr/local/Mesa-.3.5目录。CMake中与该错误相关的条目:
OPENGL_INCLUDE_DIR /usr/local/include
OPENGL_gl_LIBRARY OPENGL_gl_LIBRARY-NOTFOUND
OPENGL_glu_LIBRARY OPENGL_glu_LIBRARY-NOTFOUND
OPENGL_xmesa_INCLUDE_DIR OPENGL_xmesa_INCLUDE_DIR-NOTFOUND
sudo apt-get install libpng-dev libjpeg-dev libxxfvm1 libxxfvm-dev libxi-dev libxrandr-dev
装完这个后,重新编译可见下面这2项自动填充了路径:
OPENGL_gl_LIBRARY */usr/local/lib/libGL.so
OPENGL_glu_LIBRARY */usr/lib/x_-linux-gnu/libGLU.so
sudo ccmake ../VTK5..1/
错误如下:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OPENGL_gl_LIBRARY (ADVANCED)
linked by target "vtkVolumeRendering" in directory /usr/local/src/VTK5..1/VolumeRendering
linked by target "vtkWidgets" in directory /usr/local/src/VTK5..1/Widgets
linked by target "RenderingCxxTests" in directory /usr/local/src/VTK5..1/Rendering/Testing/Cxx
linked by target "TestFBOImplementation" in directory /usr/local/src/VTK5..1/Rendering/Testing/Cxx
linked by target "TimeRenderer" in directory /usr/local/src/VTK5..1/Rendering/Testing/Cxx
linked by target "TimeRenderer2" in directory /usr/local/src/VTK5..1/Rendering/Testing/Cxx
linked by target "VTKBenchMark" in directory /usr/local/src/VTK5..1/Rendering/Testing/Cxx
手动修改这条路径为:
OPENGL_xmesa_INCLUDE_DIR */usr/local/Mesa-.3.5/include/
sudo ccmake ../VTK5..1/
完成,g键,完成。
sudo make
到%时,出现一个错误如下:
...
[ %] Built target vtkGraphics
[ %] Built target vtkGenericFiltering
[ %] Built target vtkIO
[ %] Building CXX object Rendering/CMakeFiles/vtkRendering.dir/vtkXOpenGLRenderWindow.cxx.o
In file included from /usr/local/include/GL/glx.h::0,
from /usr/local/src/VTK5..1/Rendering/vtkXOpenGLRenderWindow.cxx::
/usr/local/include/GL/glxext.h:::error: ‘GLintptr’ has not been declared
typedef void ( *PFNGLXCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
^
/usr/local/include/GL/glxext.h::: error: ‘GLintptr’ has not been declared
typedef void ( *PFNGLXCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
^
/usr/local/include/GL/glxext.h::: error: ‘GLsizeiptr’ has not been declared
typedef void ( *PFNGLXCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
^
/usr/local/include/GL/glxext.h::: error: ‘GLintptr’ has not been declared
typedef void ( *PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
^
/usr/local/include/GL/glxext.h::: error: ‘GLintptr’ has not been declared
typedef void ( *PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
^
/usr/local/include/GL/glxext.h::: error: ‘GLsizeiptr’ has not been declared
typedef void ( *PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
^
make[2]: *** [Rendering/CMakeFiles/vtkRendering.dir/vtkXOpenGLRenderWindow.cxx.o] Error 1
make[1]: *** [Rendering/CMakeFiles/vtkRendering.dir/all] Error 2
make: *** [all] Error 2
test@test:/usr/local/src/binVTK5..1$ sudo gedit /usr/local/include/GL/glxext.h
test@tes:/usr/local/src/binVTK5..1$ sudo makeGoogle了一下,这应该是新版本的bug,不过vtk user里面高手实在太多了,我在这里 gedit /usr/local/include/GL/glxext.h
在打开的文件第行,添加如下2句:
typedef ptrdiff_t GLsizeiptr;
typedef ptrdiff_t GLintptr;
保存,关闭。
因为我的OPENGL_INCLUDE_DIR是设置的指向/usr/local/include,所以我修改/usr/local/include/GL/glxext.h直接就生效了。
sudo make
%完成。
sudo make install
成功安装完。
最后,附上成功安装的vtk配置全部configure条目:
推荐2个可以供你搜集宏观思路的比较全的安装步骤:
骨头动画解析 骨头动画与顶点动画:骨头动画包括:外皮(所有顶点)骨头1.外皮(所有顶点),每个顶点包含一下信息,Pos(位置信息)UV纹理Normal(法线)Color(定点色)boneIndex(
利用openGL进行AR Visualization AR与VR不同,VR是制造一个虚拟的环境,使人在其中有沉浸感;AR是将虚拟的物体overlay到实际的场景中,有助于人们更好的理解场景。实现AR的手段有很多
OpenGL学习_点画模式(点画线) viodglLineStipple(GLintfactor,GLshortpattern);OpenGL中设置直线的当前点画模式。pattern参数是由1或0组成的位序列,它们根据需要进行重复,对一条特定的直线进
标签: vtk下载步骤
本文链接地址:https://www.jiuchutong.com/biancheng/373266.html 转载请保留说明!上一篇:OpenGL中创建聚光灯的效果(opengl发光物体)
下一篇:骨头动画解析(骨头动漫头像)
友情链接: 武汉网站建设