Re: OpenMPI Fortran: 'Error reading module mpi' and unexpected but silent termination



In article <FZZVi.183090$2D1.8873131@xxxxxxxxxxxxxxxxxxxxx>,
Bart Vandewoestyne <MyFirstName.MyLastName@xxxxxxxxxx> writes:
On 2007-10-30, Steven G. Kargl <kargl@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

[...]
Yes. This could be the problem. Gfortran 4.3.0 20071002 will
write an MD5 value for the module in the first two lines, and
your mpi.mod is missing the MD5 signature.

OK. We have downgraded our gfortran compiler. We are now using
the packages of our Kubuntu installation (7.10 - Gutsy Gibbon) for
both OpenMPI and gfortran:

bartv@kortrijk:~$ dpkg --list | grep openmpi
ii openmpi-bin 1.1-2.3 high performance message passing library
ii openmpi-common 1.1-2.3 high performance message passing library
ii openmpi-dev 1.1-2.3 high performance message passing library
ii openmpi-libs0 1.1-2.3 high performance message passing library

(snip)


I get undefined reference errors when I simply compile with mpif90 without
any additional flags:

bartv@kortrijk:~/mpi_test$ mpif90 test_mpi.f90
/tmp/ccNMqzGg.o: In function `MAIN__':
test_mpi.f90:(.text+0x9c): undefined reference to `mpi_init_'
test_mpi.f90:(.text+0x11e): undefined reference to `mpi_comm_rank_'
test_mpi.f90:(.text+0x210): undefined reference to `mpi_finalize_'
collect2: ld returned 1 exit status

So I therefore add the -fsecond-underscore flag and things seem to compile
fine:

If you need to add this option, then you're going to need to find
out what compiler options were used when the Open MPI package was
created. In particularly, this suggests that the -ff2c option
was used. This option is typically undesirable and only needed
when dealing with g77 compiled libraries that can't be rebuilt
with gfortran. It is also possible that some odd non-default
options were set in CFLAGS, which may affect the ABI.

--
Steve
http://troutmask.apl.washington.edu/~kargl/
.



Relevant Pages

  • Re: gfortran 2007 annual report
    ... On Windows, you probably mean. ... I use gfortran as a native 64 bit ... compiler on GNU/Linux AMD64 now for about 2.5 years. ... but that is pretty common in old fortran source. ...
    (comp.lang.fortran)
  • Re: Gfortran 2006 Year End Status Report
    ... first time gfortran was able to compile the CASTEP ab-initio materials modelling ... Is CASTEP mostly F77 code? ... There's not much use of features in F95 but not F90, ... in this case a compiler I can use. ...
    (comp.lang.fortran)
  • Re: gfortran 2007 annual report
    ... I use gfortran as a native 64 bit ... compiler on GNU/Linux AMD64 now for about 2.5 years. ... I downloaded the latest Cygwin build ... While I'm not trying to disparage an honorable effort, ...
    (comp.lang.fortran)
  • Re: Problem with log function - Intel fortran compiler under Linux
    ... compiler under Linux ... Linux: Red Hat Enterprise Linux, ... Now there are still NaNs appearing, ... I use gfortran to compile the program and that causes ...
    (comp.lang.fortran)
  • Re: fortran 2003 compiler
    ... Fujitsu for Windows are in maintenance mode. ... I would bet against a Lahey/Fujitsu Fortran 2003 compiler on any ... None of the gfortran developers are interested enough in Windows to ... I'd be willing to pitch in some money to pay a developer. ...
    (comp.lang.fortran)