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

20010920: building Fortran interface using sgif90



Crystal,

>Date: Thu, 20 Sep 2001 11:38:39 -0500 (CDT)
>From: Crystal Shaw <address@hidden>
>Organization: NCSA
>To: address@hidden (Steve Emmerson)
>Subject: Re: f2cFortran (fwd)
>Keywords: 200109201638.f8KGcg105025

The above message contained the following:

> Thanks for helping out here. I am attaching a file with output from A-G.
> Let me know of anything I could try.
...

> Making `all' in directory /home/shaw/netcdf-3.5.0/src/fortran
> 
> make[2]: Entering directory `/home/shaw/netcdf-3.5.0/src/fortran'
> make[2]: *** Warning: File `../libsrc/libnetcdf.a' has modification time in 
> the future (2001-09-20 11:02:32 > 2001-09-20 11:02:15)
> gcc -c -O0 -I../libsrc  -DNDEBUG -Df2cFortran fort-attio.c
> gcc -c -O0 -I../libsrc  -DNDEBUG -Df2cFortran fort-control.c
> gcc -c -O0 -I../libsrc  -DNDEBUG -Df2cFortran fort-dim.c
> gcc -c -O0 -I../libsrc  -DNDEBUG -Df2cFortran fort-genatt.c
> gcc -c -O0 -I../libsrc  -DNDEBUG -Df2cFortran fort-geninq.c
> gcc -c -O0 -I../libsrc  -DNDEBUG -Df2cFortran fort-genvar.c
> gcc -c -O0 -I../libsrc  -DNDEBUG -Df2cFortran fort-lib.c
> gcc -c -O0 -I../libsrc  -DNDEBUG -Df2cFortran fort-misc.c
> gcc -c -O0 -I../libsrc  -DNDEBUG -Df2cFortran fort-v2compat.c
> gcc -c -O0 -I../libsrc  -DNDEBUG -Df2cFortran fort-vario.c
> gcc -c -O0 -I../libsrc  -DNDEBUG -Df2cFortran fort-var1io.c
> gcc -c -O0 -I../libsrc  -DNDEBUG -Df2cFortran fort-varaio.c
> gcc -c -O0 -I../libsrc  -DNDEBUG -Df2cFortran fort-varmio.c
> gcc -c -O0 -I../libsrc  -DNDEBUG -Df2cFortran fort-varsio.c
> 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
> make[2]: warning:  Clock skew detected.  Your build may be incomplete.
> make[2]: Leaving directory `/home/shaw/netcdf-3.5.0/src/fortran'
...

Ignoring the warning message about clock skew, the above build of the
Fortran interface looks OK.

> Making `test' in directory /home/shaw/netcdf-3.5.0/src/nf_test
> 
> make[2]: Entering directory `/home/shaw/netcdf-3.5.0/src/nf_test'
> + gcc -E test_get.F
> + grep -v '^#'
> + sgif90 -c -O0 -o test_get.o test_get-tmp.f
> + rm test_get-tmp.f
> + gcc -E test_put.F
> + grep -v '^#'
> + sgif90 -c -O0 -o test_put.o test_put-tmp.f
> + rm test_put-tmp.f
> + gcc -E nf_error.F
> + grep -v '^#'
> + sgif90 -c -O0 -o nf_error.o nf_error-tmp.f
> + rm nf_error-tmp.f
> + gcc -E nf_test.F
> + grep -v '^#'
> + sgif90 -c -O0 -o nf_test.o nf_test-tmp.f
> + rm nf_test-tmp.f
> + gcc -E test_read.F
> + grep -v '^#'
> + sgif90 -c -O0 -o test_read.o test_read-tmp.f
> + rm test_read-tmp.f
> + gcc -E test_write.F
> + grep -v '^#'
> + sgif90 -c -O0 -o test_write.o test_write-tmp.f
> + rm test_write-tmp.f
> + gcc -E util.F
> + grep -v '^#'
> + sgif90 -c -O0 -o util.o util-tmp.f
> + rm util-tmp.f
> gcc -c -O0   -DNDEBUG -Df2cFortran fortlib.c
> sgif90 -o nf_test -O0  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 
> test_get.o: In function `test_nf_get_var1_text_':
> /home/shaw/netcdf-3.5.0/src/nf_test/test_get-tmp.f:1635: undefined reference 
> to `nf_open_'
> /home/shaw/netcdf-3.5.0/src/nf_test/test_get-tmp.f:1644: undefined reference 
> to `nf_get_var1_text_'
...

The above indicates that the linker wasn't able to locate the netCDF-3 
Fortran routines in the netCDF library.

What sort of Fortran names are in the netCDF library? Do something like
the following:

    $ nm -g libsrc/libnetcdf.a | grep nf_ | head -22

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