I'm compiling a source using icpc and I get this warning.
icpc: warning #10314: specifying -lm before object files may supercede the Intel(R) math library and affect performance
is it important?
This indicates that you must permit linking of the icc libraries,i think removing -lm help as the earlier diagnostic suggests.
Thank you.--QIAOMIN.QIntel Developer Support
Please participate in our redesigned community support web site:Tools Knowledge Base: http://software.intel.com/en-us/articles/tools
>>icpc: warning #10314: specifying -lm before object files may supercede the Intel(R) math library and affect performance
>>is it important?
Yes and it can be easily verified if you have a simple test case with some floating point calculations.
OK, so as I'm compiling a big library I have to contact the developer and ask to fix it. However not sure what message actually mean. Does it simply mean like below?
1- right now doing: icpc -lm *.o -o a.out
and should change it to?
2- icpc *.o -lm -o a.out
another issue I found during search was that it is recommended to add -limf as well to avoid some liknig errors. here
so the final correct command would be:
icpc *.o -lm -limf -o a.out
Am I right?
icpc will cause ld to search the math libraries anyway, at the proper point in the sequence, so I think -lm is redundant. If you want to see the details, add -# to your icpc command.
In general, the message would be correct in that a library search prior to traversing your .o files would be ineffective. "linux is not windows," gnu ld doesn't act like Microsoft link.exe. If you did want to specify libimf, you would omit -lm and use -limf as you showed. icpc would still use system libraries to resolve libmath references not taken care of by libimf.
Thanks for explanations. However how should I fix this warning?