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

Ed Hill ed at eh3.com
Sun Dec 26 11:38:42 EST 2004


On Wed, 2004-12-22 at 09:42 +0100, Martin Losch wrote:
> 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?

Hi Martin,

Once again, thanks for the detailed bug reports!

I'm about to check in two small features to genmake2 that allow for:

  1) setting SKIP_NETCDF_CHECK=t in your optfile will 
     skip the NetCDF test-compile

  2) setting SKIP_NETCDF_CHECK=t and HAVE_NETCDF=t will
     turn on NetCDF without the test-compile

  3) if you use the genmake2 -mpi option or if you define
     MPI=true in your optfile, then the NetCDF test compile
     will include the "mpif.h" header

One or more of the above combinations should allow you to either get the
test compile to work or to turn off the test completely (since it is
*just* a convenience!).

Ed

-- 
Edward H. Hill III, PhD
office:  MIT Dept. of EAPS;  Rm 54-1424;  77 Massachusetts Ave.
             Cambridge, MA 02139-4307
emails:  eh3 at mit.edu                ed at eh3.com
URLs:    http://web.mit.edu/eh3/    http://eh3.com/
phone:   617-253-0098
fax:     617-253-4464




More information about the MITgcm-support mailing list