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

971107: installing NetCDF 3.3.1 under Linux using NAG f90



Alec,

>Date: Fri, 7 Nov 1997 08:16:41 +0200 (SAT) 
>From: Alec Joubert <address@hidden>
>Organization: University of the Witwatersrand/Climatology Research Group
>To: Steve Emmerson <address@hidden>
>Subject: Re: 971107: installing NetCDF 3.3.1 under Linux using NAG f90
>Keywords: 199711051121.EAA12731

In the above message, you wrote:

> Dear Steve
> 
> Thanks for the help.
> 
> 1. I do have the g77-0.5.19 source code, and could install it. The
> compiler I'd prefer to use, though, is the f90 compiler, so I've
> persevered with it for a bit.

Ok.

> 
> Question: If I compile the netcdf source with g77, will it be possible to
> compile my own code later (which will use netcdf) using f90?

It *should* be possible to mix g77-compiled code with f90-compiled code.
If it isn't, then one or the other compiler writer deserves to be shot.

> 2. I was using "make clean" and not "make distclean".
> 
> 3. I followed your instructions about running a "make test" within the
> fortran directory - the make fails to find "ftest.f" and give up. Output
> is attached as "fortran-test.log". So is the output from a "make test"
> from the src directory level. There's a message there about failing to do
> a link:
> 
> cc: ftest.F: linker input file unused since linking not done
> ...which results in the failure to create ftest.f, I gather?

This is the problem: the file "fortran/ftest.F" isn't being preprocessed
by the C preprocessor to generate the file "fortran/ftest.f".  See my
comments at the end of this message.

> That's as far as this got. I will have a bash today at installing the g77,
> but would really prefer to use f90. No biggie if it can't be.
> 
> thanks again for all - and have a good weekend!

You're welcome.  You have a good weekend too.

