- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to compile a simple C++ 0x program using the icpc 12.1.5 Intel compiler as:
icpc -std=c++0x tt.cc
where, tt.cc :
- //array::at
- #include
- #include
- intmain()
- {
- unsignedinti;
- std::array
myarray; - //assignsomevalues:
- for(i=0;i<10;i++)myarray.at(i)=i+1;
- //printcontent
- std::cout<<"myarraycontains:";
- for(i=0;i<10;i++)
- std::cout<<""<
- std::cout<<:ENDL>
- return0;
- }
tt.cc(3): catastrophic error: cannot open source file "array"
#include
^
Is "array" NOT supported by icpc 12.1 yet ?
thanks
michael
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
looks like you just need to set the correct env, it should then work. the release notes contains some info. below is copied from Release Notes:
The command takes the form:
source
Where argument is either ia32 or intel64 as appropriate for the architecture you are building for.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
looks like you just need to set the correct env, it should then work. the release notes contains some info. below is copied from Release Notes:
The command takes the form:
source
Where argument is either ia32 or intel64 as appropriate for the architecture you are building for.
. /g/software/intelXE/bin/compilervars.sh intel64
I still get
$ icpc -std=c++0x test.cc
test.cc(2): catastrophic error: cannot open source file "array"
#include
^
compilation aborted for test.cc (code 4)
I then checked on my Ubuntu12.04 machine (with GCC 4.6.3 headers) and I get :
$ icpc -std=c++0x tt.cc
Warning #2928: the __GXX_EXPERIMENTAL_CXX0X__ macro is disabled when using GNU version 4.6 with the c++0x option
/usr/include/c++/4.6/bits/c++0x_warning.h(32): catastrophic error: #error directive: This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.
#error This file requires compiler and library support for the upcoming \
^
compilation aborted for tt.cc (code 4)
which makes me tend to think that GCC 4.1.2 may not support
regards
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
$ g++ -std=c++0x tt.cc
Jennifer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
$ g++ -std=c++0x tt.cc
Jennifer
On my RHEL 5.4 host (gnu 4.1.2) unfortunately :
$ g++ -std=gnu++98 test.cctest.cc:2:17: error: array: No such file or directory
test.cc: In function int main():
test.cc:6: error: array was not declared in this scope
test.cc:6: error: expected primary-expression before int
test.cc:6: error: expected `;' before int
test.cc:6: error: p was not declared in this scope
where -std=gnu++98 is the most recent C++ standard it conforms to.
On My Ubuntu 12.4 (GNU 4.6.3)
$ g++ -std=gnu++0x tt.cc
$
no complaints ..
I wish I could avoid it but guess I will have to open an case with support and see what is the official party position on Intel 12.1 vs GCC 4.1.2 vs 0x
thanks for the prompt replies ....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
g++ 4.1 apparently doesn't support the features you want, aside from being obsolete. Most current linux distros have at least an option to install a pre-built g++ 4.4 or newer, or you can build g++ from source. icpc 12.1 generally works with g++ up to 4.6. icpc 13.0 (full release by year end) extends to support of g++ 4.7 (and may work with 4.8).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
$ icpc -std=c++0x test.cc
test.cc(2): catastrophic error: cannot open source file "array"
#include
^
compilation aborted for test.cc (code 4)
...
which makes me tend to think that GCC 4.1.2 may not support
Please take a look atthe message I 'bolded'andit clearly says "cannot open source file...".
Search for 'array' source file on your systems and ifyoudon't find it at some'..\Include' folder(s)it means that C++ compilers
simply don't have it, or don't support it.
Best regards,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the Intel Paraller Studio XE 2013 Beta
no problems, no error message.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will try to see how to make Intel C/C++ use a GCC different from the system one and if there are other untoward consequences.
That was interesting exchange.
mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes I've already used 'find' in the header's directory and I couldn't find it in RHEL 5.4 which is the system in question. I think the overall issue is that GCC 4.1.2 (useds to build current kernel) goes up to c++98 compliance. I will examine posibility of adding newer GCC environment.
take care
mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
mike
- 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
It depends on a version and Mike already confirmed (in one of his later posts )thatGCC 4.1.2 doesn't have it.
Best regards,
Sergey

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