Hide
Know what you're getting – Unlike many sites, all our code is clearly licensed. Join Siafoo Now or Learn More

Boost and Intel Compiler

over 4 years ago

I recently rediscovered the Intel C++ Compiler's free availability for non-commercial use and decided to try it on my own code and see what performance improvement I can achieve on my simulation code.

Installation was easy enough... unlike what the script tells you, you can disable SELinux enforcement by using:

setenforce 0

Anyway as soon I actually tried to compile my code I was faced with a ton of errors:

/usr/include/boost/type_traits/remove_reference.hpp(39): error: expected a ">"
 struct remove_rvalue_ref<T&&>
                          ^
/usr/include/boost/type_traits/is_rvalue_reference.hpp(21): error: expected a ">"
 BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_rvalue_reference,T&&,true)
 ^

/usr/include/boost/type_traits/is_volatile.hpp(60): error: expected a ">"
  struct is_volatile_rval_filter<T&&>
                                 ^
/usr/include/boost/type_traits/remove_cv.hpp(44): error: expected a ">"
  struct rvalue_ref_filter_rem_cv<T&&>
                                  ^
/usr/include/boost/type_traits/is_const.hpp(69): error: expected a ">"
  struct is_const_rvalue_filter<T&&>
                                 ^
/usr/include/boost/type_traits/make_unsigned.hpp(38): error: expected a type specifier
     BOOST_STATIC_ASSERT(
     ^
/usr/include/boost/type_traits/make_unsigned.hpp(41): error: expected a type specifier
     BOOST_STATIC_ASSERT(
     ^

I tracked down the problem to the following type of statement:

template <class T>
struct remove_rvalue_ref<T&&>
{
  typedef T type;
};

And the solution was to add -std=c++0x to the Intel compiler flags.

Also another thing to note is that the to use OpenMP with the Intel Compiler you only need to specify the -openmp flag.