Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 282146 - dev-lang/icc-11.1 ebuild will not allow icpc to compile C++ code
Summary: dev-lang/icc-11.1 ebuild will not allow icpc to compile C++ code
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Andrey Kislyuk (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 246516
  Show dependency tree
 
Reported: 2009-08-20 20:41 UTC by Adam Stylinski
Modified: 2011-08-11 13:27 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,3.98 KB, text/plain)
2009-08-27 15:37 UTC, clayton
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Stylinski 2009-08-20 20:41:42 UTC
Initially icc wasn't even anywhere in the path.  I added it to my /etc/portage/bashrc so that it concatenated the full path of the intel64 bin's dir (found in /opt/intel/Compiler/11.1/046/bin), however it doesn't know where to find the stdc++ libs.  Obvious the lib and include directories are in the /opt path somewhere, the question is how to integrate these into the system profile so that icpc can compile.  

Reproducible: Always

Steps to Reproduce:
1. icpc <any file>.cc
Actual Results:  
mythtv@mythtvbox ~ $ icpc blah.c
icpc: error #10001: could not find directory in which the set of libstdc++ include files resides

Expected Results:  
Compiled the code.

I'm not sure how the 10.1.118 version was linked and how the paths were setup (It was a bit similar, though, with things in the /opt directory).
Comment 1 Andrey Kislyuk (RETIRED) gentoo-dev 2009-08-21 12:47:22 UTC
Sourcing /etc/profile.d/icc.sh is supposed to take care of the environment.

