Boost logo

Boost Interest :

Subject: [Boost-cmake] Issues with Intel C++
From: Justin Holewinski (shawmishrak_at_[hidden])
Date: 2009-10-07 11:12:06


I am trying to compile Boost 1.40 with the Intel C++ Compiler, Version 11.1,
using CMake and I've encountered two issues so far.

First, on Windows, the Intel C++ Compiler follows Microsoft's naming
convention. The compiler executable is icl.exe, not icc.exe or icpc.exe.
Hence, the BoostConfig.cmake script fails to detect the Intel compiler on
Windows because it tries to match the compiler name against icpc.exe. The
fix is trivial. In BoostConfig.cmake, add an additional conditional on line
89:

elseif(CMAKE_CXX_COMPILER MATCHES "/icpc$" OR CMAKE_CXX_COMPILER MATCHES
"/icpc.exe$" OR CMAKE_CXX_COMPILER MATCHES "/icl.exe$")

I'm not sure what impact this has on the build process other than applying
the 'intel' branding to the generated libraries instead of 'unknown'.

Second, the handling of inter-library dependencies appears to be broken
(when using Intel C++), particularly the dependency between
Boost.Wserialization and Boost.Serialization. A different error is issued
for different platforms.

Windows:

When building shared libraries, the Boost.Wserialization library attempts to
link to the shared-library version of Boost.Serialization. The link library
is assumed to be in lib/ (as per Unix conventions), but link libraries for
shared DLLs on Windows are placed in bin/. This results in a CMake
dependency error:

NMAKE : fatal error U1073: don't know how to make
'lib\boost_serialization-intel-mt-1.40.lib'

The correct dependency is instead
'bin\boost_serialization-intel-mt-1.40.lib'.

Mac OS X:

The same Boost.Wserialization and Boost.Serialization dependency appears to
be ignored.

$ make VERBOSE=1
/usr/bin/icpc -mmacosx-version-min=10.6 -dynamiclib
-headerpad_max_install_names -o
../../../lib/libboost_wserialization-mt.dylib -install_name
/Users/jholewinski/libraries/boost-1.40-build-intel/lib/libboost_wserialization-mt.dylib
CMakeFiles/boost_wserialization-mt-shared.dir/basic_text_wiprimitive.cpp.o
CMakeFiles/boost_wserialization-mt-shared.dir/basic_text_woprimitive.cpp.o
CMakeFiles/boost_wserialization-mt-shared.dir/text_wiarchive.cpp.o
CMakeFiles/boost_wserialization-mt-shared.dir/text_woarchive.cpp.o
CMakeFiles/boost_wserialization-mt-shared.dir/utf8_codecvt_facet.cpp.o
CMakeFiles/boost_wserialization-mt-shared.dir/xml_wgrammar.cpp.o
CMakeFiles/boost_wserialization-mt-shared.dir/xml_wiarchive.cpp.o
CMakeFiles/boost_wserialization-mt-shared.dir/xml_woarchive.cpp.o
CMakeFiles/boost_wserialization-mt-shared.dir/codecvt_null.cpp.o
Undefined symbols:
  "__ZN5boost7archive26BOOST_ARCHIVE_XML_CLASS_IDEv", referenced from:
      __ZN5boost7archive17basic_xml_grammarIwEC1Ev in xml_wgrammar.cpp.o

__ZN5boost7archive6detail15common_oarchiveINS0_13xml_woarchiveEE5vsaveENS0_13class_id_typeE
in xml_woarchive.cpp.o

__ZN5boost7archive6detail15common_oarchiveINS0_13xml_woarchiveEE5vsaveENS0_22class_id_optional_typeE
in xml_woarchive.cpp.o

__ZN5boost7archive18basic_xml_oarchiveINS0_13xml_woarchiveEE13save_overrideERKNS0_22class_id_optional_typeEi
in xml_woarchive.cpp.o

__ZN5boost7archive18basic_xml_oarchiveINS0_13xml_woarchiveEE13save_overrideERKNS0_13class_id_typeEi
in xml_woarchive.cpp.o
<many more undefined symbols>

Looking at the command-line, the Boost.Serialization library is never
referenced.

Any ideas what could be the problem for the second issue? Is there a
specific place in the CMake build scripts that I should be looking to try to
fix this?

On both Windows and Mac OS X, the build is successful using Visual C++ and
g++, respectively.

-- 
Thanks,
Justin Holewinski


Boost-cmake list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk