[vtkusers] HOWTO: VTK 4.4.2 in MacOSX 10.4

Paulo Tribolet Abreu paulotex at ist.utl.pt
Fri Sep 30 02:44:53 EDT 2005


Hi:

I've just successfully compiled VTK 4.4.2 under MacOSX 10.4 and I'd  
like to report what I had to change. Probably there are more elegant  
ways to do this, but this one worked for me (without Java, Tcl/Tk and  
Python).

GCC:
====

* First, make sure you have gcc 4.0:

paulomac:~ paulo$ gcc_select
Current default compiler:
gcc version 4.0.0 (Apple Computer, Inc. build 5026)

* If not, do
paulomac:~ paulo$ sudo gcc_select 4.0


CMake 2.0.6:
============

* cmDynamicLoader.cxx: line 185
change...
NSUnLinkModule(lib, FALSE);
to
NSUnLinkModule((NSModule)lib, FALSE);


VTK 4.4.2:
==========

* Comment out the indicated line from the following files:
vtkMacros.cmake:22
Common/CMakeLists.txt:259
Filtering/CMakeLists.txt:130
Graphics/CMakeLists.txt:196
Hybrid/CMakeLists.txt:106
IO/CMakeLists.txt:176
Imaging/CMakeLists.txt:149
Rendering/CMakeLists.txt:343

* Change
#ifdef __APPLE_CC__
to
#if 0
so that the code that follows is not compiled, from
the following files:
Common/vtkAbstractMapper.cxx:33
Filtering/vtkCardinalSpline.cxx:27
Graphics/vtkAppendFilter.cxx:32
Hybrid/vtk3DSImporter.cxx:37
IO/vtkBMPReader.cxx:34
Imaging/vtkBooleanTexture.cxx:29
Rendering/vtkAbstractMapper3D.cxx:24
Rendering/vtkTkWidgetsInit.cxx:27

* Wrap the contents of the file
Rendering/vtkOSXRenderingTclInit.c
in a #if 0 ... #endif.

* Edit
<CMake install prefix>/share/CMake/Modules/ 
CMakeDefaultMakeRuleVariables.cmake
and change the following lines

IF(CMAKE_COMPILER_IS_GNUCXX)
   SET(CMAKE_CXX_CREATE_SHARED_LIBRARY "$ 
{CMAKE_CXX_CREATE_SHARED_LIBRARY} -lgcc")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)

to

IF(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE)
   SET(CMAKE_CXX_CREATE_SHARED_LIBRARY "$ 
{CMAKE_CXX_CREATE_SHARED_LIBRARY} -lgcc")
ENDIF(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE)

(Thanks to David C. Thompson for this one
<http://public.kitware.com/pipermail/vtkusers/2005-May/079721.html>)



With these changes, VTK compiled fine and the Cone5 and Cone6  
Tutorials work fine, with mouse and keyboard input. This is the only  
test I have tried so far.

Have fun,

Paulo





More information about the vtkusers mailing list