- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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????
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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????
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
math.h has no meaning for Fortran. Intel has its own math library which it may use for some functions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, you can't force the compiler to use the Gnu libm, especially if you enable optimization. Why is this important?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.)

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page