[vtkusers] VTK 4.2 on OS X 10.4.2

Paulo Abreu paulotex at ist.utl.pt
Thu Nov 3 02:50:48 EST 2005


> From: Olivier Fedrigo <ofedrigo at duke.edu>
> Subject: [vtkusers] VTK 4.2  on OS X 10.4.2
>
> hi,
>
> I tried to build VTK 4.2  on OS X 10.4.2 but encounter an error while
> trying to make "vtkBMPreader" and it stops.
> any idea what I should do? it is very frustating since I succeeded to
> do it last year on a previous OS X version (thanks to Drew's  
> articles).
>
> any suggestions?

You didn't include the error message, so it is hard to guess what's  
wrong.

Anyway, a few weeks ago I posted the set of steps I did to compile  
4.4.2 under OSX 10.4 with gcc 4.0. With gcc 3.3 things might be  
different/easier. Here are the steps again:

=============================================

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>)

Paulo




More information about the vtkusers mailing list