I installed netcdf-3.6.2 in my own directory and modified the following lines in Makefile.Gnu of OA Package:
--------------------------------------------------------------------------
CFT = /usr/bin/g77
CPP = /lib/cpp -P
CPPFLAGS = -I/$NETCDF/include
GLDR = ncargf77
LDR = $(CFT)
RANLIB = ranlib
LDFLAGS =
FFLAGS = -DNO_EXIT -g -O2
MDEPFLAGS = -I/$NETCDF/include
CDFLIB = -L/home/yunli/bin/netcdf-3.6.2/lib -lnetcdf
LIBS = $(CDFLIB)
SHELL = /bin/sh
CC = gcc
--------------------------------------------------------------------------
But after I typed "make --file=Makefile.Gnu", a bunch of errors flooded out as follows
--------------------------------------------------------------------------------
/usr/bin/g77 -DNO_EXIT -g -O2 -o /home/yunli/bin/oa oamain.o acor.o asm.o atg.o
bcintrp.o bcucof.o caldate.o day_code.o def_oa.o dhlev.o diagn.o down_shift.o dynht.o exitus.o filter.o geodesic_dist.o get_date.o get_clima.o get_grid.o get_dynht.o get_obs.o gregorian.o hindices.o ierinv.o indepen.o inside.o invmtx.o lintrp.o lenstr.o locate.o lubksb.o ludcmp.o oamean.o oapar.o objan.o outlier.o ptem.o press.o qtrap.o readhydro.o remove.o se_grid.o selectclm.o selectobs.o sort.o svafunc.o svan.o svel.o trapzd.o trend.o trendcoef.o try_range.o xclima.o xhydro.o -L/home/yunli/bin/netcdf-3.6.2/lib -lnetcdf
oamain.o: In function `MAIN__':
/home/yunli/downloads/oa/oamain.F:267: undefined reference to `nf_put_var1_double__'
/home/yunli/downloads/oa/oamain.F:272: undefined reference to `nf_put_vara_double__'
/home/yunli/downloads/oa/oamain.F:278: undefined reference to `nf_put_vara_double__'
/home/yunli/downloads/oa/oamain.F:286: undefined reference to `nf_put_vara_double__'
/home/yunli/downloads/oa/oamain.F:294: undefined reference to `nf_sync__'
def_oa.o: In function `def_oa__':
/home/yunli/downloads/oa/def_oa.F:58: undefined reference to `nf_create__'
/home/yunli/downloads/oa/def_oa.F:70: undefined reference to `nf_def_dim__'
/home/yunli/downloads/oa/def_oa.F:71: undefined reference to `nf_def_dim__'
/home/yunli/downloads/oa/def_oa.F:72: undefined reference to `nf_def_dim__'
/home/yunli/downloads/oa/def_oa.F:73: undefined reference to `nf_def_dim__'
.........
exitus.o: In function `exitus_':
........
get_grid.o: In function `get_grid__':
........
collect2: ld returned 1 exit status
-------------------------------------------------------------------------------
It seems that all functions about netcdf are treated as undefined reference. Do I have to set some configuration parameters in another way? Thanks.
OA Package -- make problem
Was netcdf built with an option involving no-second-underscore? You need to do something like "nm libnetcdf.a | grep nf_close" to see if it matches your missing nf_close__. I get:
cygnus.arsc.edu 132% nm !$ | grep nf_close
nm libnetcdf.a | grep nf_close
00000000000006fc T nf_close_
U nf_close_
If netcdf was built with -fno-second-underscore (or whatever it's called), then you need to build ROMS that way too. (Edit: I mean oa, not ROMS).
cygnus.arsc.edu 132% nm !$ | grep nf_close
nm libnetcdf.a | grep nf_close
00000000000006fc T nf_close_
U nf_close_
If netcdf was built with -fno-second-underscore (or whatever it's called), then you need to build ROMS that way too. (Edit: I mean oa, not ROMS).