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

20020208: compiling netCDF on Linux with ifc f95 compiler



Matt,

> Date:    Fri, 08 Feb 2002 10:58:01 -0800
> From:    Matt Brennan <address@hidden>
> To:      Russ Rew <address@hidden>
> cc:      <address@hidden>
> Subject: Re: compiling netCDF on Linux with ifc f95 compiler

The above message contained the following:

...
> However, I think there may be a problem with one aspect of nf_test.F, a
> part of the netCDF test suite. After successfully running the nctest and
> the fortran/ftest.F, the netCDF test suite has problems with the nf_test.F
> 
> The relevant excerptfrom test.log is:
> 
> f77 -o nf_test   test_get.o test_put.o nf_error.o nf_test.o test_read.o
> test_write.o util.o fortlib.o ../libsrc/libnetcdf.a  -lm
> nf_test.o: In function `main':
> nf_test.o(.text+0x32a): undefined reference to `getarg_'
> nf_test.o(.text+0x34c): undefined reference to `iargc_'
> nf_test.o(.text+0x380): undefined reference to `getarg_'
> nf_test.o(.text+0x11d7): undefined reference to `getarg_'

The Fortran function iargc() and subroutine getarg() are the standard
way for a Fortran program to obtain command-line arguments on a UNIX
system. Unfortunately, not all systems support these routines.  It
appears that IFC Fortran-95 is one such system.

You might try a brute-force approach to find these routines. The
following works on my system (SunOS 5.8/SPARC):

    $ nm -A -g /usr/lib/lib* /opt/SUNWspro/lib/lib* | grep -i getarg

From the output of this command, I can tell that I need to reference
the Fortran library "/opt/SUNWspro/lib/libF77.so" in order to resolve
the symbols. This can be done manually by ensuring that the environment
variable FLIBS is appropriately set before executing the configure
script. For example:

    $ FLIBS='-L/opt/SUNWspro/lib -lF77' ./configure >configure.log 2>&1

> ...  Could you look at the use of these two variables/subroutines
> in nf_test.F and let me know if you think they are being implemented
> correctly?

The two routines are correct. On appropriate systems, the getarg()
routine is implemented as a wrapper around the CRAY PXFGETARG routine.
The function iargc() is always correctly declared as an integer.

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