[vtkusers] VTK 5.6 on OS X 10.6 with Python and X11

Frava fravadona at gmail.com
Mon Jul 12 06:19:59 EDT 2010


Hi Eric and David, thank you for your replies.

I tried with the Eric's configuration but I still get the segmentation fault
(by the way Eric, I'm using the 2.8.1 version of the "cmake" command and the
system OpenGL libraries get setted up correctly by default).
So like David said I'll have to compile and to link everything with X11.
Fink didn't success with this work so I'll have to do it all by hand ^^

Cheers,
Rafael.

2010/7/9 David Gobbi <david.gobbi at gmail.com>

> Hi Rafael,
>
> You are going to have a hard time getting this to work with the system
> Python and system Tcl on any version of OS X.
>
> On 10.5, system Tk is built with Carbon, and on 10.6, system Tk is
> built with Cocoa.  In both cases, the system Python uses a _tkinter.so
> that is linked to the system Tk.
>
> This means that you cannot use the system Python with an X11 version
> of ttk.  If you want to do any X11/Tk work, then you should either
> build your own python and tcl, taking care to configure them both to
> use X11, or you should look around for Fink or MacPorts packages for
> python/tcl/ttk that are built with X11.
>
>   David
>
>
> On Fri, Jul 9, 2010 at 11:27 AM, Eric E. Monson <emonson at cs.duke.edu>
> wrote:
> > 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
> >
> >
> >
> > 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
> >
> >
> > _______________________________________________
> > 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
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100712/dff18781/attachment.htm>


More information about the vtkusers mailing list