[Insight-users] MacOSX build with testing

Zachary Pincus zpincus at stanford.edu
Fri Feb 25 13:55:22 EST 2005


What appears at first blush to be going on with this build is that the  
c++ standard library isn't getting linked in. Though, on closer  
inspection, these errors look strange because it's symbols for template  
instantiations that can't be found, and AFAIK, the C++ standard lib  
doesn't have explicit instantiations. Those template instantiations  
should be in your own object files that are getting linked!

I would try re-building ITK with shared libs from a completely new  
directory. Run ccmake and only enable shared libs and no other flags,  
then build. Perhaps some cmake state got confused with the explicit  
instantiations issue?

If this was a build in a fresh directory with an up-to-date CVS  
checkout, then I'm perplexed too!

Zach


On Feb 25, 2005, at 10:47 AM, Hans Johnson wrote:

> All,
>
> I just wanted to follow up on this MacOSX building issue.
>
> The USE_EXPLICIT_INSTATION flag does not work with MacOSX, even though  
> it
> was designed for the gcc compiler.
>
> Building static libraries work.
>
> Building shared libraries does not seem to work.  I get an error when
> building vxl:
>
> Building shared library
> /Users/hjmjohnson/src/gec/freeware/MacOSX/DEBUG/Insight-build/bin/ 
> libitkvnl_
> algo.dylib...
> ld: Undefined symbols:
> std::basic_ostream<char, std::char_traits<char> >& operator<<
> <double>(std::basic_ostream<char, std::char_traits<char> >&,
> vnl_matrix<double> const&)
> std::basic_ostream<char, std::char_traits<char> >& operator<<
> <double>(std::basic_ostream<char, std::char_traits<char> >&,
> vnl_vector<double> const&)
> std::basic_ostream<char, std::char_traits<char> >& operator<<
> <float>(std::basic_ostream<char, std::char_traits<char> >&,
> vnl_matrix<float> const&)
> std::basic_ostream<char, std::char_traits<char> >& operator<<
> <float>(std::basic_ostream<char, std::char_traits<char> >&,
> vnl_vector<float> const&)
> std::basic_ostream<char, std::char_traits<char> >& operator<<
> <std::complex<double> >(std::basic_ostream<char,  
> std::char_traits<char> >&,
> vnl_matrix<std::complex<double> > const&)
> std::basic_ostream<char, std::char_traits<char> >& operator<<
> <std::complex<double> >(std::basic_ostream<char,  
> std::char_traits<char> >&,
> vnl_vector<std::complex<double> > const&)
> std::basic_ostream<char, std::char_traits<char> >& operator<<
> <std::complex<float> >(std::basic_ostream<char, std::char_traits<char>  
> >&,
> vnl_matrix<std::complex<float> > const&)
> std::basic_ostream<char, std::char_traits<char> >& operator<<
> <std::complex<float> >(std::basic_ostream<char, std::char_traits<char>  
> >&,
> vnl_vector<std::complex<float> > const&)
> /usr/bin/libtool: internal link edit command failed
> make[11]: ***
> [/Users/hjmjohnson/src/gec/freeware/MacOSX/DEBUG/Insight-build/bin/ 
> libitkvnl
> _algo.dylib] Error 1
>
>
> I can't figure out why this is occuring....Oh well, looks like it will  
> be
> static libraries for now.
>
> Hans
>
>
>
> On 2/22/05 5:29 PM, "Hans Johnson" <hans-johnson at uiowa.edu> wrote:
>
>> Zach,
>>
>> Thanks for the quick response.  I forgot that I had the explicit  
>> instantiation
>> turned on (for gcc based compilers).  I'll try to turn that off and  
>> report my
>> findings.  In addition, I am building static libraries,  if the  
>> Explicit
>> instantiation does not do the trick, I'll try dynamic libraries, and  
>> report
>> those results also.
>>
>> Thanks,
>> Hans
>>
>>
>>
>> On 2/22/05 4:36 PM, "Zachary Pincus" <zpincus at stanford.edu> wrote:
>>
>>> 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_IfLj2EEEE14GetName 
>>>> OfC
>>>> lassE
>>>> v.eh
>>>> itkNumericsTests.o definition of absolute
>>>> _ZNK3itk18ImageToImageFilterINS_5ImageIaLj2EEENS1_IfLj2EEEE14GetName 
>>>> OfC
>>>> lassE
>>>> v.eh (value 0x0)
>>>> /Users/hjmjohnson/src/brains2/MacOSX/DEBUG/iplFreeware/unpackdir/
>>>> Insight/bin
>>>> /libITKCommon.a(itkExplicitInstantiations.o) definition of absolute
>>>> _ZNK3itk18ImageToImageFilterINS_5ImageIaLj2EEENS1_IfLj2EEEE14GetName 
>>>> OfC
>>>> 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
>>>>
>>>
>
>
> _______________________________________________
> 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