- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Intel Experts,
I describe here an issue relative to control on math lib to be used by an application under Linux.
Situation:
1. When a compiled fortran code is executed, the computation time is T
2. When this same fortran code is transformed as a dynamic lib of a C++ application, the execution is 5*T.
It was identified that cos() calls in the fortran code were responsible for that performance downgrade:
in configuration 1, it is cos() of lib libimf.so that is called.
In configuration 2, is is cos() of lib libm.so.6 that is called
How to keep control on Library to be used in configuration 2? I make you note that there is neither #include <cmath> nor #include <mathimf> in the C++ code.
Thanks for your help
Best regards,
Gael Couturier
ESI-Group
- Tags:
- CC++
- Development Tools
- Intel® C++ Compiler
- Intel® Parallel Studio XE
- Intel® System Studio
- Optimization
- Parallel Computing
- Vectorization
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you prevent icc from linking its own library or force linking Linux math library before Intel libraries I suppose this may happen. One way to make this happen might be a premature superfluous -lm in the link command. Did you try verbose options such as icc -# or gcc -v to see the final library search order?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Tim,
thanks for your pinpoints, it help. Yes, -lm is there in Makefile generated by CMake under linux probably because of a #include <cmath> in the C++ code..... this might (?) affect the linking order for fortran code as that code is a plugin of C++ code (so linked against it). One workaround: we enforced C++ code to link against intel math lib.
BR
Gael.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, #include has no influence on link order, nor does it add -lm in your link step. Glad you corrected your problem.

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