by default ubuntu installs libboost 1.46 library as libbooost-all-dev. it doesn’t work with icpc, icpc gives errors:

icpc -c main.cc -O2  -lboost_serialization -lboost_program_options -diag-error
icpc: command line warning #10155: ignoring option '-diag-error'; argument required
/usr/include/boost/type_traits/remove_reference.hpp(39): error: expected a ">"
  struct remove_rvalue_ref
                            ^

/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
                                  ^

/usr/include/boost/type_traits/remove_cv.hpp(44): error: expected a ">"
  struct rvalue_ref_filter_rem_cv
                                   ^

/usr/include/boost/type_traits/is_const.hpp(69): error: expected a ">"
  struct is_const_rvalue_filter
                                 ^

.
.
.

/usr/include/boost/archive/detail/check.hpp(60): error: identifier "static_assert" is undefined
      BOOST_STATIC_ASSERT(typex::value);
      ^
          detected during:
            instantiation of "void boost::archive::detail::check_object_level() [with T=bool]" at line 438 of "/usr/include/boost/archive/detail/iserializer.hpp"
            instantiation of "void boost::archive::detail::load_non_pointer_type::invoke(Archive &, T &) [with Archive=boost::archive::naked_binary_iarchive, T=bool]" at line 592 of "/usr/include/boost/archive/detail/iserializer.hpp"
            instantiation of "void boost::archive::load(Archive &, T &) [with Archive=boost::archive::naked_binary_iarchive, T=bool]" at line 66 of "/usr/include/boost/archive/detail/common_iarchive.hpp"
            instantiation of "void boost::archive::detail::common_iarchive::load_override(T &, int) [with Archive=boost::archive::naked_binary_iarchive, T=bool]" at line 70 of "/usr/include/boost/archive/basic_binary_iarchive.hpp"
            instantiation of "void boost::archive::basic_binary_iarchive::load_override(T &, int) [with Archive=boost::archive::naked_binary_iarchive, T=bool]" at line 50 of "/usr/include/boost/archive/binary_iarchive_impl.hpp"
            instantiation of "void boost::archive::binary_iarchive_impl::load_override(T &, int) [with Archive=boost::archive::naked_binary_iarchive, Elem=char, Tr=std::char_traits, T=bool]" at line 60 of "/usr/include/boost/archive/detail/interface_iarchive.hpp"
            instantiation of "Archive &boost::archive::detail::interface_iarchive::operator>>(T &) [with Archive=boost::archive::naked_binary_iarchive, T=bool]" at line 94 of "/usr/include/boost/archive/basic_binary_iarchive.hpp"
            instantiation of "void boost::archive::basic_binary_iarchive::load_override(boost::archive::tracking_type &, int) [with Archive=boost::archive::naked_binary_iarchive]" at line 50 of "/usr/include/boost/archive/binary_iarchive_impl.hpp"
            instantiation of "void boost::archive::binary_iarchive_impl::load_override(T &, int) [with Archive=boost::archive::naked_binary_iarchive, Elem=char, Tr=std::char_traits, T=boost::archive::tracking_type]" at line 60 of "/usr/include/boost/archive/detail/interface_iarchive.hpp"
            instantiation of "Archive &boost::archive::detail::interface_iarchive::operator>>(T &) [with Archive=boost::archive::naked_binary_iarchive, T=boost::archive::tracking_type]" at line 57 of "/usr/include/boost/archive/detail/common_iarchive.hpp"
            instantiation of "void boost::archive::detail::common_iarchive::vload(boost::archive::tracking_type &) [with Archive=boost::archive::naked_binary_iarchive]"

compilation aborted for main.cc (code 2)
make: *** [main.o] Error 2

installing newer versions of libboost (1.47 or from svn) didn’t solve the problem.

However, deleting the default boost 1.46 and installing 1.42 helped:

> sudo apt-get purge libboost*
> sudo apt-get install libboost1.42-all-dev

now everything compiles well

Update: i think you have to switch to unity2d. unity3d requires boost 1.46 program options.

Advertisements