Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
26 Views

ifort can`t call pow() of gnu libm

hi everyone 

i have trouble in ifort in Linux, i write a small program with pow function and compiled by ifort with -lm,but when i gdb this program,i find the program use the pow() of liblimf,so why????didn't i make error when i write or compile the program????

 

0 Kudos
6 Replies
Highlighted
Beginner
26 Views

when i use math.h,math.h does not cause the gcc* math library to be linked,but why??????

when i 'ldd' exe,it didnit display any libimf information,,,why????only libm information,but it called pow function of libimf,,why????

0 Kudos
Highlighted
Black Belt Retired Employee
26 Views

math.h has no meaning for Fortran. Intel has its own math library which it may use for some functions.

0 Kudos
Highlighted
Beginner
26 Views

Steve Lionel (Ret.) wrote:

math.h has no meaning for Fortran. Intel has its own math library which it may use for some functions.

thank you steve!

but i wanna know whether i can call gnu libm function when i use ifort or icc compile my program with -lm??

i am anticipating your reply!!!

0 Kudos
Highlighted
Black Belt Retired Employee
26 Views

No, you can't force the compiler to use the Gnu libm, especially if you enable optimization. Why is this important?

0 Kudos
Highlighted
Beginner
26 Views

Steve Lionel (Ret.) wrote:

No, you can't force the compiler to use the Gnu libm, especially if you enable optimization. Why is this important?

oh thank you!

because I am making some test about math library with gnu and intel compiler,so i wanna know this!

So I can't force the compiler to use the GNU libm,but I can't understand why I use 'ldd' to lookup the executable object file compiled by ifort with '-lm',i can`t the the info of libimf!!!but if with ' -limf',ldd show the info about libimf,likethat:aaaa.jpg

 

0 Kudos
Highlighted
Black Belt Retired Employee
26 Views

The compiler uses different variations of math library routines depending on how it is optimizing. Even without optimization, it may use an Intel-supplied version so that it can do automatic CPU dispatching. I don't think the test you're doing is meaningful if it's not how anyone would use the compiler in real life. I don't know enough about the Linux environment to comment on your ldd command (indeed, I had never heard of that before.)

0 Kudos