加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

linux下vtk安装配置

(2012-06-12 15:52:45)
标签:

杂谈

分类: 图像处理(C )
一直想在linux下跑vtk,实现三维重建,拖到昨天晚上才开始。
废话少说。上文:
1、官网(http://cmake.org/cmake/resources/software.html)下载cmake-2.8.8.tar.gz,解压到 /usr/local/src/目录下,解压过程会自动创建cmake-2.8.8目录。
3、在 /usr/local/src/ 下创建目录 vtk,用于存放vtk源码及数据及文档。将vtk-.10.0.tar.gzvtkdata-5.10.0.tar.gzvtkDocHtml-5.10.0.tar.gz解压到 vtk 目录下,解压过程中分别自动创建VTK,VTKData 和 html 目录。在vtk 下新建bin目录,作为vtk编译目录。
4、进入/usr/local/src/vtk/bin 目录,键入命令“sudo ccmake /usr/local/src/vtk/VTK”。呈现在眼前的是一些cmake的配置选项。注意:
BUILD_EXAMPLES                   OFF                                              
 BUILD_SHARED_LIBS                OFF                                              
 BUILD_TESTING                    OFF                                              
 CMAKE_BACKWARDS_COMPATIBILITY    2.4                                              
 CMAKE_BUILD_TYPE                 Debug                                            
 CMAKE_INSTALL_PREFIX             /usr/local/inlude                                
 SIP_EXECUTABLE                   SIP_EXECUTABLE-NOTFOUND                          
 SIP_INCLUDE_DIR                  SIP_INCLUDE_DIR-NOTFOUND                         
 VTK_DATA_ROOT                    /usr/local/src/vtk/VTKData                       
 VTK_EXTRA_COMPILER_WARNINGS      OFF                                              
 VTK_LARGE_DATA_ROOT              VTK_LARGE_DATA_ROOT-NOTFOUND                     
 VTK_USE_CHARTS                   ON                                               
 VTK_USE_CHEMISTRY                OFF                                              
 VTK_USE_GEOVIS                   ON                                               
 VTK_USE_INFOVIS                  ON                                               
 VTK_USE_N_WAY_ARRAYS             ON                                               
 VTK_USE_PARALLEL                 ON                 
 VTK_USE_QT                       OFF                                              
 VTK_USE_RENDERING                ON                                               
 VTK_USE_TEXT_ANALYSIS            OFF                                              
 VTK_USE_VIEWS                    ON                                               
 VTK_WRAP_JAVA                    OFF                                              
 VTK_WRAP_PYTHON                  OFF                                              
 VTK_WRAP_PYTHON_SIP              OFF                                              
 VTK_WRAP_TCL                     OFF                               
参照上述网址进行设置。
键入“c”进行配置,本人弹出错误:
CMake Error at CMake/vtkTestGLX.cmake:212 (file):
   file STRINGS file
   "/usr/local/src/vtk/VTK/Rendering/OPENGL_INCLUDE_DIR-NOTFOUND/GL/glx.h"
   cannot be read.
 Call Stack (most recent call first):
   Rendering/CMakeLists.txt:508 (INCLUDE)

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/local/src/vtk/VTK/Utilities/kwsys
    used as include directory in directory
 /usr/local/src/vtk/VTK/Utilities/vtkzlib
    used as include directory in directory
转向提及设置OpenGL的参照二。
5、网站( http://www.mesa3d.org)下载MesaLib-8.0.3.tar.gz ,MesaGLUT-7.9.2.tar.gz以及mesa-demos-8.0.1.tar.gz,均存放于/usr/local/src目录下。解压LIB文件,自动创建目录Mesa-8.0.3。进入此目录,敲入“make”-->"sudo make linux-x86",报错:
makedepend -fdepend -I. -I../../../../src/gallium/include -I../../../../src/gallium/auxiliary -I../../../../src/gallium/drivers  rbug_core.c rbug_context.c rbug_objects.c rbug_screen.c    2> /dev/null
make[5]: *** No rule to make target `depend', needed by `default'.  Stop.
make[5]: Leaving directory `/usr/local/src/Mesa-8.0.3/src/gallium/drivers/rbug'
make[4]: *** [default] Error 1
make[4]: Leaving directory `/usr/local/src/Mesa-8.0.3/src/gallium/drivers'
make[3]: *** [default] Error 1
make[3]: Leaving directory `/usr/local/src/Mesa-8.0.3/src/gallium'
make[2]: *** [subdirs] Error 1
make[2]: Leaving directory `/usr/local/src/Mesa-8.0.3/src'
make[1]: *** [default] Error 1
make[1]: Leaving directory `/usr/local/src/Mesa-8.0.3'
make: *** [linux-x86] Error 2
网上搜索错误原因,http://ubuntuforums.org/showthread.php?t=1561592给出提示:“sudo apt-get install xorg-dev”安装xorg-dev后再执行“sudo make linux-x86”,仍出错。上网搜索(http://www.mesa3d.org/install.html),执行“sudo ./configure”,提示错误“configure: error: makedepend is required to build Mesa”。搜索(http://www.linuxquestions.org/questions/linux-software-2/configure-error-makedepend-is-required-to-build-mesa-883481/),执行“sudo apt-get install xutils-dev”(/usr/bin/makedepend is provided by xutils-dev ,sudo apt-get install xutils-dev),再试“sudo ./configure”,提示错误“configure: error: flex is needed to build Mesa”。搜索(http://johnsonchou.blogspot.jp/2009/02/ubuntu-flex-bison.html),执行“sudo apt-get install flex bison”,再试“sudo ./configure”,提示错误“error: Direct rendering requires libdrm >= 2.4.24”。执行“sudo apt-get install libdrm-dev”,再试"sudo ./configure",弹出提示框
“configure: error: Package requirements (x11 xext xdamage xfixes x11-xcb xcb-glx xxf86vm) were not met:

No package 'x11-xcb' found
No package 'xcb-glx' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables DRIGL_CFLAGS
and DRIGL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
”。搜索(http://freebsd.1045724.n5.nabble.com/testing-rnoland-s-xorg-upgrade-patch-error-td4076678.html),执行“sudo apt-get install xcb”,安装成功无错误提示后,执行“sudo ./configure”,仍有错误。执行“sudo apt-get install libx11-xcb-dev”,"sudo apt-get install libxcb-glx0","sudo apt-get install libxcb-glx0-dev",提示错误:
"checking for expat.h... yes
checking for XML_ParserCreate in -lexpat... yes
checking for INTEL... no
configure: error: Package requirements (libdrm_intel >= 2.4.30) were not met:

Requested 'libdrm_intel >= 2.4.30' but version of libdrm is 2.4.26

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables INTEL_CFLAGS
and INTEL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
"

0

阅读 收藏 喜欢 打印举报/Report
前一篇:VTK 面绘制
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有