[Insight-developers] Problems compiling today

Bradley Lowekamp blowekamp at mail.nih.gov
Sat Mar 16 10:39:01 EDT 2013


Bill,

Looks like you caught a major issue right before the dashboard did :) You have impeccable timing!

I looked at this. And it  is just a case of a missing ITKCommon_Export. It's just a little tricky because you have the non-specilized declaration and definition. Then a specialized declaration. What's missing is a statement which says the method has been explicitly instantiated (this just happens to be a totally specialized version), but the statement is that same as if it'd been explicitly instantiated. This has been compiler dependent, and we use the ITKCommon_EXPORT macro for that. It's sounds like the extern keyword should to this in C++0x, but I hadn't looked at the closely.

I hope this help explains what's going on....

Brad


On Mar 15, 2013, at 10:31 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:

> There are issues with template specializations and -fvisibility=hidden. From what I read no current compilers officially support this, but most do. I guess my gcc on the MAXC does not.
> 
> I'll put a patch to gerrit that adds lines like these in Common/src/CMakeLists.txt
>     if(APPLE)
>       set_source_files_properties( itkArrayOutputSpecialization.cxx PROPERTIES
>         COMPILE_FLAGS -fvisibility=default )
>     endif()
> 
> When I do this, my gcc build is OK.
> 
> Bill
> 
> On Fri, Mar 15, 2013 at 7:00 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> It has to do with symbol visibility. If I do nm on the ITKCommon lib, the undefined symbols have "t" and not "T". "t" means the symbols are local. If I remove the -fvisiibility=hidden flag from ITKCommon's CMakeLists.txt file, the tests build fine.
> 
> 
> 
> On Fri, Mar 15, 2013 at 6:49 PM, Bradley Lowekamp <blowekamp at mail.nih.gov> wrote:
> Bill,
> 
> Are you able to compile the release? Or is it a  change since then?
> 
> Brad
> 
> On Mar 15, 2013, at 7:36 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> 
>> I see why  those statements are there.
>> 
>> Still need help.
>> 
>> On Fri, Mar 15, 2013 at 4:25 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>> More info. If I remove
>> template<> std::ostream & operator<< <double> (std::ostream & os, const Array< double > & arr);
>> template<> std::ostream & operator<< <float> (std::ostream & os, const Array< float > & arr);
>> 
>> Both my c++ and clang build fine.
>> 
>> What is the purpose of these lines?
>> 
>> Bill
>> 
>> On Fri, Mar 15, 2013 at 4:09 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>> Guys,
>> 
>> This is  on my Mac using:
>> c++ --version
>> c++ --version
>> i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
>> 
>> My clang version builds fine.
>> 
>> Any ideas?
>> 
>> Bill
>> 
>> 
>> On Fri, Mar 15, 2013 at 11:52 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>> Folks,
>> 
>> It's been a few days since itk and tried a build.
>> 
>> Today I get Linking CXX executable ../../../../bin/ITKCommon1TestDriver
>> Undefined symbols for architecture x86_64:
>>   "std::basic_ostream<char, std::char_traits<char> >& itk::operator<< <float>(std::basic_ostream<char, std::char_traits<char> >&, itk::Array<float> const&)", referenced from:
>>       void CheckVariableLengthArrayTraits<itk::Array<float> >(itk::Array<float>)in itkNumericTraitsTest.cxx.o
>>       itkArrayTest(int, char**)in itkArrayTest.cxx.o
>>   "std::basic_ostream<char, std::char_traits<char> >& itk::operator<< <double>(std::basic_ostream<char, std::char_traits<char> >&, itk::Array<double> const&)", referenced from:
>>       void CheckVariableLengthArrayTraits<itk::Array<double> >(itk::Array<double>)in itkNumericTraitsTest.cxx.o
>> ld: symbol(s) not found for architecture x86_64
>> collect2: ld returned 1 exit status
>> make[2]: *** [bin/ITKCommon1TestDriver] Error 1
>> make[1]: *** [Modules/Core/Common/test/CMakeFiles/ITKCommon1TestDriver.dir/all] Error 2
>> make: *** [all] Error 2
>> 
>> Bill
>> 
>> 
>> 
>> 
>> -- 
>> Unpaid intern in BillsBasement at noware dot com
>> 
>> 
>> 
>> -- 
>> Unpaid intern in BillsBasement at noware dot com
>> 
>> 
>> 
>> -- 
>> Unpaid intern in BillsBasement at noware dot com
>> _______________________________________________
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>> 
>> Kitware offers ITK Training Courses, for more information visit:
>> http://kitware.com/products/protraining.php
>> 
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-developers
> 
> 
> 
> 
> -- 
> Unpaid intern in BillsBasement at noware dot com
> 
> 
> 
> -- 
> Unpaid intern in BillsBasement at noware dot com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20130316/0e9b6d9d/attachment.htm>


More information about the Insight-developers mailing list