Re: [netcdfgroup] Problem compiling netcdf4

  • To: Rob Latham <robl@xxxxxxxxxxx>
  • Subject: Re: [netcdfgroup] Problem compiling netcdf4
  • From: Carlos Moffat <raghos@xxxxxxxxx>
  • Date: Wed, 02 Sep 2009 18:00:11 -0400
Rob Latham wrote:
On Wed, Sep 02, 2009 at 05:11:10PM -0400, Carlos Moffat wrote:
Ok, I tried this:

FC=mpif90 CC=mpicc CPPFLAGS="-DpgiFortran" LIBS="-lm -lz -lhdf5" ./configure --enable-netcdf-4 --prefix=/usr/local


and now fails with (so it goes a bit farther):

mpif90 -DHAVE_CONFIG_H -I. -I.. -I../fortran -DpgiFortran -I../fortran -I../libsrc4 -I../f90 -g -c -o ftst_vars.o ftst_vars.F mpif90 -I../fortran -I../libsrc4 -I../f90 -g -c -o handle_err.o handle_err.f /bin/bash ../libtool --tag=F77 --mode=link mpif90 -I../fortran -I../libsrc4 -I../f90 -g -o ftst_vars ftst_vars.o fortlib.o handle_err.o ../libsrc4/libnetcdf.la -lhdf5_hl -lhdf5 -lm -lz -lhdf5 -L/usr/local/bin/mpif90 libtool: link: mpif90 -I../fortran -I../libsrc4 -I../f90 -g -o ftst_vars ftst_vars.o fortlib.o handle_err.o ../libsrc4/.libs/libnetcdf.a -L/usr/local/bin/mpif90 -lhdf5_hl -lm -lz -lhdf5
ftst_vars.o: In function `ftst_vars':
/home/cmoffat/Sandbox/netcdf-4.0.1/nf_test/ftst_vars.F:57: undefined reference to `nf_set_chunk_cache_'

all of your undefined references are fortran symbols with a trailing
underscore.  this is a common yet irritating problem with fortran
compilers.  Unfortunately the easiest way to fix this is to ensure
that you build netcdf4, mpich2, and HDF5 with the same fortran
compiler.
If you do an 'mpif90 -show', do you see 'gfortran' or 'ifort' as the
compiler being used?

The -DpgiFortran looks odd to me but since I rarely build the netcdf4
fortran interfaces, maybe that's just the way to do it.

==rob

I have now recompiled everything again with the same flags and compiler, but the same problem remains.

Can anybody think of something else that might be causing trouble here?

Thanks,
Carlos





  • 2009 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: