[Insight-users] MacOSX build with testing

Zachary Pincus zpincus at stanford.edu
Tue Feb 22 17:36:12 EST 2005


How was the build configured with cmake? (Shared libs? Not shared libs?  
Any SWIG wrapping?)

I rarely have problems building a fresh checkout of ITK on OS X (with  
or without testing) with the shared libraries flag turned on, and none  
of the other optional flags. It's been a while since I didn't try with  
shared libs, actually -- it should work either way.

 From the error messages, it looks like you turned on the  
USE_EXPLICIT_INSTANTIATION flag -- someone who is more knowledgeable  
about the status of that can correct me, but from what I understand,  
the explicit instantiation stuff is still a bit experimental. What's  
happening is that the linker is finding multiple definitions of the  
same class: both in the explicit instantiation library and in the  
compiled object file.

So what I would try is to turn off the explicit instantiations (if you  
didn't turn it on, perhaps ITK now comes with that flag already on??)  
by toggling the cmake advanced options and turning that flag off. Then  
try building again. (You might need to manually remove libITKCommon.a  
to force that file to be re-linked without the  
itkExplicitInstantiations.o object file.)

Zach Pincus

Department of Biochemistry and Program in Biomedical Informatics
Stanford University School of Medicine


On Feb 22, 2005, at 1:30 PM, Hans Johnson wrote:

> Hello All,
>
> I am new to building on the Mac OSX, and can not figure out how to  
> solve the
> linking errors.  This is a new mac G4 powerbook running OSX 10.3.8.  I  
> can
> build with testing off just fine, but with Testing turned on, the build
> fails with lots of messages like the following:
>
> echo "Building executable
> /Users/hjmjohnson/src/brains2/MacOSX/DEBUG/iplFreeware/unpackdir/ 
> Insight/bin
> /itkNumericsTests..."
> c++       -g -fstrict-aliasing -UNDEBUG  -Wall -Wcast-qual
> -Wstrict-prototypes -multiply_defined suppress  -ftemplate-depth-50
> -no-cpp-precomp -Wno-long-double -fPIC  itkNumericsTests.o
> itkNumericsPrintTest.o itkAmoebaOptimizerTest.o
> itkConjugateGradientOptimizerTest.o itkCompositeValleyFunctionTest.o
> itkCumulativeGaussianOptimizerTest.o itkGradientDescentOptimizerTest.o
> itkLevenbergMarquardtOptimizerTest.o itkLBFGSBOptimizerTest.o
> itkLBFGSOptimizerTest.o itkMultivariateLegendrePolynomialTest.o
> itkNumericsTest.o itkOptimizersHierarchyTest.o itkPowellOptimizerTest.o
> itkRegularStepGradientDescentOptimizerTest.o  
> itkSymmetricEigenSystemTest.o
> itkVersorTransformOptimizerTest.o  
> itkVersorRigid3DTransformOptimizerTest.o
> -o
> /Users/hjmjohnson/src/brains2/MacOSX/DEBUG/iplFreeware/unpackdir/ 
> Insight/bin
> /itkNumericsTests  -L.
> -L/Users/hjmjohnson/src/brains2/MacOSX/DEBUG/iplFreeware/unpackdir/ 
> Insight/b
> in -lITKCommon -lITKNumerics -lITKIO -lITKCommon -litkvnl_inst  
> -litkvnl_algo
> -litkvnl -litkvcl -litknetlib -lm -litksys -lpthread -lITKNrrdIO  
> -litkpng
> -litktiff -lm -litkgdcm -litkjpeg8 -litkjpeg12 -litkjpeg16 -lITKMetaIO
> -litkzlib -lITKDICOMParser -lITKEXPAT
>
>
>
> Building executable
> /Users/hjmjohnson/src/brains2/MacOSX/DEBUG/iplFreeware/unpackdir/ 
> Insight/bin
> /itkNumericsTests...
> ld: multiple definitions of symbol
> _ZNK3itk18ImageToImageFilterINS_5ImageIaLj2EEENS1_IfLj2EEEE14GetNameOfC 
> lassE
> v.eh
> itkNumericsTests.o definition of absolute
> _ZNK3itk18ImageToImageFilterINS_5ImageIaLj2EEENS1_IfLj2EEEE14GetNameOfC 
> lassE
> v.eh (value 0x0)
> /Users/hjmjohnson/src/brains2/MacOSX/DEBUG/iplFreeware/unpackdir/ 
> Insight/bin
> /libITKCommon.a(itkExplicitInstantiations.o) definition of absolute
> _ZNK3itk18ImageToImageFilterINS_5ImageIaLj2EEENS1_IfLj2EEEE14GetNameOfC 
> lassE
> v.eh (value 0x0)
> ld: multiple definitions of symbol
> _ZNK3itk18ImageToImageFilterINS_5ImageIaLj2EEES2_E14GetNameOfClassEv.eh
> itkNumericsTests.o definition of absolute
> _ZNK3itk18ImageToImageFilterINS_5ImageIaLj2EEES2_E14GetNameOfClassEv.eh
> (value 0x0)
> /Users/hjmjohnson/src/brains2/MacOSX/DEBUG/iplFreeware/unpackdir/ 
> Insight/bin
> /libITKCommon.a(itkExplicitInstantiations.o) definition of absolute
> _ZNK3itk18ImageToImageFilterINS_5ImageIaLj2EEES2_E14GetNameOfClassEv.eh
> (value 0x0)
>
> Could someone please let me know were I am going wrong?
>
> Thanks,
> Hans J. Johnson
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>



More information about the Insight-users mailing list