[Insight-developers] Problems compiling with Intel C++ Compiler

Kent Williams norman-k-williams at uiowa.edu
Wed Oct 6 10:40:37 EDT 2004


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.



More information about the Insight-developers mailing list