On Jun 27, 2005, at 8:01 PM, Chris Fletcher wrote:
> I am compiling an atmospheric model, with the following set up:
> Fedora Core 3, LAM-7.1.1, Intel C and Fortran compilers v8.1. I've
> used
> mpif77 to get the following to pass to ifort:
> LDFLAGS = -L/usr/local/lib -lnetcdf -L/usr/local/lib -llammpio -
> llamf77mpi -lmpi -lcprts -llam -laio -lutil -ldl
Just curious -- is there any reason you're not using mpif77 itself?
I'm curious what -lnetcdf is -- did you get that from mpif77, or is
that one of your libraries?
Also, I suspect that you do not need the -L/usr/local/lib flags -- your
compiler *might* be adding those in for you automatically already (and
if it is, adding them in yourself might be messing up the directory
search order). Try without the -L's and see if that helps.
> The compilation is failing at the linking stage with the following (a
> sample of many such errors):
> /my/dir/% ifort [.o file list] -o output.x $LDFLAGS
> <...CUT...>
> mpp_util.o(.text+0x17b2): In function `mpp_util_mod_mp_mpp_node_':
> : undefined reference to `mld_id_'
> <...CUT...>
> mpp_io_read.o(.text+0x16e5): In function
> `mpp_io_read_mod_mp_read_record_':
> : undefined reference to `nf_get_vara_double_'
None of these files or symbols belong to LAM/MPI.
> <...CUT...>
> : undefined reference to `pthread_setspecific'
> /usr/local/lib/libmpi.a(malloc.o)(.text+0x363): In function
> `ptmalloc_init':
> <...CUT...>
> /usr/local/lib/liblam.a(lamthreads.o)(.text+0x2b): In function
> `lam_thread_join':
> : undefined reference to `pthread_join'
> <...CUT...>
This implies that you need -lpthread (or -pthread). If LAM was built
with support for pthreads, mpif77 should add this flag for you already.
Did mpif77 show you this flag and you did not add it to LDFLAGS, or
did mpif77 now show this flag?
Unless you really need to *not* use mpif77, I would strongly suggest
using it -- it should make all the LAM-related linking problems
disappear (indeed, that it exactly what it is for).
--
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/
|