[mpich-discuss] Mac OS X and gfortran: undefined symbols

Alison Boeckmann alisonboeckmann at fastmail.fm
Mon Dec 6 13:44:13 CST 2010


I am having trouble linking MPICH2 with  routines compiled by gfortran
on OS X.
The computer is running OS 10.5.8 (but there are the same problems with
another computer running 10.6.5)

With ifort, I can link to a version of libmpich.a that was build for
Linux.   There is a warning
ld warning: in /c/nm72/mpi/mpi_lini/libmpich.a, file is not of required
architecture
but the run is successfully parallelized.

However, with gfortran, there are messages such as:
Undefined symbols:
  "_mpi_recv_", referenced from:
      _pnm_mpi_recv_ in pnm_mpi.o

Are there any known problems with this platform?
Is there a specific library that is needed instead of libmpich.a?
==========
THe compiler is:
 gfortran -v
Using built-in specs.
Target: i386-apple-darwin8.10.1
Configured with: /tmp/gfortran-20081211/ibin/../gcc/configure
--prefix=/usr/local/gfortran --enable-languages=c,fortran
--with-gmp=/tmp/gfortran-20081211/gfortran_libs --enable-bootstrap
Thread model: posix
gcc version 4.4.0 20081211 (experimental) [trunk revision 142675] (GCC) 


I have tried building MPICH2 (and libmpich.a) 
with many variations:

 with and without 
--enable-sharedlibs=osx-gcc

The routines that call mpi_recv etc. have been compiled with and
without gfortran options  such as
-fno-underscoring

and with and without Interface blocks such as
        SUBROUTINE
        MPI_RECV(IBUFF,N,IDATATYPE,IMODE1,IMODE2,ICOMM,ISTATUS,IERR)
        BIND(c, name='mpi_recv__')
 ! int MPI_Recv(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Status
 *);
      INTEGER IBUFF(*),N,IDATATYPE,IMODE1,IMODE2,ICOMM,ISTATUS(*),IERR
     END SUBROUTINE MPI_RECV

-- 
  Alison Boeckmann
  alisonboeckmann at fastmail.fm



More information about the mpich-discuss mailing list