Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

boost::program_options, boost::shared_ptr with Intel C++ Compiler 11.x

Marat_Abrarov
Beginner
433 Views

Hi, Intel C++ Compiler developers and users!

I'm using boost 1.40.

I have a project at http://sourceforge.net/projects/asio-samples/ (only SVN trunk is available now) It uses MS C++ Compiler (9.0 SP1 - MS Visual Studio 2008 SP1) and boost::program_options (+ boost::asio + boost::...).

When I switched that project (I mean "echo_server") to Intel C++ Compiler 11.1.038 (I tried all 11.1.x) and built debug version (Debug Win32) (with addition of option /vmg to compiler command line - why MS C++ Compiler don't need it?) it works fine except shared_ptr-to-bool cast (for example: include/ma/echo/server/session_manager.hpp: 319).

This issue I found only at "Debug Win32" build mode - at "Debug x64" all is fine and the built executable (echo_server.exe) works right.

When I build "Release Win32" or "Release x64", the built executable don't work at all - it fails somewhere at the boost::program_options (I think at std::vector<:STRING>::operator= or std::vector<:STRING> copy-constructor).

Does anybody:

1) tried to use boost::shared_ptr

2) tried to use boost::prorgam_options

with Intel C++ Compiler 11.1.x?

P.S. - If I change boost_1_40_0/boost/smart_ptr/detail/operator_bool.hpp: 9 - add

[cpp]|| defined (BOOST_INTEL)[/cpp]

- then shared_ptr-to-bool cast works fine (Win32/x64 Debug/Release)

Regards, Marat Abrarov.

0 Kudos
1 Reply
Brandon_H_Intel
Employee
433 Views
Quoting - mabrarov

Hi, Intel C++ Compiler developers and users!

I'm using boost 1.40.

I have a project at http://sourceforge.net/projects/asio-samples/ (only SVN trunk is available now) It uses MS C++ Compiler (9.0 SP1 - MS Visual Studio 2008 SP1) and boost::program_options (+ boost::asio + boost::...).

When I switched that project (I mean "echo_server") to Intel C++ Compiler 11.1.038 (I tried all 11.1.x) and built debug version (Debug Win32) (with addition of option /vmg to compiler command line - why MS C++ Compiler don't need it?) it works fine except shared_ptr-to-bool cast (for example: include/ma/echo/server/session_manager.hpp: 319).

This issue I found only at "Debug Win32" build mode - at "Debug x64" all is fine and the built executable (echo_server.exe) works right.

When I build "Release Win32" or "Release x64", the built executable don't work at all - it fails somewhere at the boost::program_options (I think at std::vector<:STRING>::operator= or std::vector<:STRING> copy-constructor).

Does anybody:

1) tried to use boost::shared_ptr

2) tried to use boost::prorgam_options

with Intel C++ Compiler 11.1.x?

P.S. - If I change boost_1_40_0boostsmart_ptrdetailoperator_bool.hpp: 9 - add "|| defined (BOOST_INTEL)" - then shared_ptr-to-bool cast works fine (Win32/x64 Debug/Release)

Regards, Marat Abrarov.


Are you building the boost libs with the Intel Compiler as well? You run the risk of incompatibility issues if you don't, although it shouldn't result in compile-time errors. You would see link-time or run-time errors most likely. I'll see if I can reproduce the error with the code you pointed to.
0 Kudos
Reply