Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6977 Discussions

Intel Fortran compiler runtime libraries to be linked with g++

utab
Beginner
451 Views
Dear all,
For my program, I compiled MUMPS with ifort 64 bit integer support, -i8. Now I would like to link to this code however of course without the intel fortran runtime libraries this is not possible, I am a bit lost in the documentation. How can I get a list of the runtime libraries to be linked to g++?
Greetings,
Umut
0 Kudos
3 Replies
TimP
Honored Contributor III
451 Views
The MKL link advisor will describe the libraries required by MKL (select the 64-bit integer and ifort options). If you could use the ifort command to drive the link, that would simplify your task; you should require specification only of the libraries mentioned by link advisor, with the addition of -libstdc++. By adding the -# option to your ifort link step, you will get complete verbose description of the libraries it uses.
You could also go by trial and error, searching down unresolved Fortran run-time library references (by using strings or nm tools in the ifort library directory), if you choose not to link by ifort. Needless to say, the exact libraries involved may change between major versions of ifort.
0 Kudos
utab
Beginner
451 Views
Thanks Tim, where are these mixed language programming issues are explained?

Well, when I do a google search I am jumping in between different pages and could not get what I am looking for, basically I should look at the intel fortran compiler user guide from intel website, right? But pdfs I found online does not point to this issue directly, could you send me the direct link if possible? Maybe I missed the right one...

Indeed ifort with -nofor-main and -i8 solved my problem. However, that would still be good to know the other path as well...

one more point is that using the intel c++ compiler, the problem seems to be the same which is logical...
0 Kudos
TimP
Honored Contributor III
451 Views
I don't remember seeing anything more "in print" than the advice to use ifort if possible to drive the link for mixed language builds. The compiler pdf guides are placed in the documents directory of the compiler installation, as well as (I hope) on line.
Since you apparently needed the -nofor-main option, some of my advice was off target.
As you found, even icc would not search the Fortran-specific run-time libraries, although (in all recent versions) it would have the right paths set and would require only the -l specifications such as -lifcoremt.
0 Kudos
Reply