[Insight-developers] Compiling itk on OSX

Jon Harald Kaspersen Jon.H.Kaspersen@unimed.sintef.no
Thu, 13 Sep 2001 11:28:11 +0200


Hi,

My name is Jon Harald Kaspersen.  I am working with 3D Ultrasound 
visualization, and have been using VTK for about six months now (on OSX 
with Python wrapping, compiled by Yves Starrveld).  My group (SINTEF 
Unimed, Ultrasound division - look at www.us.unimed.sintef.no) is also 
working with segmentation and registration.  So compiling itk on OSX 
would be the ultimate solution for us.
So, I downloaded itk yesterday and tried to compile it.
Here is my experience with itk so far :

First I did run cmake. (Let me clearify that I am an Apple Select 
member, so I do run OS X - ver. 10.1 seed 5G48).
I had to make some small changes to the CMakeCache.txt file (mainly 
correcting the compiler flags).  I have not enabled building of shared 
libs (not before I can get itk to build with static libs).
I then did run make.  The first problem is the incompatibility between 
itkDynamicLoader.cxx and OSX, which is connected to the fact that there 
is no dlfnc.h file on OSX.  So, I corrected the itkDynamicLoader.cxx 
(used the ideas in vtkDynamicLoader.cxx to modify it to be OSX 
compatible).  Invoked make again.
The next problem I did run into was what I think is a typo in line 129 
in itkFileOutputWindow.h, changed line 129 to  std::ostream *m_Stream;
Invoked make again.
No problems until linking of itkAmoebaOptimizerTest.  I get an error 
telling me that there is some undefined symbols not resolvable by the 
linker.  The command line input and error is referred below as :
[cubekar:Testing/Code/Numerics] jonk% c++ -g -O2 -no-cpp-precomp 
itkAmoebaOptimizerTest.o -L/Users/jonk/vtkcvs/Insight/bin/ -lpthread 
-lVXLNumerics -lm -lITKCommon -lpthread -lVXLNumerics -lm -lITKCommon 
-lzlib -o /Users/jonk/vtkcvs/Insight/bin/itkAmoebaOptimizerTest
/usr/bin/ld: Undefined symbols:
___as__t10vnl_vector1ZdRCB0
___t10vnl_vector1ZdRCB0
___t10vnl_vector1ZdRCB0dG11vnl_tag_mul
___t10vnl_vector1ZdRCB0n1G11vnl_tag_add
_vnl_c_vector_two_norm_squared__H2ZdZd_PCX01UiPX11_v

Do you (some of you insight developers have an idea on which action to 
take further to get rid of this error ??

Regards
Jon