[vtkusers] VTK 5.6 on OS X 10.6 with Python and X11
Eric E. Monson
emonson at cs.duke.edu
Fri Jul 9 13:27:35 EDT 2010
Hey Rafael,
Okay, I had never tried it before, but I think I was able to get the Python wrapping to work with X11 on OS X. (I also tried to get the Tcl wrapping to work, but that would crash with a Segmentation fault any time I tried to run something with interactors -- not sure why.) I've never used ttk, but my guess would be that you don't need to build VTK with the Tcl wrappers, only Python...
I ran ccmake from a fresh build directory and set the options through that (leaving all others as they come up by default):
ccmake ..
c
BUILD_TESTING: OFF
BUILD_SHARED_LIBS: ON
CMAKE_BUILD_TYPE: Release
CMAKE_OSX_ARCHITECTURES: x86_64
VTK_USE_COCOA: OFF
VTK_USE_X: ON
VTK_WRAP_PYTHON: ON
c
(Then it comes up with an error about not being able to find "/System/Library/Frameworks/OpenGL.framework/GL/glx.h", but CMake/vtkTestGLX.cmake says it's using OPENGL_INCLUDE_DIR, which was set by default to /System/Library/Frameworks/OpenGL.framework. So, I changed the OPENGL stuff to:)
e
OPENGL_INCLUDE_DIR: /usr/X11R6/include
OPENGL_gl_LIBRARY: /usr/X11R6/lib/libGL.dylib
OPENGL_glu_LIBRARY: /usr/X11R6/lib/libGLU.dylib
c
g
make -k -j7 (adjust the -j# for your number of cores...)
I get a bunch of
/usr/X11R6/include/GL/gl.h:1402:1: warning: "GL_GLEXT_LEGACY" redefined
during the build, but it finishes okay.
sudo make install (may not need to do this)
cd Wrapping/Python
sudo python setup.py install
I'll attach a screen shot of running [vtk_src]/Examples/Tutorial/Step6/Python/Cone6.py
I just used the Tcl wrapping this morning with Cocoa, so I know that works fine, and I use the Python wrappers all the time with Cocoa, but there's something not right in my build with my Tcl/X11 combo... Also, background gradients (like are common with the Infovis stuff) are screwed up with my Python/X11, but they don't crash or anything.
I'm using OS X 10.6.4, system Python 2.6, system Tcl/Tk 8.5.7, VTK git head from June 30, CMake 2.9.20100113
Hope this helps,
-Eric
------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group
-------------- next part --------------
A non-text attachment was scrubbed...
Name: X11_Cone6.png
Type: image/png
Size: 7023 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100709/d59ca40d/attachment.png>
-------------- next part --------------
On Jul 8, 2010, at 7:23 PM, Frava wrote:
> Hi all,
>
> I need to make a Python code that uses VTK "X11" work on OS X 10.6 but I only get a segmentation fault when I try to launch it (there is no problem with this code on Linux).
>
> Configuration : OS X 10.6.4 with XCode 3.2.3
>
> cmake ../VTK \
> -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
> -DCMAKE_INSTALL_PREFIX:PATH=/Applications/MyApp.app/Contents/MacOS \
> -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="10.6" \
> -DCMAKE_OSX_ARCHITECTURES:STRING="x86_64" \
> -DBUILD_SHARED_LIBS:BOOL=ON \
> -DVTK_WRAP_PYTHON:BOOL=ON \
> -DVTK_WRAP_TCL:BOOL=ON \
> -DVTK_USE_CARBON:BOOL=OFF \
> -DVTK_USE_COCOA:BOOL=OFF \
> -DVTK_USE_X:BOOL=ON \
> -DVTK_USE_GUISUPPORT:BOOL=ON \
> -DVTK_USE_HYBRID:BOOL=OFF \
> -DVTK_USE_RPATH:BOOL=OFF \
>
> I'm not sure if I need to turn on the TCL wrapper but the code uses TTK (Tile) classes so it needs a python 2.5 (or 2.6) linked with TCL/TK 8.5.
>
> Does anyone have a working configuration (or some advise) to help to fix this ?
>
> Regards,
> Rafael.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list