Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

Compillation error with intel compiler

smithakolli
Beginner
634 Views
hi,
When I compiled my code( c and C++) with g++ there is no problem. But when I compiled with Intel compiler using icc I'm getting the below error.

(I used Intel compiler to implenment OpenMP, as GCC will not support OpenMP.)

My program uses STL, so initialling I thought it is because of STL, as it does not support all compilers. So I installed STLport for Intel compiler. But the error persist.
[kolli@ariadne multi]$ make
icc -openmp -c renamemulti.C
/opt/intel/compiler70/ia32/include/xhash(126): error: call of an object of a class type without appropriate operator() or conversion functions to pointer-to-function type
return (!_Keyeqobj(_Keyval1, _Keyval2));
^
detected during:
instantiation of "bool std::_Hash_compare<_Kty, _Keyeq>::operator()(const _Kty &, const _Kty &) const [with _Kty=int, _Keyeq=std::allocator<:PAIR>>]" at line 327
instantiation of "std::_Hash<_Tr>::_Pairib std::_Hash<_Tr>::insert(const std::_Hash<_Tr>::value_type &) [with _Tr=std::_Hmap_traits>>, std::allocator, false>]" at line 346 of "/opt/intel/compiler70/ia32/include/hash_map"
instantiation of "std::hash_map<_Kty, _Ty, std::hash<_Kty>, _Keyeq>::mapped_type &std::hash_map<_Kty, _Ty, std::hash<_Kty>, _Keyeq>::operator[](const std::hash_map<_Kty, _Ty, std::hash<_Kty>, _Keyeq>::key_type &) [with _Kty=int, _Ty=int, _Keyeq=std::allocator<:PAIR>>]"
compilation aborted for renamemulti.C (code 2)
make: *** [renamemulti.o] Error 2
[kolli@ariadne multi]$
Please do reply
Thank you.
0 Kudos
7 Replies
Maximillia_D_Intel
634 Views

Dear Vijaya,

First thing to do is to rule out OpenMP. You should be able to compile without openmp; you'll get a number of 'unrecognized pragma' warnings, but you should be o.k.

Afterwards, I'd try and cut down the testcase using a tool such as icpi (part of the Intel compiler distribution). Once you do that and verify that gcc still compiles, you should have something that you can submit to premier support. It may also be the case that your code is not 100% legit. Having a small testcase can help in the determination.

Regards,

Max

0 Kudos
smithakolli
Beginner
634 Views
hello,
This is the place in my code where I'm getting error,
hash_map< int, int, hash > beenseen1;//True if the value has been seen.
hash_map< int, int, hash > beenseen2;//True if the value has been seen.
hash_map< int, int, hash > doremap; //True if the value has been seen.

When I used icpi instead of icc
[kolli@ariadne multi]$ make
icpi -c renamemulti.C
icpi on Linux-IA32: 2.0.0.3
Compilation Problem Isolator build 1.0_11052001_3
Build date stamp: 17:29:59 Feb 26 2002
ICPI main file: CRMain.cpp
Compiler Path is: icc
Logfile Path is: renamemulti.C.cpi.log
ERRORFILE NAME: renamemulti.C.cpi.err
Matching Criteria from default strings
StringArray Contents
--------------------
|: error|
|internal error :|
|internal error:|
|Illegal READ|
|Illegal WRITE|
|compiler error:|
|Compiler error:|
|: catastrophic error:|
|Catastrophic error:|
|FATAL ERROR : Compiler Internal Error|
10 Strings Total
Error found and isolated
icpi -o treeinput renamemulti.o med.o Ograph.o Pair.o CompInfo.o Cycle.o Component.o ins-selection.o gencov.o SortSeq.o multiMED.o perfEval.C -lm
icpi on Linux-IA32: 2.0.0.3
Compilation Problem Isolator build 1.0_11052001_3
Build date stamp: 17:29:59 Feb 26 2002
ICPI main file: CRMain.cpp
Compiler Path is: icc
Logfile Path is: -lm.cpi.log
ERRORFILE NAME: -lm.cpi.err
Matching Criteria from default strings
StringArray Contents
--------------------
|: error|
|internal error :|
|internal error:|
|Illegal READ|
|Illegal WRITE|
|compiler error:|
|Compiler error:|
|: catastrophic error:|
|Catastrophic error:|
|FATAL ERROR : Compiler Internal Error|
10 Strings Total
ERROR: Cannot open input file -lm
ERROR: Something strange happened
ERROR: Cannot open input file -lm
ERROR: Something strange happened
*************************************
TOTAL TIME FOR EVERYTHING: 0:0:0
*************************************
***********************************
FileOrg Compiler Time in seconds: 0
***********************************
Error found and isolated
When I opened the renamemulti.C.cpi.err these are the error messages.

