sanity of Fortran COMMONs in shared libs

Jack Howarth howarth@bromo.msbb.uc.edu
Tue Nov 11 05:28:00 GMT 2003


Hello,
    I was wondering if I could get a consensus on the following
question. There is a software package built in Fortran with some
additional c++ and c code modules. The main program is Fortran
and links in two Fortran based shared libs. This program also
uses swig wrappers to be accessed as tcl and python extensions.
    The problem is that while this code builds and runs fine
with gcc 3.3 on Linux, it crashes when built on Darwin's gcc 3.3
with an error...

 %ALLHP-err: BASE < 0.
 Subroutine DIE called . Terminating

Even more interesting, when I build this code under Darwin with
the Fortran libs in question as static rather than shared libs
the program runs fine...however the tcl and python extensions
which use shared lib wrappers linking in the static lib Fortran
code crashes with exactly the same error (which I assume is
related to the same fortran code being forced to run from
within a shared lib).
    Does anyone know what the exact situation is with relation
to Fortran code with COMMON statements and their use in g77
built shared libs. I am greatly puzzled why this same code
builds and works fine under Linux (ppc and i386) yet pukes on
Darwin. Is it just pure chance that this code works on Linux
at all?
                      Jack



More information about the Gcc mailing list