[petsc-dev] [buildsystem] fortranlib-autodetection

Barry Smith bsmith at mcs.anl.gov
Mon Apr 11 07:33:56 CDT 2011


On Apr 11, 2011, at 1:40 AM, Chen Shen wrote:

> 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
> 

   Shen Chen,

     This is a good suggestion. Do you think you could prepare a (working/tested) patch with your proposed changes? http://www.mcs.anl.gov/petsc/petsc-as/developers/index.html#Sending_patches_to_update_the_

      Generally it is much easier for us to accept a patch then to figure out exactly what change/addition someone is suggesting by email and put them in ourselves.


    Barry




More information about the petsc-dev mailing list