Intel Compiler 10.1 and LibM Math Library

Discussion in 'C Programming' started by rembremading, Oct 24, 2008.

  1. rembremading

    rembremading Guest

    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
     
    rembremading, Oct 24, 2008
    #1
    1. Advertising

  2. rembremading <> writes:

    > 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.

    --
    Ben.
     
    Ben Bacarisse, Oct 24, 2008
    #2
    1. Advertising

  3. rembremading

    Tim Prince Guest

    rembremading wrote:
    >
    > 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.
     
    Tim Prince, Oct 24, 2008
    #3
  4. rembremading

    rembremading Guest

    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.


    Tim Prince wrote:

    > rembremading wrote:
    >>
    >> 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.
     
    rembremading, Oct 24, 2008
    #4
  5. [Top posting not favoured here -- I've fix it here.]

    rembremading <> writes:
    > Tim Prince wrote:
    >> rembremading wrote:
    >>>
    >>> 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.

    >
    > 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.

    --
    Ben.
     
    Ben Bacarisse, Oct 24, 2008
    #5
  6. rembremading

    Tim Prince Guest

    rembremading wrote:
    > 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.
     
    Tim Prince, Oct 24, 2008
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AciD_X
    Replies:
    4
    Views:
    8,144
    Jonathan Turkanis
    Apr 1, 2004
  2. whatnext
    Replies:
    9
    Views:
    437
  3. Kazik�
    Replies:
    4
    Views:
    1,372
    Jonathan Lee
    Jul 6, 2009
  4. Phrogz
    Replies:
    8
    Views:
    290
    Morton Goldberg
    Feb 8, 2007
  5. VK
    Replies:
    15
    Views:
    1,240
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page