Opened 7 years ago

Closed 7 years ago

#11815 closed Bugs (worksforme)

boost::config defines BOOST_NO_CXX11_RVALUE_REFERENCES under icc 15

Reported by: nmusolino@… Owned by: John Maddock
Milestone: To Be Determined Component: config
Version: Boost 1.54.0 Severity: Problem
Keywords: icc Cc:

Description

When compiling with icc version 15.0.4 under the C++11 standard, the macro BOOST_NO_CXX11_RVALUE_REFERENCES is defined, even though icc supports rvalue references.

I discovered this when attempting to use the intrusive_ptr class template's move constructor, so I created a demonstration that uses intrusive_ptr.

$ icc --version
icc (ICC) 15.0.4 20150805
icc -I/path/to/boost/1.56.0/include/ -std=c++11 ./intrusive_ptr_test.cpp -o intrusive_ptr_test_icc

$ ./intrusive_ptr_test_icc 
__cplusplus: 201103
BOOST_VERSION: 105600
std::is_nothrow_move_constructible<S_ptr>: false
BOOST_NO_CXX11_RVALUE_REFERENCES: <undefined>
__INTEL_COMPILER: 1500
BOOST_INTEL_CXX_VERSION: 1500

I expected that BOOST_NO_CXX11_RVALUE_REFERENCES would not be defined, because this version of icc supports rvalue references.

When built using g++ 5.2.0, the macro is not defined, so the intrusive_ptr class template is nothrow-move-constructible.

$ g++ --version
g++ (TPM built 20150717) 5.2.0
Copyright (C) 2015 Free Software Foundation, Inc.
$ g++ -I/path/to/boost/1.56.0/include/ -std=c++11 ./intrusive_ptr_test.cpp -o intrusive_ptr_test_gcc

$ ./intrusive_ptr_test_gcc
__cplusplus: 201103
BOOST_VERSION: 105600
std::is_nothrow_move_constructible<S_ptr>: true
BOOST_NO_CXX11_RVALUE_REFERENCES: <undefined>

I believe this is the same problem reported in ticket #9829.

This problem does not occur in boost 1.58.0.

Attachments (3)

intrusive_ptr_test.cpp (1.4 KB ) - added by nmusolino@… 7 years ago.
Demonstration of boost::config problem
config_info_output_icc15.txt (10.7 KB ) - added by nmusolino@… 7 years ago.
config_info_output_gcc51.txt (9.7 KB ) - added by nmusolino@… 7 years ago.

Download all attachments as: .zip

Change History (12)

by nmusolino@…, 7 years ago

Attachment: intrusive_ptr_test.cpp added

Demonstration of boost::config problem

comment:1 by John Maddock, 7 years ago

I don't see this (in develop anyway), some comments:

  • At Intel's request we changed our configuration to match whatever version of GCC Intel is emulating, so the underlying gcc version is critical.
  • Your test output above shows BOOST_NO_CXX11_RVALUE_REFERENCES as *not* being set for Intel and GCC alike.
  • The best way to see what is and isn't being set is to cd into libs/config/test and build and run the program config_info.cpp. I don't see BOOST_NO_CXX11_RVALUE_REFERENCES set in either C++11 or C++ 14 mode.

Best, John.

comment:2 by anonymous, 7 years ago

I'm sorry, I made a mistake when examining different versions of boost. BOOST_NO_CXX11_RVALUE_REFERENCES is defined under boost 1.54:

$ icc -I/path/to/boost/1.54.0/include/  -std=c++11 ./intrusive_ptr_test.cpp -o intrusive_ptr_test_icc
$ $ ./intrusive_ptr_test_icc
__cplusplus: 201103
BOOST_VERSION: 105400
std::is_nothrow_move_constructible<S_ptr>: false
BOOST_NO_CXX11_RVALUE_REFERENCES: <defined>
__INTEL_COMPILER: 1500
BOOST_INTEL_CXX_VERSION: 1500
$ g++ -I/path/to/boost/1.54.0/include/  -std=c++11 ./intrusive_ptr_test.cpp -o intrusive_ptr_test_gcc
$ ./intrusive_ptr_test_gcc
__cplusplus: 201103
BOOST_VERSION: 105400
std::is_nothrow_move_constructible<S_ptr>: true
BOOST_NO_CXX11_RVALUE_REFERENCES: <undefined>

I can build the config_info program if it would be helpful.

comment:3 by anonymous, 7 years ago

