Intel Compiler 10.1 and LibM Math Library

R

rembremading

Hi All,

I want to use intels LibM math library for my c program under Linux with
intel compiler 10.1.
I tried to follow the steps in
http://software.intel.com/en-us/articles/implement-the-libm-math-library
and the Linux compiler reference, respectively.

I added
#pragma function(exp)
on top of my file and ran
icc -fno-builtin exp -L ${HOME}/lib -lm source.c
and got

warning #1879: unimplemented pragma ignored
#pragma function(exp)
^

ld: exp: No such file: No such file or directory

and some more copies of it.
How do I really use LibM with icc 10.1 under Linux?

Thanks a lot,
Andreas
 
B

Ben Bacarisse

rembremading said:
I want to use intels LibM math library for my c program under Linux with
intel compiler 10.1.
I tried to follow the steps in
http://software.intel.com/en-us/articles/implement-the-libm-math-library
and the Linux compiler reference, respectively.

I added
#pragma function(exp)
on top of my file and ran

OK, the document says that this pragma is ignored but it does not hard
to add it.
icc -fno-builtin exp -L ${HOME}/lib -lm source.c

The option is -fno-builtin-exp for the one function called exp or
-fno-builtin to turn all intrinsic functions off.
and got

warning #1879: unimplemented pragma ignored
#pragma function(exp)
^

ld: exp: No such file: No such file or directory

That is the linker no understanding that lone "exp" that should have
been part of the previous option. If it turn out to be more complex
than this, you will have to find a more topical group. I don't know
if the Intel compiler has a news group.
 
T

Tim Prince

rembremading said:
I want to use intels LibM math library for my c program under Linux with
intel compiler 10.1.
I tried to follow the steps in
http://software.intel.com/en-us/articles/implement-the-libm-math-library
and the Linux compiler reference, respectively.
That URL describes a possibly awkward alternative to the Microsoft
32-bit library, with no relevance to linux or to standard C. So it
seems that you haven't followed the advice there, and may not follow any
advice from this list.
 
R

rembremading

In deed, following the advice of Ben, I did not get it working.
While his advice helped to get rid of
ld: exp: No such file: No such file or directory
I still get:
warning #1879: unimplemented pragma ignored
  #pragma function(exp)

As the article states that it comes with the compiler I was concluding
that it should be there in the Linux version as well.
However, though I found a math.h in the ./include dir of the compiler
I cannot find a libmath or something in the ./lib dir.

The -fno-builtin-exp option, at least is the Linux equivalent of /Oi-
and of course I can put "#pragma function(function name)" in the source
code.

Why do you call it awkward? The promise is, that it has double precision
and is faster.
 
B

Ben Bacarisse

[Top posting not favoured here -- I've fix it here.]

rembremading said:
In deed, following the advice of Ben, I did not get it working.
While his advice helped to get rid of
ld: exp: No such file: No such file or directory
I still get:
warning #1879: unimplemented pragma ignored
  #pragma function(exp)

The document you cite states quite clearly that this pragma in not
implemented by the Inter compiler. You will always get that warning
unless you remove the pointless pragma.
As the article states that it comes with the compiler I was concluding
that it should be there in the Linux version as well.
However, though I found a math.h in the ./include dir of the compiler
I cannot find a libmath or something in the ./lib dir.

You now have a plain linker problem. Post in comp.unix.programmer
with a short example and the full command lines that you use.
Comp.lang.c is not the place for debugging linker problems -- they are
far too system specific.
 
T

Tim Prince

rembremading said:
In deed, following the advice of Ben, I did not get it working.
While his advice helped to get rid of
ld: exp: No such file: No such file or directory
I still get:
warning #1879: unimplemented pragma ignored
#pragma function(exp)

As the article states that it comes with the compiler I was concluding
that it should be there in the Linux version as well.
However, though I found a math.h in the ./include dir of the compiler
I cannot find a libmath or something in the ./lib dir.

The -fno-builtin-exp option, at least is the Linux equivalent of /Oi-
and of course I can put "#pragma function(function name)" in the source
code.

Why do you call it awkward? The promise is, that it has double precision
and is faster.
All C compilers include double math support libraries. icc includes its
own short vector math library, which happens by default when the compiler
is able to make the optimizations. The rest, as mentioned before, is
irrelevant to your off-topic question.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top