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

20040414: netCDF on Linux with NAG fortran



Sandy,

>Date: Wed, 14 Apr 2004 16:43:43 -0400
>From: Sandy Sillman <address@hidden>
>Organization: University of Michigan
>To: Steve Emmerson <address@hidden>
>Subject: netCDF on Linux with NAG fortran
> Keywords: 200404012156.i31LuuCT013274 netCDF 3.5.1

The above message contained the following:

> I may have found a solution to the problem with 'make test' on Linux, which
> I asked you earlier - and which you discussed at the site
> 
> http://www.unidata.ucar.edu/cgi-bin/msgout?/glimpse/netcdf/4475
> 
> I found that the fortran link statement with NAG fortran needs a library
> attached at the end:  -lg2c
> 
> (The libraries must be at the end, after the object files - you probably
> know all about that.)

Excellent!  Thanks for sending this in.

> I  repeated 'make test', after going into the directory nf_test and manually
> adding -lg2c to the Makefile in that directory.  The line became
> 
> nf_test:        $(OBJS) $(lib_netcdf)
>         $(LINK.F) $(OBJS) $(ld_netcdf) $(FLIBS) $(MATHLIB) $(LIBS) -lg2c

The "preferred" way to do this would be

    make distclean
    ... LIBS=-lg2c ./configure ...

> Now I still get error messages, but not a crash - diagnostic messages.
> 
> test.log is pasted here, in text - for your information.
> 
> I hope this is useful.
> 
> Sandy Sillman
> 
> 
> -----------------------------------------------------
>  Sanford Sillman  (Sandy)
> Department of Atmospheric, Oceanic and Space Sciences
> 2455 Hayward Street, Room 1541C SRB
> University of Michigan, Ann Arbor MI 48109-2143 (USA)
> 
> PHONE:  734-763-4217       FAX: 734-936-0503 (best)  or 734-764-4585
> E-MAIL:  address@hidden
> WEB SITE:  http://www-personal.engin.umich.edu/~sillman
> -----------------------------------------------------
> 
> 
> [sillman@ravenclaw netCDF]$ cat test2.log
> test2.c
> with -lg2c added to nf_test Makefile fortran compile. - by hand
> 
> make[1]: Entering directory
> `/home/sillman/cmaq03/lib/netCDF/netcdf-3.5.1/src'
...
> Making `test' in directory
> /home/sillman/cmaq03/lib/netCDF/netcdf-3.5.1/src/nf_test
> 
> make[2]: Entering directory
> `/home/sillman/cmaq03/lib/netCDF/netcdf-3.5.1/src/nf_test'
> /usr/local/bin/f95 -o nf_test -O -I /usr/local/lib/fl90_modules -dusty -w
> 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  -lg2c
> ./nf_test -c
> *** Testing nf_strerror ...
> *** Testing nf_open ...
>  nf_open: No such file or directory
>  nf_redef of read-only file should fail
>  nf_open: No such file or directory
>  nf_close: Not a netCDF id
>   
>    ###  7  FAILURES TESTING nf_open! ###
> *** Testing nf_close ...
>  nf_open: No such file or directory
>  nf_close failed: Not a netCDF id
>  nf_open: No such file or directory
>  nf_close in data mode failed: Not a netCDF id
...

This is bizarre.

Does the same thing happen if you execute a "make clean" in the
"nf_test" subdirectory first?  For example:

    cd nf_test
    make clean
    ...
    make >make.log 2>&1
    make test >test.log 2>&1

Regards,
Steve Emmerson