[vtkusers] Building VTK for XDarwin

Robb Brown brownr at ucalgary.ca
Wed Feb 27 13:12:39 EST 2002


Thanks, this worked perfectly.  Marcel is right though -- it is very 
slow.  Why is this?  Is it an XDarwin issue or something wrong with X 
in general?

What is the current state of the art in OSX VTK graphical interfaces? 
There is a version of Tk for OSX (Quartz) now and Python has been 
made to (at least somewhat) work with it.  Has anybody gotten the 
VTK-Python-Tk combination to work?


>Marcel is right. I had the same problems. However I fixed them in a 
>different form that shouldn't break compilation for Quartz (or any 
>other platform) if you want to use the same sourcetree.
>First of all if you want to build the quartz version make sure that 
>in the cmake configuration you set VTK_USE_QUARTZ to ON en VTK_USE_X 
>to OFF. And of course if you want to build the version for X set 
>them vice versa.
>Now change two sections (shouldn't be too hard to see which ones :-) 
>in Rendering/CMakeLists.txt to:
>---
>IF(UNIX)
>   IF(NOT WIN32)
>     IF(NOT APPLE)
>       SOURCE_FILES ( Rendering_SRCS
>                    vtkXImageWindow
>                    vtkXRenderWindowInteractor
>                    vtkXTextMapper)
>     ELSE (NOT APPLE)
>       IF (NOT VTK_USE_QUARTZ)
>         IF (VTK_USE_X)
>           SOURCE_FILES ( Rendering_SRCS
>                        vtkXImageWindow
>                        vtkXRenderWindowInteractor
>                        vtkXTextMapper)
>         ENDIF (VTK_USE_X)
>       ENDIF (NOT VTK_USE_QUARTZ)
>     ENDIF(NOT APPLE)
>   ENDIF(NOT WIN32)
>ENDIF(UNIX)
>---
>and
>---
>ELSE (WIN32)
>   IF (APPLE)
>     IF (VTK_USE_QUARTZ)
>       SET(HAVE_OPENGL_SRCS ON)
>       SOURCE_FILES(RenderingOpenGL_SRCS
>                    vtkQuartzImageWindow
>                    vtkQuartzTextMapper
>                    vtkQuartzRenderWindowInteractor
>                    vtkQuartzRenderWindow
>                    vtkQuartzWindow
>                    vtkQuartzGLView)
>       WRAP_EXCLUDE_FILES(vtkQuartzGLView
>                          vtkQuartzWindow)
>       LINK_LIBRARIES (${OPENGL_LIBRARY} )
>       IF(MESA_OS_LIBRARY)
>         LINK_LIBRARIES( ${MESA_OS_LIBRARY} )
>       ENDIF(MESA_OS_LIBRARY)
>
>       ADD_LIBRARY(vtkRendering Rendering_SRCS RenderingOpenGL_SRCS)
>     ELSE (VTK_USE_QUARTZ)
>       IF (VTK_USE_X)
>         IF (OPENGL_LIBRARY)
>           SET(HAVE_OPENGL_SRCS ON)
>
>           SOURCE_FILES(RenderingOpenGL_SRCS
>                        vtkOpenGLImageWindow
>                        vtkXOpenGLRenderWindow
>                        vtkXOpenGLTextMapper)
>           ABSTRACT_FILES(
>                          vtkXImageWindow
>                          vtkXTextMapper)
>           LINK_LIBRARIES (${OPENGL_LIBRARY} )
>           IF(MESA_OS_LIBRARY)
>             LINK_LIBRARIES( ${OSMESA_LIBRARY} )
>           ENDIF(MESA_OS_LIBRARY)
>         ENDIF (OPENGL_LIBRARY)
>       ENDIF (VTK_USE_X)
>     ENDIF (VTK_USE_QUARTZ)
>   ELSE (APPLE)
>---
>This makes sure that the VTK_USE_X and VTK_USE_QUARTZ options do 
>what you want and link in their respective objectfiles (with Quartz 
>ruling in favor of X if both options are set to ON).
>
>Then in the following files (in the Rendering directory):
>vtkOpenGLTexture.cxx
>vtkOpenGLActor.cxx
>vtkOpenGLCamera.cxx
>vtkOpenGLImageActor.cxx
>vtkOpenGLImageMapper.cxx
>vtkOpenGLImager.cxx
>vtkOpenGLLight.cxx
>vtkOpenGLPolyDataMapper.h
>vtkOpenGLPolyDataMapper2D.cxx
>vtkOpenGLProperty.cxx
>vtkOpenGLRenderWindow.h
>vtkOpenGLRenderer.cxx
>vtkOpenGLStateCache.h
>vtkOpenGLVolumeRayCastMapper.cxx
>vtkOpenGLVolumeRayCastMapper.h
>vtkOpenGLVolumeTextureMapper2D.cxx
>change ALL occurances of __APPLE__ to VTK_USE_QUARTZ (we only want 
>to include the OpenGL/gl.h if we are compiling for Quartz rendering)
>
>Since all these changes are in such a way that it shouldn't break 
>compilation/execution for other platforms they might be a welcome 
>addition to the official VTK repository. Is there anybody who can 
>give me some information on whether this should be done, and if so, 
>how?
>
>Regards,
>Sander Niemeijer
>
>On Wednesday, February 27, 2002, at 02:07 AM, Marcel Prastawa wrote:
>
>>Robert Brown wrote:
>>>I get an error building VTK for XDarwin -- ld: Undefined symbols:
>>
>>[snip]
>>
>>>Compiling for Quartz works fine, but not X.  Any suggestions?
>>
>>Robert,
>>
>>You need to make sure that you are not linking against Apple's 
>>OpenGL library and link to /usr/X11R6/lib/libGL.dylib instead.
>>
>>If I recall correctly, I needed to modify several files in the 
>>Rendering directory. In CMakeLists.txt you may need to add 
>>vtkXOpenGL... in the APPLE section. Also, in some of the source 
>>files, you need to change #include <OpenGL/gl.h> to #include 
>><GL/gl.h> inside the #ifdef __APPLE__ blocks.
>>
>>I did this quite some time ago, so all this may not apply to the 
>>current version. If you are interested, I have the 4.0 binaries for 
>>XDarwin ( a bit old). One warning though, VTK on XDarwin is slow 
>>(no hardware acceleration).
>>
>>Marcel
>>
>>_______________________________________________
>>This is the private VTK discussion list. Please keep messages 
>>on-topic. Check the FAQ at: 
>><http://public.kitware.com/cgi-bin/vtkfaq>
>>Follow this link to subscribe/unsubscribe:
>>http://public.kitware.com/mailman/listinfo/vtkusers


-- 
______________________________
Robb Brown
Seaman Family MR Research Centre
Calgary, Alberta, Canada



More information about the vtkusers mailing list