[MITgcm-support] netcdf, genmake2 and pgi-compiler

Martin Losch mlosch at awi-bremerhaven.de
Wed Dec 22 03:42:31 EST 2004


Hi Ed,

After compiling netcdf libraries on a  64bit system with the pgi 
compiler I made the following observation:
For 1 CPU (without MPI) everything is fine and I can link the libraries.
For more than 1 CPU (with MPI) genmake2 cannot link the netcdf 
libraries and turns off mnc (as it should in this case).  The 
mpif-library is the problem: genmake_warnings says something like
>   pgf77 -o genmake_tnc.o -L/opt/scali/lib64 
> -L/tphs1/user2/mlosch/netcdf_amd64_p
> gi/lib  -lfmpi -lmpi -lnetcdf
> /opt/scali/lib64/libfmpi.so: undefined reference to `mpipriv_'
Now this is stupid of libfmpi.so, because mpipriv is a common block 
defined in mpif.h, so linking fmpi requires include mpif.h, and mpif.h 
is not included in this little genmake_tnc.for that genmake2 generates. 
If I change genmake2 to include mpif.h in genmake_tnc.for, I can link 
the netcdf-libraries and run the mitgcm in parallel with MPI. But of 
course this is only a hack for this particular situation. Can you think 
of a clever way to take this situation into account in genmake2?

Martin




More information about the MITgcm-support mailing list