[petsc-dev] [buildsystem] fortranlib-autodetection

Chen Shen hashhsah at gmail.com
Mon Apr 11 01:40:00 CDT 2011


Hi all,

In config/compilers: checkFortranLibraries(), we run the fortran linker with
-v options, and detect the list of fortran libraries to be linked. I can see
that -L -l and -rpath options are parsed, and finally added to the
PCC_LINKER_LIBS macro.

The default behavior of ifort/icc is to link to the static version of the
following libs: imf, svml, ifport, ifcore, etc, so ifort -v will output the
-Bstatic option for these libraries.

However, -Bstatic and -Bdynamic options are ignored in
checkFortranLibraries(). Because -Bdynamic is the default for GCC/ICC, the
dynamic library will be linked to the final application program. It is
therefore impossible to link to the static version of intel libraries.

Currently I ignore PCC_LINKER_LIBS and do my own detection. Fortunately I am
dealing with fewer systems/compilers, and a dirty script sufficed.
But I guess it's best to detect -Bstatic/-Bdynamic
in checkFortranLibraries(). The same comments apply to clib-autodetection.
Do you think this is the way to go? Thanks!


Best regards,
Shen Chen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110411/0451c644/attachment.html>


More information about the petsc-dev mailing list