Version: Boost 1.56.0Boost 1.54.0

comment:4 by nmusolino@…, 7 years ago

Using config_info, I do see some BOOST_NO_CXX11_* macros, in particular BOOST_NO_CXX11_NOEXCEPT and BOOST_NO_CXX11_CONSTEXPR, that appear to be defined incorrectly under boost 1.56.0 and icc. The _NOEXCEPT issue causes the intrusive_ptr class to not be nothrow-movable.

Would you prefer that I create a new ticket, or place more information here? My inclination is to create a new ticket, to refer to a different boost version [1.56.0].

comment:4 by nmusolino@…, 7 years ago

Using config_info, I do see some BOOST_NO_CXX11_* macros, in particular BOOST_NO_CXX11_NOEXCEPT and BOOST_NO_CXX11_CONSTEXPR, that appear to be defined incorrectly under boost 1.56.0 and icc. The _NOEXCEPT issue causes the intrusive_ptr class to not be nothrow-movable.

Would you prefer that I create a new ticket, or place more information here? My inclination is to create a new ticket, to refer to a different boost version [1.56.0].

comment:5 by John Maddock, 7 years ago

Post the info here, but I still don't see it, note that for Intel-15 and later the configuration defaults to just

#include <boost/config/compiler/gcc.hpp>

Plus some logic to correctly set BOOST_COMPILER.

So you should see exactly the same configuration as the GCC version being emulated.

What does your config_info.cpp output look like (note - all of it please! ;) )

comment:6 by anonymous, 7 years ago

Thanks, by the way, for your responsiveness on this. I appreciate your efforts.

$ tar -xzf boost_1_56_0.tar.gz
$ icc --version
icc (ICC) 15.0.4 20150805
Copyright (C) 1985-2015 Intel Corporation.  All rights reserved.
$ icc -I./boost_1_56_0/ -std=c++11 ./boost_1_56_0/libs/config/test/config_info.cpp -o ./config_info_1_56_0_icc
$ ./config_info_1_56_0_icc > config_info_output_icc15.txt

I noticed that icc was emulating g++ 5.1 (see \_\_VERSION\_\_ in config_info_output_icc51.txt), so I built config_info using g++ 5.1 for comparison.

$ g++ --version
g++ (TPM built 20150527) 5.1.0
Copyright (C) 2015 Free Software Foundation, Inc.
$ g++ -I./boost_1_56_0 -std=c++11 ./boost_1_56_0/libs/config/test/config_info.cpp -o config_info_1_56_0_gcc51
$ ./config_info_1_56_0_gcc51 > config_info_output_gcc51.txt

The following boost config definitions seem incorrect to me, because icc 15 supports "constexpr" and "noexcept". I realize that the definition of BOOST_NOEXCEPT is probably a consequence of BOOST_NO_CXX11_NOEXCEPT being defined. Excerpt from attached file config_info_output_icc15.txt:

    BOOST_COMPILER_CONFIG                   ="boost/config/compiler/intel.hpp"
    [...]
    BOOST_NO_CXX11_CONSTEXPR                 [no value]
    [...]
    BOOST_NO_CXX11_NOEXCEPT                  [no value]
    [...]
    BOOST_CONSTEXPR                          [no value]
    BOOST_CONSTEXPR_OR_CONST                =const
    BOOST_STATIC_CONSTEXPR                  =static const
    BOOST_NOEXCEPT                           [no value]
    [...]

In contrast, these defintions appear correct under g++ 5.1. Excerpt from attached file config_info_output_gcc51.txt:

    BOOST_COMPILER_CONFIG                   ="boost/config/compiler/gcc.hpp"
    [...]
    BOOST_CONSTEXPR                         =constexpr
    BOOST_CONSTEXPR_OR_CONST                =constexpr
    BOOST_STATIC_CONSTEXPR                  =static constexpr
    BOOST_NOEXCEPT                          =noexcept

by nmusolino@…, 7 years ago

by nmusolino@…, 7 years ago

comment:7 by nmusolino@…, 7 years ago

Just to clarify, all the information in comment 6 pertains to boost 1.56.0. This is probably clear from the shell commands and the output, but I just want to highlight that here.

comment:8 by John Maddock, 7 years ago

Resolution: worksforme
Status: newclosed

OK I missed the boost-1.56 part - we didn't get around to configuring for Intel-15 until this autumn - if you can upgrade to 1.59 this should be fixed.

Note: See TracTickets for help on using tickets.