Fortran 77/90 and pkg-config

Matthew West mwest at
Fri Dec 10 11:22:55 PST 2010


Is there a preferred style for providing compile and link flags for Fortran (F77 and F90) from pkg-config files?

I'm trying to fix up the netcdf package on current Fedora, and it's not clear to me how this is supposed to work. The two styles I've seen are:

1. Have just one .pc file, and have variables in it for fflags, flibs, etc, so that a user can do "pkg-config --variable=fflags netcdf" to get the compile flags, for example. The netcdf.pc file does this at present. If this is the preferred method, is there any standardization on the names of these variables? Note that Fortran 77 and Fortran 90 might require different compile flags (e.g., on Fedora, F77 and F90 have different include directories).

2. Have separate .pc files for each language, as for plplot and openmpi, for example. In this case there is plplot.pc, plplot-f77.pc, plplot-f95.pc, etc, and the user can run "pkg-config --cflags pltplot-f95". Is there any convention for the naming scheme? At present we have plplot-c++.pc versus ompi-cxx.pc, and plplot-f95.pc versus ompi-f90.pc.

Any guidance would be most appreciated.


More information about the pkg-config mailing list