Ubuntu 11.04, icc (ICC) 12.0.3 20110309: catastrophic error: cannot open source file "asm/errno.h

Ubuntu 11.04, icc (ICC) 12.0.3 20110309: catastrophic error: cannot open source file "asm/errno.h

I just updated my Linux machine from Ubuntu 10.10 where icc 12.0.3 20110309 worked fine to 11.04. I am getting this error:

/usr/include/linux/errno.h(4): catastrophic error: cannot open source file "asm/errno.h"

Does anyone have an idea as to how to fix this?

23 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

The kernel sources may help. Please install them and then try compiling.

Sadly, it does not... Unless I missed something on how Ubuntu packages things and I need one of the obscure headers?

$ aptitude search linux-headers
v linux-headers -
v linux-headers-2.6 -
i linux-headers-2.6.38-8 - Header files related to Linux kernel version 2.6.38
i A linux-headers-2.6.38-8-generic - Linux kernel headers for version 2.6.38 on x86/x86_64
i linux-headers-2.6.38-8-server - Linux kernel headers for version 2.6.38 on x86_64
i linux-headers-2.6.38-8-virtual - Linux kernel headers for version 2.6.38 on x86/x86_64
i linux-headers-generic - Generic Linux kernel headers
v linux-headers-lbm -
v linux-headers-lbm-2.6 -
p linux-headers-lbm-2.6.38-8-generic - Header files related to linux-backports-modules version 2.6.38
p linux-headers-lbm-2.6.38-8-server - Header files related to linux-backports-modules version 2.6.38
p linux-headers-server - Linux kernel headers on Server Equipment.
p linux-headers-virtual - Linux kernel headers for virtual machines

Hi YannGolanski,

why due this ?
#include "asm/errno.h"

i have following include in my source and can compile with the icc 12.03 under openSUSE 12.1 64 Bit witout any errormessage

my include #include

no other and it can compile without problems


Retry search with the number of your kernel that you see in folder /lib/modules
you have (kbuild) and other sources package associated your kernel, the word headers is not complete reference.
also maybe, install kernel source package, better I think.


Here is a simple test case to show the bug and a solution!!! Still, there is either something very wrong with the asm set of headers in Ubuntu 11.04 or in the way ICC expect to find them.

EDIT: The kernel source oackage does not help at all. I get the same error.

A more elegant solution/explanation is still needed.

$ cat bug.cc

int main (int argc, char ** argv)
  return 0;
$ icc bug.cc
/usr/include/linux/errno.h(4): catastrophic error: cannot open source file "asm/errno.h"

compilation aborted for bug.cc (code 4)
$ icc --version
icc (ICC) 12.0.3 20110309
Copyright (C) 1985-2011 Intel Corporation.  All rights reserved.
$ cat /usr/include/linux/errno.h
#ifndef _LINUX_ERRNO_H
#define _LINUX_ERRNO_H


$ icc -I/usr/include/x86_64-linux-gnu/asm bug.cc

$ ./a.out
$ echo $?

> A more elegant solution/explanation is still needed.

That will have to come from the Linux distro vendor -- Ubuntu or its parent, Debian.

An alternative solution that does not involve changing system header files such as errno.h: create the subdirectory /usr/include/asm, then do (in a login with appropriate write privileges)

touch /usr/include/asm/errno.h

That will create an empty file. Since you are able to compile without including the file, things should work fine when an empty file is included.

In DEBIAN squeeze 6 (64)
(/usr/asm/errno.h ) contain only 1 line:


verify that you have repertory /usr/include/asm-generic with errno.h and others files headers,
more prudent that an blank file

Alas, mecej4's suggestion is wrong and would not work. /usr/include/asm already exists on Ubuntu 11.04.

This issue arises in part because /usr/include/asm was changed from a real directory on 10.10 to a symlink on 11.04. The symlink now points to an architecture-specific directory; on my 64-bit system, it points to x86_64-linux-gnu/asm.

But the bottom line is that any compiler that can resolve symbolic links should be able to find any file formerly in /usr/include/asm, whether asm is a directory or a symlink to another place. In fact, on 11.04, resolves just fine after several symlink redirections to the real file /usr/include/asm-generic/errno.h.

