LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Tim Prince (tprince_at_[hidden])
Date: 2007-09-04 09:21:15


harmanda_at_[hidden] wrote:
> Hi all,
>
> I am trying to compile a simple MPI program using Intel Fortran 9.01.45 with
> LAM/MPI but I get "undefined reference" for the MPI commands. The machine is a
> 64bit Opteron cluster. The compilation flags are:
>
> /opt/intel/fce/9.1.045/bin/ifort -I/opt/lam/include -fexceptions -pthread
> -L/opt/lam/lib -llammpio -llamf77mpi -lmpi -llam -lutil -O test_mpi.f
>
> and the error message:
>
> " /tmp/ifort5NlM0x.o(.text+0x34): In function `MAIN__':
> test_mpi.f: undefined reference to `mpi_init_'
> /tmp/ifort5NlM0x.o(.text+0x4a):test_mpi.f: undefined reference to
> `mpi_comm_rank_'
> /tmp/ifort5NlM0x.o(.text+0x60):test_mpi.f: undefined reference to
> `mpi_comm_size_'
> /tmp/ifort5NlM0x.o(.text+0x10b):test_mpi.f: undefined reference to
> `mpi_finalize_' "
The most obvious idea is that you linked against a liblamf77 built with
some other compiler. The normal way to build a lam MPI Fortran
application is by first building mpif77 with the Fortran compiler you
intend to use, then use mpif77 (with the ifort environment variables
set) to perform the compile and link.