learn vtk by Tcl script on mac
learn vtk by Tcl script on mac
环境: VTK-8.1.1 Mac OS X 10.13.6 /usr/bin/tclsh
build vtk,cmake一下:
cmake ./ -G "Unix Makefiles" \-DVTK_USE_QVTK:BOOL=ON \-DCMAKE_INSTALL_PREFIX=/usr/local \-DVTK_USE_GUISUPPORT:BOOL=ON \-DVTK_QT_VERSION=5 \-DModule_vtkGUISupportQt:BOOL=ON \-DModule_vtkGUISupportQtOpenGL:BOOL=ON \-DModule_vtkGUISupportQtSQL:BOOL=ON \-DModule_vtkGUISupportQtWebkit:BOOL=OFF \-DModule_vtkRenderingQt:BOOL=ON \-DModule_vtkViewsQt:BOOL=ON \-DVTK_WRAP_TCL:BOOL=ON \-DTCL_INTERNAL_PATH=/Users/weiyang/Downloads/VTK-8.1.1/ThirdParty/TclTk/internals/tk8.6
注意:Module_vtkGUISupportQtWebkit 是被关掉的。 然后make, make install。 接着尝试使用tcl脚本
tclsh assembly.tclcan't find package vtk while executing"package require vtk" (file "assembly.tcl" line 8)
查看默认的Tcl变量 auto_path:
weiyang@WeiMac ~/Downloads tclsh% puts $auto_path/System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/Scripts /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources /usr/lib ~/Library/Tcl /Library/Tcl /System/Library/Tcl /System/Library/Tcl/8.5 ~/Library/Frameworks /Library/Frameworks /System/Library/Frameworks%
寻找pkgIndex.tcl 的路径:
✘ weiyang@WeiMac ~ find / -name pkgIndex.tcl 2>/dev/null/usr/local/lib/tcltk/vtk-8.1/pkgIndex.tcl/System/Library/Tcl/tklib0.5/crosshair/pkgIndex.tcl/System/Library/Tcl/tklib0.5/tablelist/pkgIndex.tcl/System/Library/Tcl/tklib0.5/tooltip/pkgIndex.tcl...
将包含pkgIndex.tcl的路径/Users/weiyang/Downloads/VTK-8.1.1/Wrapping/Tcl放到 auto_path中。可设置环境变量TCLLIBPATH
weiyang@WeiMac ~/Downloads/VTK-8.1.1/Examples/Rendering/Tcl export TCLLIBPATH=/Users/weiyang/Downloads/VTK-8.1.1/Wrapping/Tclweiyang@WeiMac ~/Downloads/VTK-8.1.1/Examples/Rendering/Tcl tclsh% puts $auto_path/Users/weiyang/Downloads/VTK-8.1.1/Wrapping/Tcl /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/Scripts /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources /usr/lib ~/Library/Tcl /Library/Tcl /System/Library/Tcl /System/Library/Tcl/8.5 ~/Library/Frameworks /Library/Frameworks /System/Library/Frameworks% exit
然后就能正常解释,运行tcl脚本:
weiyang@WeiMac ~/Downloads/VTK-8.1.1/Examples/Rendering/Tcl vtk assembly.tcl
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~