That said, I have committed a revision (-r1) that uses an env.d file as before, instead of a profile.d file. Let me know whether that fixes it for you.
Comment 2 Adam Stylinski 2009-08-21 16:24:53 UTC
(In reply to comment #1)
> Sourcing /etc/profile.d/icc.sh is supposed to take care of the environment.
> 
> That said, I have committed a revision (-r1) that uses an env.d file as before,
> instead of a profile.d file. Let me know whether that fixes it for you.
> 

Still not working, is there some sort of extra step to use the env.d file?  I've considered sourcing it in, don't know how that will mess with my profile, though.
Comment 3 Adam Stylinski 2009-08-21 16:51:59 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Sourcing /etc/profile.d/icc.sh is supposed to take care of the environment.
> > 
> > That said, I have committed a revision (-r1) that uses an env.d file as before,
> > instead of a profile.d file. Let me know whether that fixes it for you.
> > 
> 
> Still not working, is there some sort of extra step to use the env.d file? 
> I've considered sourcing it in, don't know how that will mess with my profile,
> though.
> 

Actually I'm fairly certain that env file may have broken something in LD_PATH as I'm getting the notorious sandbox error since I tried -r1 (ERROR: ld.so: object 'libsandbox.so' from LD_PRELOAD cannot be preloaded)
Comment 4 Andrey Kislyuk (RETIRED) gentoo-dev 2009-08-22 02:35:16 UTC
Keywords removed until we can resolve this. Appreciate any help.
Comment 5 Andrey Kislyuk (RETIRED) gentoo-dev 2009-08-23 01:43:41 UTC
Just remove the LD_PRELOAD line from /etc/env.d/05icc.

The root cause of the problem is that icc/icpc interrogates gcc about the location of its headers and libraries, but then prepends '/usr' to paths reported by gcc for no reason I can track down. That results in the following failed syscall:

stat("/usr/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.1/include/g++-v4", 0x7fff60195280) = -1 ENOENT (No such file or directory)

If I create a symlink /usr/usr -> /usr, the compiler works. However that's not an acceptable workaround to use in the tree.
Comment 6 Andrey Kislyuk (RETIRED) gentoo-dev 2009-08-23 17:24:24 UTC
The following contents can be added to icpc.cfg to avoid the problem:

-nostdinc++
-isystem/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.1/include/g++-v4
-isystem/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.1/include/g++-v4/x86_64-pc-linux-gnu
-isystem/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.1/include/g++-v4/backward

However, this solution requires a maintenance overhead as it will change with every GCC version.
Comment 7 Andrey Kislyuk (RETIRED) gentoo-dev 2009-08-23 21:26:20 UTC
I have committed a revision (-r2) that includes the options above in icpc.cfg. This fixes the problems on amd64 native compiling. However icpc still has problems with headers on x86. Any help tracking down the solution on x86 is appreciated.
Comment 8 Andrey Kislyuk (RETIRED) gentoo-dev 2009-08-23 21:27:00 UTC
Re-added ~amd64 keyword but not ~x86
Comment 9 clayton 2009-08-27 04:03:06 UTC
I have just upgraded from 11.0 to the r2 ebuild, and there is still a major path issue. I am getting errors about a missing 'libintlc.so.5'. Sourcing /etc/profile fixes the issue in the current shell, but any applications that were compiled with ICC (python, etc) bomb with the same missing lib error.
Comment 10 Andrey Kislyuk (RETIRED) gentoo-dev 2009-08-27 14:00:05 UTC
You must have LD_LIBRARY_PATH=/opt/intel/Compiler/11.1/046/lib/intel64 set in the shell where you want to run dynamically linked Intel stuff. If you can't ensure that, copying its contents to /usr/lib might work but that's probably an unacceptably bad hack so it won't go into the ebuild.

How did you manage to compile Python with this icc? It doesn't compile for me.
Comment 11 clayton 2009-08-27 14:14:00 UTC
How does it work with the 11.0.X, but break in 11.1.X?

I had no problems compiling python with ICC. I even followed the ICC article on gentoo-wiki (http://www.gentoo-wiki.info/HOWTO_ICC_and_Portage)
Python is even listed as one of the apps that works well with ICC.

Only downside is now I've lost any apps that depend on python (emerge, etc) since invoking them launches python in a different shell that doesn't seem to source /etc/profile for some reason.
Comment 12 Andrey Kislyuk (RETIRED) gentoo-dev 2009-08-27 14:31:08 UTC
(In reply to comment #11)

Please post your emerge --info.
Comment 13 Andrey Kislyuk (RETIRED) gentoo-dev 2009-08-27 14:35:26 UTC
(In reply to comment #11)
> How does it work with the 11.0.X, but break in 11.1.X?

The 11.0.x ebuild set LDPATH. Please try setting LDPATH to the same value as LD_LIBRARY_PATH in /etc/env.d/05icc and let me know if that makes a difference.

Intel's script only sets LD_LIBRARY_PATH.
Comment 14 clayton 2009-08-27 15:36:25 UTC
(In reply to comment #13)

Setting LDPATH in /etc/env.d/05icc doesn't seem to make any difference.
I've attached my emerge --info above.

Comment 15 clayton 2009-08-27 15:37:55 UTC
Created attachment 202411 [details]
emerge --info

emerge --info

'emerge' breaks when it cannot find libintlc.so.5, despite sourcing /etc/profile
Comment 16 Jacek Szafarkiewicz 2009-09-17 20:11:13 UTC
(In reply to comment #14)
> Setting LDPATH in /etc/env.d/05icc doesn't seem to make any difference.
> I've attached my emerge --info above.
> 

Did you run env-update after adding LDPATH?
Check if the lib path is in /etc/ld.so.conf.
Comment 17 clayton 2009-09-17 21:24:42 UTC
Yes I tried running env-update.

I've since reverted back to the previous version of ICC, since I could not afford to have the system in limbo as I tried to work out the issues with this newer version.
Comment 18 Sébastien Fabbro (RETIRED) gentoo-dev 2009-10-09 02:05:05 UTC
11.1.056 compiles c++ fine. Could someone check? 
If it still fails, link your "gcc-config -X" to /usr/include/c++/<gcc-version>, test and report.
Thanks
Comment 19 Dennis Schridde 2011-08-11 08:25:45 UTC
(In reply to comment #18)
> 11.1.056 compiles c++ fine. Could someone check?
Is this bug still valid?
Comment 20 Adam Stylinski 2011-08-11 13:27:29 UTC
Sorry, completely forgot about this bug.  Yes, it's fixed.