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

20010618: problem compiling ftest.F from netcdf 3.5.0

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.


  • Subject: 20010618: problem compiling ftest.F from netcdf 3.5.0
  • Date: Mon, 18 Jun 2001 09:10:17 -0600

Falk,

Thanks for sending all the information I needed to diagnose the problem
(you'd be amazed at the number who don't).

The problem is that the C preprocessor wasn't given the necessary option
that tells it which Fortran-calling-C convention to use (see the Linux
examples in the file INSTALL.html).

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

        or

            setenv CPPFLAGS -Df2cFortran

        depending on your shell.

    4.  Ensure that the environment variable FFLAGS contains the
        string "-Wno-globals" (this will eliminate the warning messages
        that your Fortran compiler previously emitted).

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

Please let me know if this helps.

And, yes, we have though of using the full suite of GNU configuration
tools.  At the time we created the netCDF package, the tools were
insufficient to the task. Enhancing the installation procedure for the
netCDF package is now a low priority item.

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

> >From: Falk Feddersen <address@hidden>
> >Subject: problem compiling ftest.F from netcdf 3.5.0
> >Organization: MIT/Woods Hole
> >Keywords: 200106171756.f5HHupp21567 netCDF Linux automake libtool

> I've tried installing netcdf-3.5.0 on my linux box.   There
> is a problem when I do "make test", it hangs on compiling
> the program "ftest.F".    I took a look at it and it says up
> front that the program is to test the fortran interface to netcdf 2,
> so that may be a problem.   An aside:  have you guys thought
> about setting up the netcdf library so that it uses the full
> GNU configuration tools, that is also automake and libtool?
> It might make installation easier and will allow for shared
> library creation.   Thanks a lot,
> Falk
...

> Linux hull 2.2.16-22smp #1 SMP Tue Aug 22 16:39:21 EDT 2000 i686 unknown
...

> Making `all' in directory /home/falk/netcdf-3.5.0/src/fortran
> 
> make[2]: Entering directory `/home/falk/netcdf-3.5.0/src/fortran'
> cc -c -I/usr/local/include -I../libsrc  -DNDEBUG fort-attio.c
...

> Making `test' in directory /home/falk/netcdf-3.5.0/src/fortran
> 
> make[2]: Entering directory `/home/falk/netcdf-3.5.0/src/fortran'
> + f77 -c ftest.F
> ftest.F: In subroutine `tncacpy':
> ftest.F:187: warning:
>                call ncagt (outcdf, NCBYTE, attnam, bytval, iret)
>                     1
> ftest.F:196: (continued):
>                call ncagt (outcdf, NCGLOBAL, attnam, shval, iret) 
>                     2
> Argument #4 of `ncagt' is one precision at (2) but is some other precision at 
> (1) [info -f g77 M GLOBALS]
...

> ar cru ../libsrc/libnetcdf.a fort-attio.o fort-control.o fort-dim.o 
> fort-genatt.o fort-geninq.o fort-genvar.o fort-lib.o fort-misc.o 
> fort-v2compat.o fort-vario.o fort-var1io.o fort-varaio.o fort-varmio.o 
> fort-varsio.o
> ranlib ../libsrc/libnetcdf.a
> f77 -o ftest   ftest.o ../libsrc/libnetcdf.a 
> ftest.o: In function `MAIN__':
> ftest.o(.text+0x15): undefined reference to `ncpopt_'
...