See https://bugzilla.redhat.com/show_bug.cgi?id=660035 for the spark for this.
Apparently there is a "GFORTRAN module version" number assigned to Fortran modules created by gfortran:
==> /usr/lib/gfortran/modules/hdf5.mod <== GFORTRAN module version '4' created from ../../../fortran/src/HDF5.f90 on Thu Oct 28 14:43:23 2010
==> /usr/lib/gfortran/modules/netcdf.mod <== GFORTRAN module version '0' created from netcdf4.f90 on Mon Apr 19 20:30:19 2010
Now, apparently from gcc 4.4.3 -> 4.5.1 this changed from 0 to 4, and apparently there is no backwards compatibility:
Fatal Error: Wrong module version '0' (expected '4') for file 'netcdf.mod' opened at (1)
So, it makes sense to me to encode this into the rpm dependencies somehow. Perhaps gcc-gfortran can provides a gfortran-abi(VERSION) and the gfortran module packages can require it. rpm would need to automatically generate the requires though.
Thoughts? Suggestions?
On Mon, 06 Dec 2010 10:22:47 -0700 Orion Poplawski orion@cora.nwra.com wrote:
Apparently there is a "GFORTRAN module version" number assigned to Fortran modules created by gfortran:
Yes, see section "Modules and include files" in
http://fedoraproject.org/wiki/Packaging:Fortran
So, it makes sense to me to encode this into the rpm dependencies somehow. Perhaps gcc-gfortran can provides a gfortran-abi(VERSION) and the gfortran module packages can require it. rpm would need to automatically generate the requires though.
Thoughts? Suggestions?
Yes, this would be a nice thing to have, it would reveal instantly whenever people have forgot to (mass)rebuild Fortran packages.
On 12/06/2010 07:37 PM, Jussi Lehtola wrote:
On Mon, 06 Dec 2010 10:22:47 -0700 Orion Poplawskiorion@cora.nwra.com wrote:
Apparently there is a "GFORTRAN module version" number assigned to Fortran modules created by gfortran:
Yes, see section "Modules and include files" in
http://fedoraproject.org/wiki/Packaging:Fortran
So, it makes sense to me to encode this into the rpm dependencies somehow. Perhaps gcc-gfortran can provides a gfortran-abi(VERSION) and the gfortran module packages can require it. rpm would need to automatically generate the requires though.
Thoughts? Suggestions?
Yes, this would be a nice thing to have, it would reveal instantly whenever people have forgot to (mass)rebuild Fortran packages.
Returning this oldish issue now that there's something that can reasonably be done about it...
With rpm >= 4.9.0 packages can drop in their own dependency extractors without having to patch rpm itself. I'm not at all familiar with fortran peculiarities (all the more reason for having this outside rpm), but I'll outline the basic idea that should get you started based on the above.
To add a dependency generator, you need to drop a rule file into %{_rpmconfigdir}/fileattrs/. The rule would probably be something like this (classify *.mod files in %{_libdir}/gfortran/modules/ as gfortran):
/usr/lib/rpm/fileattrs/gfortran.attr: %__gfortran_requires %{_rpmconfigdir}/gfortran.req %__gfortran_path ^%{_libdir}/gfortran/modules/.*.mod$
Then you'll need to come up with the actual generator script (gfortran.req in the above example) that parses the .mod and emits the dependencies. At it's simplest it might be something like this, although for a real world version you'd want to do extra sanity checking, remove quotes etc:
---- #!/bin/sh
while read FNAME; do head -1 $FNAME | awk '{print "gfortran(abi) = "$4}' done ----
And finally something needs to create the matching provide, whether it's possible/sensible to create with a automated rule like the above or better to just manual use "Provides: gfortran(abi) = <something>" in gfortran spec depends on the details of which I've no clue :) These rules + scripts should go a package that's always present when building gfortran modules, in this case gcc-gfortran sounds like a fairly obvious choice.
- Panu -
packaging@lists.fedoraproject.org