- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have both g++4.2 & g++4.1 installed on the system, since icc isn't compatiable with g++4.2's stl, so I want to use g++4.1's stl. The include file is in /usr/include/c++/4.1 but I don't know how to make icc to use the 4.1 version include file & link with the corresponding library file. -cxx-lib doesn't work for me, since that requires the whole version of g++-4.1 installed in a spcecifc directory where in my system they are scattered in /usr/lib & /usr/include etc.
Anybody know how to do this? thanks
Anybody know how to do this? thanks
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I assume you are using icc 9.1 or later, so as to have compatibility with g++ 4.1. Then you set your PATH so as to put the g++ 4.1 installation ahead of the other, e.g. supposing you installed it in /usr/local/gcc41/
export PATH=/usr/local/gcc41/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/gcc41/lib:$LD_LIBRARY_PATH
Your g++ 4.1 must be a working installation, such that
g++ -print-search-dirs
shows where g++ finds its library and include files.
export PATH=/usr/local/gcc41/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/gcc41/lib:$LD_LIBRARY_PATH
Your g++ 4.1 must be a working installation, such that
g++ -print-search-dirs
shows where g++ finds its library and include files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It won't work if gcc isn't installed in a separate prefix. E.g. here on Debian (and I believe the OP has similar setup), all gcc are installed in /usr:
/usr/bin/gcc -> /usr/bin/gcc-4.2
/usr/bin/gcc-4.1
/usr/bin/gcc-4.2
/usr/lib/gcc/i486-linux-gnu/4.1.2/
/usr/lib/gcc/i486-linux-gnu/4.2/
Installing yet another gcc from source is possible of course, but it'd be extra pain :(
For what it's worth, I have this wrapper script as "icpc":
#!/bin/sh
PATH=/usr/local/lib/icc/fake-gcc:$PATH
. /usr/local/lib/icc/bin/iccvars.sh
exec /usr/local/lib/icc/bin/icpc $@
fake-gcc is a directory which contains symlinks g++ -> /usr/bin/g++-4.1, etc.
/usr/bin/gcc -> /usr/bin/gcc-4.2
/usr/bin/gcc-4.1
/usr/bin/gcc-4.2
/usr/lib/gcc/i486-linux-gnu/4.1.2/
/usr/lib/gcc/i486-linux-gnu/4.2/
Installing yet another gcc from source is possible of course, but it'd be extra pain :(
For what it's worth, I have this wrapper script as "icpc":
#!/bin/sh
PATH=/usr/local/lib/icc/fake-gcc:$PATH
. /usr/local/lib/icc/bin/iccvars.sh
exec /usr/local/lib/icc/bin/icpc $@
fake-gcc is a directory which contains symlinks g++ -> /usr/bin/g++-4.1, etc.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page