Re: [netcdfgroup] netCDF gfortran installing compilling undefined reference error

  • To: javier er <javier.reggae@xxxxxxxxx>
  • Subject: Re: [netcdfgroup] netCDF gfortran installing compilling undefined reference error
  • From: Ed Hartnett <ed@xxxxxxxxxxxxxxxx>
  • Date: Tue, 16 Jun 2009 15:15:37 -0600
javier er <javier.reggae@xxxxxxxxx> writes:

> Hello all netCDFgroup,
>
> I am trying to compile and Install the Software Column Radiation Model
> (CRM) for scientific atmospheric applications. I am using UBUNTU 9.04.
>
> Originally the code uses the PGF90 compiler, and I don�t have this
> compiler. I have gfortran 4.4. I am trying to make the translation to
> gfortran.
>
> I am having some troubles when I type� sudo make:
>
> gfortran-4.4 -o ../bin/crm ../obj/crm.o ../obj/netcdf.o ../obj/endrun.o
> ../obj/freemem.o ../obj/getmem.o ../obj/blkdat.o ../obj/resetr.o
> ../obj/orb.o ../obj/albocean.o ../obj/aermix.o ../obj/cldefr.o
> ../obj/cldems.o ../obj/fmrgrid.o ../obj/radabs.o ../obj/radclr.o
> ../obj/radclw.o ../obj/radcsw.o ../obj/radctl.o ../obj/radded.o
> ../obj/radems.o ../obj/radini.o ../obj/radinp.o ../obj/radoz2.o
> ../obj/radtpl.o ../obj/torgrid.o ../obj/trcab.o ../obj/trcabn.o
> ../obj/trcems.o ../obj/trcmix.o ../obj/trcplk.o ../obj/trcpth.o
> ../obj/zenith.o ../obj/intmax.o ../obj/isrchfgt.o ../obj/isrchfle.o
> ../obj/wheneq.o ../obj/whenfgt.o ../obj/whenflt.o ../obj/whenne.o
> -L/usr/lib -lnetcdf
> ../obj/netcdf.o: In function `nc_err_exit__':
> netcdf.F: (.text+0xa2): undefined reference to `nf_strerror__'
> ../obj/netcdf.o: In function `netcdf_':
> netcdf.F: (.text+0x146): undefined reference to `nf_create__'
> netcdf.F: (.text+0x170): undefined reference to `nf_def_dim__'
> netcdf.F: (.text+0x19a): undefined reference to `nf_def_dim__'
> netcdf.F: (.text+0x1d7): undefined reference to `nf_def_var__'
> netcdf.F: (.text+0x214): undefined reference to `nf_def_var__'
> netcdf.F: (.text+0x251): undefined reference to `nf_def_var__'
> netcdf.F: (.text+0x28e): undefined reference to `nf_def_var__'
>

Howdy!

The compiler is telling you that it can't link to the fortran 77 API.

Do I understand correctly that netCDF was compiled with Portland Group
Fortran? And you are now trying to use gfortran?

In that case you must recompile netCDF with gfortran. The library must
be compiled with the same fortran compiler that you are using to compile
your fortran programs.

Let me know if this doesn't help...

Thanks,

Ed

-- 
Ed Hartnett  -- ed@xxxxxxxxxxxxxxxx



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