This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Fedora-packaging] fortran .mod files


Ed Hill wrote:
> https://www.redhat.com/archives/fedora-packaging/2007-October/msg00006.html
> And, here is a concrete example:
>
>   0) netcdf provides a netcdf.mod file
>   1) the mod file provided for i386 is (aha!) not identical to
>      the one provided for x86_64 (and for ppc/ppc64)
>   2) we'd like to be able to simultaneously install both 
>      the i386 and x86_64 versions (and ditto for ppc/ppc64)
>   3) where, in your opinion, is the "best" or "standard" place to 
>      put the netcdf.mod files?
>   
.mod files are in a way like C's .h file: They store the interface of
procedures (functions). However, they are generated from a source code
file which contains a module (= collection of procedures, type
("struct") declarations and module variables).

As they are generated from a source file, their content may differ
depending on the preprocessor flags and processor-defined variable (e.g.
size of a pointer on 32 bit or 64 bit systems).

As C's include files, -Idir can be used to add more directories to the
.mod (and "include" and the preprocessor's "#include") path.

Thus the natural place would be, e.g., /usr/include/netcdf.mod (where it
is on my openSUSE system).

However, as noted, this makes problems on systems where both a 32bit and
64bit version has to be provided.

I have frankly no idea how to solve this. You could put the files into
different directories, but then the user has to specify the path which
is rather inconvenient. One could also put the default file (the one
generated without specifiying e.g. -m32 or -m64) into /usr/include and
put the other version somewhere else. Or ...

Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]