- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
I installed the latest Intel C++ compiler (13.1.1) on my machine running Ubuntu 13.04. Trying to compile the following simple program:
#include <iostream>
int main() {
std::cout << "Hello, world!" << std::endl;
return 0;
}
I get this error:
/usr/include/c++/4.7/iostream(39): catastrophic error: cannot open source file "bits/c++config.h"
#include <bits/c++config.h>
The missing file is located here /usr/include/x86_64-linux-gnu/c++/4.7/bits/c++config.h Compiling with gcc works just fine.
Is this some kind of incompatibility between the OS and the compiler or just the OS fault?
All the best.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Also i just want to know whether have you sourced he compiler script before using the ICC/ICPC compiler? This compiler script is usually located at <Installation_dir>/composer_XE_ver/bin/compilervars.sh ia32/intel64.
Regards,
Sukruth H V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry for the late response.
I have sourced the compiler scripts, as suggested at the end of the installation process.
The compiler line I used are:
GCC: g++ hello_world.cpp -o hello_world.x
ICPC: icpc hello_world.cpp -o hello_world.x
I don't think it's a PATH related issue. In fact, if I compile adding a -I/path/to/header where the bits/c++config.h is the error it's still the same.
I "solved" making a symbolic link to the c++config.h header in the directory where the system is looking up. It's not really a solution but it works for the moment.
Best.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
even with proper including of header file I got this compilation error (fresh Ubuntu 13.04, 3.8.0-26-generic #38-Ubuntu SMP Mon Jun 17 21:43:33 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux), icpc (ICC) 12.1.3 20120212)
icpc helloworld.cpp -I/usr/include/x86_64-linux-gnu/c++/4.7
/usr/include/c++/4.7/ext/atomicity.h(48): error: identifier "__ATOMIC_ACQ_REL" is undefined
{ return __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
^/usr/include/c++/4.7/ext/atomicity.h(48): error: identifier "__atomic_fetch_add" is undefined
{ return __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
^/usr/include/c++/4.7/ext/atomicity.h(52): error: identifier "__ATOMIC_ACQ_REL" is undefined
{ __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
^/usr/include/c++/4.7/ext/atomicity.h(52): error: identifier "__atomic_fetch_add" is undefined
{ __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
^compilation aborted for helloworld.cpp (code 2)
Any help please ?
Miro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The #define symbols such as __ATOMIC_ACQ_REL are automatically predefined if the version of gcc in your environment is 4.7 or greater. You can either modify your environment so that "gcc -v" is 4.7 or greater. Alternately you can use the Intel compiler options -gcc-name and -gxx-name. I personally favor modifying the environment. You can confirm gcc version compatibility by using the Intel compiler option -v--about the first line that's printed shows (gcc version xxx compatibility)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I know it is an unsupported OS version, but has anyone got C++ 13.1 to work on Ubuntu 13.04? Fixing the simple include path problems discussed above seems to just leave one with a set of inconsistent header files, e.g., in which many elements of the STL don't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Could you try to add to command line "-I/usr/include/x86_64-linux-gnu/c++/4.7" for 64-bit system or -I/usr/include/i386-linux-gnu/c++/4.7 for 32 bit system?
BTW, Composer XE 2013 Update 2 introduced new environment variables like below
[bash]
% setenv __INTEL_POST_CFLAGS "-I/usr/include/x86_64-linux-gnu/c++/4.7"
% icc hello.cpp
%
[/bash]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As I said, that fixes the original include path problem but subsequently icpc chokes on many standard header files, as if it does not have some internal macros defined correctly. I'll try to distil some code down to a fragment that reproduces the issues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My bad ... broken template code from repo ... compiler is functioning fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good to see that compiler works in this case.
thanks.
--Vladimir

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page