Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Thomas_Gloe
Beginner
82 Views

icpc and libc++ on OS X

Hi,

Is there a way to switch between libc++ and libstdc++ on Mac OS X 10.8 when icpc is used? The reason is pretty simple, libc++ includes the c++11 features and libstdc++ shiped with XCode is pretty old.

The clang compiler enables me to use shared_ptr without additional libraries like boost (command line: "clang++ -std=c++11 -stdlib=libc++"). In case of icpc, libstdc++ is always used, even if I use options "icpc -std=c++11 -use-clang-env". So I'm looking for an option like "-stdlib=libc++" of the clang compiler, which I did not find in the icpc manual.

I know, that I could also update the gnu compiler collection using mac ports. Still I would prefer to use the official mac os toolchain.

Any help would be appreciated.

Best regards,

Thomas

0 Kudos
1 Reply
Jeffrey_H_Intel
Employee
82 Views

I don't know when it was introduced, but there is an option for this on Mac now.

$ icpc -help | grep "\-stdlib=" -A3
-stdlib=<keyword>
          select the C++ library used for linking
            libstdc++ - links using the GNU libstdc++ library
            libc++    - links using the libc++ library (DEFAULT)