GCC finds the redirected file just fine. Can ICC really not find it?

int main()
    printf("nECHRNG's number is %d.nn", ECHRNG);
    return 0;

icc ought to try the include search paths set up by the active g++ -print-search-dirs. If you have a different g++ on PATH, all bets are off.

Is strange ...
include or with ICC 12.0.2 (64 version) work perfectly Linux debian Squeeze 6
I have only GNU compiler 4.6.0 is added are not origin distribution
Probably bug in 12.0.3

Web search revealed that the Ubuntu bug seems to have been noticed recently:

[Bug 778047] [NEW] /usr/include/linux/errno.h refers to non-existentasm/errno.h

You can find a suggested work-around there.

It looks like there might be an dependency problem according to that article that mecej4 posted. However, I wanted to clarify that Ubuntu 11.04 is not an officially supported operating system. For more information see the Release Notes at http://software.intel.com/en-us/articles/intel-c-composer-xe-2011-release-notes/

The link given by mecej4 also reports a problem with *intel* compiler, gcc works fine.
There is another strange thing, when I try to use -E flag, i.e. icc -E bug.cc the preprocessors works ok and the resuting file can be compiled with icc. Is it normal?

Thank you.

That is an interesting finding. My (uneducated) guess is that there may be a problem with following symlinked directories or including a symlinked header file during the preprocessing phase. If the -E flag causes a different preprocessor to be used that does not share these disabilities, your findings would be explained.

Although Intel disclaims support for for Ubuntu, these clues should not take too much effort to follow up.

Best Reply

The short answer is: install the package gcc-multilib on Ubuntu 11.04. This will set up symbolic links that will restore /usr/include/linux/* to the same workable state it was in for 10.10.

Intel reps point out that (1) Ubuntu 11.04 is not a supported distro for the Intel compilers, and (2) the release notes do say that "If developing on an Intel 64 architecture system, some Linux distributions may require ... gcc-multilib" (among other packages).


I know that ICC is not supported on 11.04. I was asking for help and reporting a bug that should help in making ICC portable to 11.04. :)

Installing gcc-multilib did solve the problem but now I am hitting the gcc 4.5.0 bug as described in http://software.intel.com/en-us/forums/showthread.php?t=74691 which should be fixed by 12 but it not on my system.

/usr/include/c++/4.5/iomanip(64): error: expected an expression
    { return { __mask }; }

Is the error I am now getting.

If you read to the end of the threads on this gcc 4.5 problem, you will see that icpc -std=c++0x is required for acceptance of the which uses c++0x syntax.

@TimP: Well, that was an amazing fail for me... ;>


Hi Yann,Hope you got the solution beforehand. If not try to follow the instruction. I have lenovo z560, with ubuntu 11.04. & I had the same problem as you which i resolved it in the following way:Since the problem is arising because of the invalid link given in /usr/include/linux/errno.h (i.e. #include , where this asm dir. is not located in /usr/include but in some wrong place, /usr/include/x86_64-linux-gnu, inside that errno.h is sitting; which again redirects to the /usr/include/asm-generic. So all you need to make a symbolic link of the main dir. holding errno.h, to the specified directory. Ok?) ;You need to create a shortcut link to /usr/include by the following way:

sudo ln -s /usr/include/asm-generic /usr/include/asm

So, do it. and hopefully you are out of the trouble.

I'm on Ubuntu 11.04 and icc 12.

All I had to do was make a symbolic link:

cd /usr/include
sudo ln -s ./asm-generic/ ./asm

Works great for me!

We are working on this (although currently 12.0 doesn't support Ubuntu 11.04, so the fix will likely only be in a future version). That being said, if you install the gcc-multilib package which is not installed by default, I believe this problem should go away. Let me know if it doesn't.

@Brandon Hewitt: Yes, installing it works like a charm. I have been able to use it no problems. Thanks for the time in reading the thread. Could I ask you a favour and make sure that this information is in the FAQ or/and release notes? Thanks.

Leave a Comment

Please sign in to add a comment. Not a member? Join today