> 
> Alec
> 
> 
> -------------------------------------------------------------------------------
> Dr Alec Joubert                   
> Climatology Research Group         Tel:   +27 11 716 2998
> University of the Witwatersrand    Fax    +27 11 716 3161
> P.O. Wits 2050                     Email: address@hidden    
> SOUTH AFRICA                       WWW:   http://crg.bpb.wits.ac.za
> -------------------------------------------------------------------------------
> 
> 
> Content-Description: make test from src directory
> 
> make[1]: Entering directory `/home/local/src/netcdf-3.3.1/src'
> 
> Making `test' in directory /home/local/src/netcdf-3.3.1/src/libsrc
> 
> make[2]: Entering directory `/home/local/src/netcdf-3.3.1/src/libsrc'
> /usr/bin/cc -c -O -I.  -DNDEBUG -DNAGf90Fortran t_nc.c
> ar cru         libnetcdf.a attr.o dim.o error.o libvers.o nc.o ncio.o ncx.o 
> putget.o string.o v1hpg.o v2i.o var.o
> ranlib libnetcdf.a
> /usr/bin/cc -o t_nc -O  t_nc.o -L. -lnetcdf 
> ./t_nc
> dimrename: IXX
> nc_close ret = 0
> 
> reopen id = 3 for filename test.nc
> NC done
> GATTR VAR VATTR
> VATTR
> VATTR
> VATTR
> VATTR
> VATTR
> fill_seq indices       1 2 3  75.000000 != 2.718282
> Done
> got val = 3.250000
> got val = 0.000000
> got val = 2.718282
> got val = 82555
> got val = 97
> got NC_CHAR val = A (0x41) 
> got NC_CHAR val = B (0x42) 
> got NC_CHAR val = "The red death had long devastated the country."
> got val = A (0x41) 
> got val = B (0x42) 
> got val = "The red death had long devastated the country."
> got vals = 0.000000 ... 447.000000
> re nc_close ret = 0
> cmp test.nc test_nc.sav
> *** Success ***
> make[2]: Leaving directory `/home/local/src/netcdf-3.3.1/src/libsrc'
> 
> Returning to directory /home/local/src/netcdf-3.3.1/src
> 
> make[1]: Leaving directory `/home/local/src/netcdf-3.3.1/src'
> make[1]: Entering directory `/home/local/src/netcdf-3.3.1/src'
> 
> Making `test' in directory /home/local/src/netcdf-3.3.1/src/nctest
> 
> make[2]: Entering directory `/home/local/src/netcdf-3.3.1/src/nctest'
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran varget.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran vargetg.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran varput.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran varputg.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran vardef.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran vartests.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran vputget.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran vputgetg.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran driver.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran cdftests.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran dimtests.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran rec.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran atttests.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran misctest.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran add.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran error.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran emalloc.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran val.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran slabs.c
> /usr/bin/cc -o nctest -O  varget.o vargetg.o varput.o varputg.o vardef.o 
> vartests.o vputget.o vputgetg.o driver.o cdftests.o dimtests.o rec.o 
> atttests.o misctest.o add.o error.o emalloc.o val.o slabs.o -L../libsrc 
> -lnetcdf  
> ./nctest
> *** Testing nccreate ...      ok ***
> *** Testing ncopen ...                ok ***
> *** Testing ncredef ...               ok ***
> *** Testing ncendef ...               ok ***
> *** Testing ncclose ...               ok ***
> *** Testing ncinquire ...     ok ***
> *** Testing ncsync ...                ok ***
> *** Testing ncabort ...               ok ***
> *** Testing ncdimdef ...      ok ***
> *** Testing ncdimid ...               ok ***
> *** Testing ncdiminq ...      ok ***
> *** Testing ncdimrename ...   ok ***
> *** Testing ncvardef ...      ok ***
> *** Testing ncvarid ...               ok ***
> *** Testing ncvarinq ...      ok ***
> *** Testing ncvarput1 ...     ok ***
> *** Testing ncvarget1 ...     ok ***
> *** Testing ncvarput ...      ok ***
> *** Testing ncvarget ...      ok ***
> *** Testing ncvarputg ...     ok ***
> *** Testing ncvargetg ...     ok ***
> *** Testing ncrecinq ...      ok ***
> *** Testing ncrecput ...      ok ***
> *** Testing ncrecget ...      ok ***
> *** Testing ncvarrename ...   ok ***
> *** Testing ncattput ...      ok ***
> *** Testing ncattinq ...      ok ***
> *** Testing ncattget ...      ok ***
> *** Testing ncattcopy ...     ok ***
> *** Testing ncattname ...     ok ***
> *** Testing ncattrename ...   ok ***
> *** Testing ncattdel ...      ok ***
> *** Testing nctypelen ...     ok ***
> cmp testfile.nc testfile_nc.sav
> make[2]: Leaving directory `/home/local/src/netcdf-3.3.1/src/nctest'
> 
> Returning to directory /home/local/src/netcdf-3.3.1/src
> 
> make[1]: Leaving directory `/home/local/src/netcdf-3.3.1/src'
> make[1]: Entering directory `/home/local/src/netcdf-3.3.1/src'
> 
> Making `test' in directory /home/local/src/netcdf-3.3.1/src/nc_test
> 
> make[2]: Entering directory `/home/local/src/netcdf-3.3.1/src/nc_test'
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran nc_test.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran error.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran test_get.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran test_put.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran test_read.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran test_write.c
> /usr/bin/cc -c -O -I../libsrc  -DNDEBUG -DNAGf90Fortran util.c
> /usr/bin/cc -o nc_test -O  nc_test.o error.o test_get.o test_put.o 
> test_read.o test_write.o util.o -L../libsrc -lnetcdf -lm 
> ./nc_test -c
> ./nc_test
> *** Testing nc_strerror ... ok
> *** Testing nc_open ... ok
> *** Testing nc_close ... ok
> *** Testing nc_inq ... ok
> *** Testing nc_inq_dimid ... ok
> *** Testing nc_inq_dim ... ok
> *** Testing nc_inq_dimlen ... ok
> *** Testing nc_inq_dimname ... ok
> *** Testing nc_inq_varid ... ok
> *** Testing nc_inq_var ... ok
> *** Testing nc_inq_natts ... ok
> *** Testing nc_inq_ndims ... ok
> *** Testing nc_inq_nvars ... ok
> *** Testing nc_inq_unlimdim ... ok
> *** Testing nc_inq_vardimid ... ok
> *** Testing nc_inq_varname ... ok
> *** Testing nc_inq_varnatts ... ok
> *** Testing nc_inq_varndims ... ok
> *** Testing nc_inq_vartype ... ok
> *** Testing nc_get_var_text ...  179 good comparisons. ok
> *** Testing nc_get_var_uchar ...  264 good comparisons. ok
> *** Testing nc_get_var_schar ...  269 good comparisons. ok
> *** Testing nc_get_var_short ...  682 good comparisons. ok
> *** Testing nc_get_var_int ...  1189 good comparisons. ok
> *** Testing nc_get_var_long ...  1189 good comparisons. ok
> *** Testing nc_get_var_float ...  1194 good comparisons. ok
> *** Testing nc_get_var_double ...  1207 good comparisons. ok
> *** Testing nc_get_var1_text ...  179 good comparisons. ok
> *** Testing nc_get_var1_uchar ...  264 good comparisons. ok
> *** Testing nc_get_var1_schar ...  269 good comparisons. ok
> *** Testing nc_get_var1_short ...  682 good comparisons. ok
> *** Testing nc_get_var1_int ...  1189 good comparisons. ok
> *** Testing nc_get_var1_long ...  1189 good comparisons. ok
> *** Testing nc_get_var1_float ...  1194 good comparisons. ok
> *** Testing nc_get_var1_double ...  1207 good comparisons. ok
> *** Testing nc_get_vara_text ...  179 good comparisons. ok
> *** Testing nc_get_vara_uchar ...  264 good comparisons. ok
> *** Testing nc_get_vara_schar ...  269 good comparisons. ok
> *** Testing nc_get_vara_short ...  682 good comparisons. ok
> *** Testing nc_get_vara_int ...  1189 good comparisons. ok
> *** Testing nc_get_vara_long ...  1189 good comparisons. ok
> *** Testing nc_get_vara_float ...  1194 good comparisons. ok
> *** Testing nc_get_vara_double ...  1207 good comparisons. ok
> *** Testing nc_get_vars_text ...  179 good comparisons. ok
> *** Testing nc_get_vars_uchar ...  264 good comparisons. ok
> *** Testing nc_get_vars_schar ...  269 good comparisons. ok
> *** Testing nc_get_vars_short ...  682 good comparisons. ok
> *** Testing nc_get_vars_int ...  1189 good comparisons. ok
> *** Testing nc_get_vars_long ...  1189 good comparisons. ok
> *** Testing nc_get_vars_float ...  1194 good comparisons. ok
> *** Testing nc_get_vars_double ...  1207 good comparisons. ok
> *** Testing nc_get_varm_text ...  179 good comparisons. ok
> *** Testing nc_get_varm_uchar ...  264 good comparisons. ok
> *** Testing nc_get_varm_schar ...  269 good comparisons. ok
> *** Testing nc_get_varm_short ...  682 good comparisons. ok
> *** Testing nc_get_varm_int ...  1189 good comparisons. ok
> *** Testing nc_get_varm_long ...  1189 good comparisons. ok
> *** Testing nc_get_varm_float ...  1194 good comparisons. ok
> *** Testing nc_get_varm_double ...  1207 good comparisons. ok
> *** Testing nc_get_att_text ...  7 good comparisons. ok
> *** Testing nc_get_att_uchar ...  5 good comparisons. ok
> *** Testing nc_get_att_schar ...  7 good comparisons. ok
> *** Testing nc_get_att_short ...  15 good comparisons. ok
> *** Testing nc_get_att_int ...  19 good comparisons. ok
> *** Testing nc_get_att_long ...  19 good comparisons. ok
> *** Testing nc_get_att_float ...  21 good comparisons. ok
> *** Testing nc_get_att_double ...  27 good comparisons. ok
> *** Testing nc_inq_att ... ok
> *** Testing nc_inq_attname ... ok
> *** Testing nc_inq_attid ... ok
> *** Testing nc_inq_attlen ... ok
> *** Testing nc_inq_atttype ... ok
> *** Testing nc_create ... ok
> *** Testing nc_redef ...  1386 good comparisons.  34 good comparisons. ok
> *** Testing nc_enddef ...  1386 good comparisons.  34 good comparisons. ok
> *** Testing nc_sync ...  34 good comparisons.  1386 good comparisons. ok
> *** Testing nc_abort ...  1386 good comparisons.  34 good comparisons. ok
> *** Testing nc_def_dim ... ok
> *** Testing nc_rename_dim ... ok
> *** Testing nc_def_var ... ok
> *** Testing nc_put_var_text ...  179 good comparisons. ok
> *** Testing nc_put_var_uchar ...  264 good comparisons. ok
> *** Testing nc_put_var_schar ...  269 good comparisons. ok
> *** Testing nc_put_var_short ...  682 good comparisons. ok
> *** Testing nc_put_var_int ...  1189 good comparisons. ok
> *** Testing nc_put_var_long ...  1189 good comparisons. ok
> *** Testing nc_put_var_float ...  1194 good comparisons. ok
> *** Testing nc_put_var_double ...  1207 good comparisons. ok
> *** Testing nc_put_var1_text ...  179 good comparisons. ok
> *** Testing nc_put_var1_uchar ...  264 good comparisons. ok
> *** Testing nc_put_var1_schar ...  269 good comparisons. ok
> *** Testing nc_put_var1_short ...  682 good comparisons. ok
> *** Testing nc_put_var1_int ...  1189 good comparisons. ok
> *** Testing nc_put_var1_long ...  1189 good comparisons. ok
> *** Testing nc_put_var1_float ...  1194 good comparisons. ok
> *** Testing nc_put_var1_double ...  1207 good comparisons. ok
> *** Testing nc_put_vara_text ...  179 good comparisons. ok
> *** Testing nc_put_vara_uchar ...  264 good comparisons. ok
> *** Testing nc_put_vara_schar ...  269 good comparisons. ok
> *** Testing nc_put_vara_short ...  682 good comparisons. ok
> *** Testing nc_put_vara_int ...  1189 good comparisons. ok
> *** Testing nc_put_vara_long ...  1189 good comparisons. ok
> *** Testing nc_put_vara_float ...  1194 good comparisons. ok
> *** Testing nc_put_vara_double ...  1207 good comparisons. ok
> *** Testing nc_put_vars_text ...  179 good comparisons. ok
> *** Testing nc_put_vars_uchar ...  264 good comparisons. ok
> *** Testing nc_put_vars_schar ...  269 good comparisons. ok
> *** Testing nc_put_vars_short ...  682 good comparisons. ok
> *** Testing nc_put_vars_int ...  1189 good comparisons. ok
> *** Testing nc_put_vars_long ...  1189 good comparisons. ok
> *** Testing nc_put_vars_float ...  1194 good comparisons. ok
> *** Testing nc_put_vars_double ...  1207 good comparisons. ok
> *** Testing nc_put_varm_text ...  179 good comparisons. ok
> *** Testing nc_put_varm_uchar ...  264 good comparisons. ok
> *** Testing nc_put_varm_schar ...  269 good comparisons. ok
> *** Testing nc_put_varm_short ...  682 good comparisons. ok
> *** Testing nc_put_varm_int ...  1189 good comparisons. ok
> *** Testing nc_put_varm_long ...  1189 good comparisons. ok
> *** Testing nc_put_varm_float ...  1194 good comparisons. ok
> *** Testing nc_put_varm_double ...  1207 good comparisons. ok
> *** Testing nc_rename_var ...  1386 good comparisons. ok
> *** Testing nc_put_att_text ...  7 good comparisons. ok
> *** Testing nc_put_att_uchar ...  5 good comparisons. ok
> *** Testing nc_put_att_schar ...  7 good comparisons. ok
> *** Testing nc_put_att_short ...  15 good comparisons. ok
> *** Testing nc_put_att_int ...  19 good comparisons. ok
> *** Testing nc_put_att_long ...  19 good comparisons. ok
> *** Testing nc_put_att_float ...  21 good comparisons. ok
> *** Testing nc_put_att_double ...  27 good comparisons. ok
> *** Testing nc_copy_att ...  34 good comparisons. ok
> *** Testing nc_rename_att ...  34 good comparisons. ok
> *** Testing nc_del_att ... ok
> *** Testing nc_set_fill ...  2796 good comparisons. ok
> 
> Total number of failures: 0
> *** Success ***
> make[2]: Leaving directory `/home/local/src/netcdf-3.3.1/src/nc_test'
> 
> Returning to directory /home/local/src/netcdf-3.3.1/src
> 
> make[1]: Leaving directory `/home/local/src/netcdf-3.3.1/src'
> make[1]: Entering directory `/home/local/src/netcdf-3.3.1/src'
> 
> Making `test' in directory /home/local/src/netcdf-3.3.1/src/fortran
> 
> make[2]: Entering directory `/home/local/src/netcdf-3.3.1/src/fortran'
> + /usr/bin/cc -E ftest.F
> + grep -v ^#
> cc: ftest.F: linker input file unused since linking not done
> + rm ftest.f
> + exit 1
> + /usr/local/bin/f90 -c -O ftest.f
> Cannot open "ftest.f"
> + rm ftest.f
> rm: ftest.f: No such file or directory
> + exit 1
> + rm ftest.f
> rm: ftest.f: No such file or directory
> make[2]: *** [ftest.o] Error 1
> make[2]: Leaving directory `/home/local/src/netcdf-3.3.1/src/fortran'
> make[1]: *** [subdir_target] Error 1
> make[1]: Leaving directory `/home/local/src/netcdf-3.3.1/src'
> make: *** [fortran/test] Error 2
> Content-Description: make test from fortran subdirectory
> 
> + /usr/bin/cc -E ftest.F
> + grep -v ^#
> cc: ftest.F: linker input file unused since linking not done
> + rm ftest.f
> + exit 1

It appears from the last 5 lines above that the C compiler wasn't able 
to preprocess the file "ftest.F" into the file "ftest.f".  The reason
that the file needs to be preprocessed is to convert macros like
NCSHORT_T into their appropriate Fortran types.  Try executing the
command manually.  Can you get it to work?  Is there some other way to
use the C preprocessor to preprocess the file?  Is there an option to
f90 that will do it?

> + /usr/local/bin/f90 -c -O ftest.f
> Cannot open "ftest.f"
> + rm ftest.f
> rm: ftest.f: No such file or directory
> + exit 1
> + rm ftest.f
> rm: ftest.f: No such file or directory
> make: *** [ftest.o] Error 1

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