[Insight-developers] itk and icc

Simon Warfield warfield at bwh.harvard.edu
Wed Oct 6 12:35:14 EDT 2004


itk will compile fine with -no-gcc turned on, which you can add to the 
compiler flags when you run cmake.


However, you might want to try the 8.1 version of the icc compiler.
It has different gcc compatibility interactions. It has support for gnu 
libstdcxx turned on by default.

>Date: Wed, 06 Oct 2004 09:40:37 -0500
>From: Kent Williams <norman-k-williams at uiowa.edu>
>Subject: [Insight-developers] Problems compiling with Intel C++
>	Compiler
>To: insight-developers at itk.org
>Message-ID: <416403E5.6000804 at uiowa.edu>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>There's another issue with ICC 8.0, similar to problems others have 
>encounted before: namely, ICC is a very different compiler than GCC, but 
>most of the same preprocessor flags are defined for both.
>
>In particular, in vcl_algorithm+vnl_rational-.cxx and 
>vcl_algorithm+vnl_bignum-.cxx, there's this conditionally compiled business:
>
>#ifdef GNU_LIBSTDCXX_V3
># include <vcl_vector.h>
>VCL_SORT_INSTANTIATE(vcl_vector<vnl_bignum>::iterator, vnl_bignum);
>namespace std {
>  template vnl_bignum* std::fill_n<vnl_bignum*, unsigned long, 
>vnl_bignum>(vnl_bignum*, unsigned long, vnl_bignum const&);
>}
>#endif
>VCL_SORT_INSTANTIATE(vnl_bignum*, vnl_bignum);
>
>If I comment out the 'ifdef GNU_LIBSTDCXX_V3' clause, ICC compiles VXL fine.
>
>A further problem comes with ITK proper:
>There's another issue with ICC 8.0, similar to problems others have 
>encounted before: namely, ICC is a very different compiler than GCC, but 
>most of the same preprocessor flags are defined for both.
>
>In particular, in vcl_algorithm+vnl_rational-.cxx and 
>vcl_algorithm+vnl_bignum-.cxx, there's this conditionally compiled clause:
>
>    #ifdef GNU_LIBSTDCXX_V3
>    # include <vcl_vector.h>
>    VCL_SORT_INSTANTIATE(vcl_vector<vnl_bignum>::iterator, vnl_bignum);
>    namespace std {
>      template vnl_bignum* std::fill_n<vnl_bignum*, unsigned long,
>    vnl_bignum>(vnl_bignum*, unsigned long, vnl_bignum const&);
>    }
>    #endif
>    VCL_SORT_INSTANTIATE(vnl_bignum*, vnl_bignum);
>
>If I comment out the 'ifdef GNU_LIBSTDCXX_V3' clause, ICC compiles VXL fine.
>
>A further problem comes with ITK proper:
>
>          Insight/Code/Common/itk_hash_map.h(66): error: name followed
>    by "::" must be a class or namespace name    using __gnu_cxx::hash;
>
>ICC apparently doesn't see or can't handle using these classes from the 
>GCC-specific libraries.  Now, perhaps both these problems could be 
>addressed if the compiler flag '-no-gcc' was added when the compiler is 
>icc, but
>A) I don't know where in the CMake files to add this compiler-specific 
>flags so that it properly propogates.
>B) Without trying it, I don't know if '-no-gcc' will break other stuff.
>

-- 
Simon 



More information about the Insight-developers mailing list