Beowulf digest, Vol 1 #1482 - 2 msgs

Wolfgang Dobler Wolfgang.Dobler at
Mon Oct 6 12:50:06 EDT 2003

Hi Ao,

 >   I tried to compile a Fortran 90 MPI program by
 > the Intel Frotran Compiler in the OSCAR cluster.
 >   I run the command:
 >     ifc -I /opt/mpich-1.2.5/include -Lmpi -w -Lm -o p_wg3 p_fdtd3dwg3_pml.f90
 >  The system failed to compile it and gave me the following information:
 >   3228 Lines Compiled
 >   /tmp/ifcVao851.o(.text+0x5a): In function `main':
 >   : undefined reference to `mpi_init_'


 > I wonder
 > 1. why the errors happen?
 > 2. Is the problem of cluster or the Intel compiler?

Looks like the infamous underscore problem. You have a library (
or libmpi.a) that has been built using the GNU F77 compiler without the
option `-fno-second-underscore' and accordingly the MPI symbols are called
`mpi_init__', not `mpi_init_', etc.

But the Intel compiler (and all other non-G77 compilers) expects a symbol
with only one underscore appended ( `mpi_init_'), but that one is not in
the library.

 > 3. How I can solve it.

The way out is to either rebuild the library, compiling with `g77
-fno-second-underscore' or with the Intel compiler, or (the less elegant
choice) to refer to the MPI functions with one underscore in you F90 code:
  call MPI_INIT_(ierr)

There is one related question I want to ask the ld-specialists on the list:

On some machines libraries like MPICH contain all symbol names with both
underscore conventions, i.e. `mpi_init__', and `mpi_init_' at the same
time. Does anybody know whether there are easy ways of building such a
library? Is there something like `symbol aliases' and how would one create
these when generating the library?

W o l f g a n g
Beowulf mailing list, Beowulf at
To change your subscription (digest mode or unsubscribe) visit

More information about the Beowulf mailing list