[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20020130: Linux NetCDF installation: Fujitsu Fortran compiler



Annarita,

> To: address@hidden
> From: Annarita Mariotti <address@hidden>
> Subject: Problem with NetCDF on Linux Redhat
> Organization: ?
> Keywords: 200201302245.g0UMj8x25601

The above message contained the following:

> I'm attempting to install NetCDF libraries on my Linux Redhat platform
> with a Fujitsu Fortran compiler. Although the 1) configure, the 2)
> make and 3) make install don't report specific problems, at least as
> far as I can tell, I do get some suspicious messages when I do 4)
> make test. What is more disturbing is that when I try to compile and
> run a simple code (/usr/local/netcdf-3.5.0/mytest.f90) calling netcdf
> routines such as:
> 
> INCLUDE 'netcdf.inc'
> status = NF_CREATE ('kk.cdf', NF_WRITE, ncid)
> IF (status.NE.NF_NOERR) STOP 'ERROR in putmatrix during nf_open'
> END
> 
> I get:
> f90 -fw mytest.f90 -I/usr/local/netcdf-3.5.0/include
> -L/usr/local/netcdf-3.5.0/lib -lnetcdf
> mytest.o: In function `SSN2':
> mytest.o(.text+0x30): undefined reference to `nf_create_'

On a Linux system, one usually needs to define the C macro "f2cFortran"
to make the Fortran-callable routines visible. The file INSTALL.html
contains examples of this.

Please try the following:

    1.  Go to the top-level source directory.

    2.  Perform steps 3 through 5 mentioned near the end of the file
        INSTALL.html.

    3.  Ensure that the environment variable CPPFLAGS contains the
        string "-Df2cFortran", e.g.

            export CPPFLAGS="-Df2cFortran"

    4.  Perform steps 6 through 9 mentioned near the end of the file
        INSTALL.html.

Please let me know if this helps.

Regards,
Steve Emmerson   <http://www.unidata.ucar.edu>