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

icc warning

newport_j
Beginner
930 Views
I am just atrting out using the Intel compiler on my c code. I use the command when I compile the c code:

gcc -lm [further options} c source code.

It give me the warning


icc: warning #10315: specifying -lm before files may supercede the Intel math libraray and affect performance.


What does this mean. Should this be a concern?

Newport_j
0 Kudos
1 Reply
Brandon_H_Intel
Employee
930 Views
Yes, this could potentially be impactful to performance.

Normally, you shouldn't need to specify -lm at all to the compiler. It will link it in automatically. If you do have to do it explicitly, you should always link in system libraries last in order. In your example above, I believe:

icc {further options} {c source}

should work. And if it doesn't, try:

icc {further options} {c source} -lm
0 Kudos
Reply