On Saturday, July 30, 2016 at 11:00:01 AM UTC-7, Bryan Everly wrote:
> When you are distributing a library in C, you supply any necessary header
> files and the compiled library (*.a, *.so, etc.)
In C, object programs are often enough portable to use with a different compiler
on the same system. In the beginning, gcc was used with many Unix systems,
along with the existing libraries, but hopefully with improved optimization.
Since the C I/O system works by direct calls to library functions, it is often
close enough to portable. (Assumes the same calling sequence.)
Fortran I/O calls library routines based on the Fortran I/O statements, and
are pretty much never portable between compilers from different sources,
and not always from different versions of the same compiler.
Calls to generic intrinsic routines also might call different routines.
> In modern Fortran, when you distribute a library do you
> supply the *.mod files for your modules?
> If so, are they binary compatible across platforms?
It would seem that the information that goes into a .MOD file
should be the same for all platforms, but traditionally they
are not portable.
It would be a little easier to distribute, if you could send out one
MOD file, and then separate libraries for each target system.
Also, a text based standardized MOD system would allow for calls
to/from C, with appropriate work in between.