Opened 11 years ago

Closed 11 years ago

#5661 closed Bugs (fixed)

Scoped enums used for Intel compiler but /Qstd=c++0x not used, causes error with operations.hpp

Reported by: Brandon Hewitt <brandon.l.hewitt@…> Owned by: John Maddock
Milestone: To Be Determined Component: config
Version: Boost 1.46.1 Severity: Problem
Keywords: Cc:

Description

I'm using Intel C++ Composer XE 2011 update 4 (i.e. icl 12.0) for Windows on Intel 64 with Visual Studio 2010. When trying to build Boost 1.46.1 with the following command line:

.\bjam stage --toolset=intel address-model=64 variant=release -- build-type=complete threading=multi --without-wave --without-python --without-mpi --without-graph --without-graph_parallel

I get a problem compiling v2_operations.cpp:

compile-c-c++ bin.v2\libs\filesystem\build\intel-win\release\address-model-64\threading-multi\v2\src\v2_operations.obj '"C:\Program Files (x86)\Intel\ComposerXE-2011.4.196\bin\intel64iclvars.bat"' is not recognized as an internal or external command, operable program or batch file. icl: command line remark #10010: option '/Og' is deprecated and will be removed in a future release. See '/help deprecated' icl: command line warning #10148: option '/Oy' not supported icl: command line remark #10010: option '/Op' is deprecated and will be removed in a future release. See '/help deprecated' v2_operations.cpp .\boost/filesystem/v2/operations.hpp(511): error: expected either a definition or a tag name

BOOST_SCOPED_ENUM_START(copy_option)

This happens because BOOST_SCOPED_ENUM_START(copy_option) is preprocessed into:

enum class copy_option

which happens because of the following code in boost\config\compiler\intel.hpp:

#if defined(_MSC_VER) && (_MSC_VER >= 1600) # define BOOST_INTEL_STDCXX0X #endif

and then later:

#if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION >= 1200) # undef BOOST_NO_RVALUE_REFERENCES # undef BOOST_NO_SCOPED_ENUMS <snip>

The problem becomes then that the assumption is made that the compiler will support C++0x, but the Intel compiler requires the /Qstd=c++0x command line option to support this mode, and this is not used when v2_operations.cpp is compiled. If I add /Qstd=c++0x to intel-win.jam, then the build works.

You can see http://software.intel.com/en-us/forums/showthread.php?t=83556 for a reference for a customer running into this.

Change History (2)

comment:1 by anonymous, 11 years ago

Component: Building Boostconfig
Owner: set to John Maddock

comment:2 by John Maddock, 11 years ago

Resolution: fixed
Status: newclosed

This has actually already been fixed - and will will released in 1.47.

Do you know is there a way to tell when /Qstd=c++0x has been passed to the compiler?

Note: See TracTickets for help on using tickets.