renamemulti.fut.C(3): error: type name is not allowed
hash_map< int, int, hash > beenseen1;

^
renamemulti.fut.C(3): error: type name is not allowed
hash_map< int, int, hash > beenseen1;
^
renamemulti.fut.C(3): error: identifier "hash" is undefined
hash_map< int, int, hash > beenseen1;
^
renamemulti.fut.C(3): error: type name is not allowed
hash_map< int, int, hash > beenseen1;
^
renamemulti.fut.C(3): error: expected an expression
hash_map< int, int, hash > beenseen1;
^

renamemulti.fut.C(4): error: type name is not allowed
hash_map< int, int, hash > doremap;
^

renamemulti.fut.C(4): error: type name is not allowed
hash_map< int, int, hash > doremap;
^

renamemulti.fut.C(4): error: type name is not allowed
hash_map< int, int, hash > doremap;
^

renamemulti.fut.C(4): error: expected an expression
hash_map< int, int, hash > doremap;
renamemulti.fut.C(4): error: expected an expression
hash_map< int, int, hash > doremap;
^

renamemulti.fut.C(7): error: identifier "beenseen1" is undefined
if(beenseen1[abs(s1)])
^

renamemulti.fut.C(7): error: identifier "abs" is undefined
if(beenseen1[abs(s1)])
^

renamemulti.fut.C(8): error: identifier "doremap" is undefined
doremap[abs(s1)] = 1;
^

compilation aborted for renamemulti.fut.C (code 2)
------------- ******* --------------------
Compiler failed for this file.
Actually the author of the code is different, I borrowed to Parallelize it using OpenMp and PThreads.
Isthe problem with my Intel compiler which is Version 7.1??
Can you please help me to figure out the error.
Thanks for your time.
Vijaya
0 Kudos
Maximillia_D_Intel
634 Views

Dear Vijaya,

icpi is a tool that helps prune down your testcase into a smaller sized file.I'm not sure you used the tool correctly.Can you browse the documentation and let me know if you have questions?

Best regards,

Max

0 Kudos
smithakolli
Beginner
634 Views
Dear Max,
I used icpi andoutput file with extension .tsfis created. It contained thepiece of code where I'mgetting error. I'm attaching the newlycreated file with this reply. It contains both the content of .tsf file and .err file.
This is a showstopper problem for me.
My Intel compiler version is 7.1 and GCC version is 3.2
Thanks for you time
With Regards
0 Kudos
Maximillia_D_Intel
634 Views

Dear Vijaya,

Can you file a premier support issue on it? That is the fastest way to get the most qualified people looking at your problem.

Best regards,

Max

0 Kudos
smithakolli
Beginner
634 Views
Dear Max,

Right now I'm using my college servers, to work on Linux, but I have userid and password for premier support for Windows version(as I recently downloaded 30day evaluation version). Can I use that to post the question.
Do I have to describe the whole problem to the premier support and attach the code.

Thank you
0 Kudos
Maximillia_D_Intel
634 Views

Dear Vijaya,

It is important that the testcase you submit reproduce your original error. To do so, I would suggest removing the #include from the .C file. In addition, you probably need a

#include

using namespace std;

at the top of the file. So, before submitting to Premier, make sure your small testcase reproduces the problem you are interested in.

Regards,

Max

0 Kudos
Reply