From 1578ddac0cc66060855613104120a174d3db98eb Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Tue, 20 Sep 2011 20:39:04 +0000 Subject: [PATCH] --- cf | 4 ++-- include/ncdispatch.h | 21 ++++++++++++--------- libdiskless/ncddispatch.c | 3 ++- libdispatch/dfile.c | 4 ++-- liblib/Makefile.am | 8 +++++--- liblib/stub.c | 25 ++++++++++++++++++------- libsrc/Makefile.am | 4 ++-- nc_test/Makefile.am | 4 ++-- 8 files changed, 45 insertions(+), 28 deletions(-) diff --git a/cf b/cf index 965e80079..ee500a665 100644 --- a/cf +++ b/cf @@ -1,8 +1,8 @@ #!/bin/bash #X="-x" -HDF5=1 -DAP=1 +#HDF5=1 +#DAP=1 #CDMR=1 #RPC=1 diff --git a/include/ncdispatch.h b/include/ncdispatch.h index 34d1e71ba..5cd8aa19e 100755 --- a/include/ncdispatch.h +++ b/include/ncdispatch.h @@ -129,15 +129,6 @@ extern int NCDISPATCH_initialize(void); extern NC_Dispatch* NC3_dispatch_table; extern int NC3_initialize(void); -/* Diskless */ -extern NC_Dispatch* NCD_dispatch_table; -extern int NCD_initialize(void); - -#ifdef USE_NETCDF4 -extern NC_Dispatch* NC4_dispatch_table; -extern int NC4_initialize(void); -#endif - #ifdef USE_DAP extern NC_Dispatch* NCD3_dispatch_table; extern int NCD3_initialize(void); @@ -145,6 +136,13 @@ extern int NCD3_initialize(void); #ifdef USE_NETCDF4 +extern NC_Dispatch* NC4_dispatch_table; +extern int NC4_initialize(void); + +/* Diskless */ +extern NC_Dispatch* NCD_dispatch_table; +extern int NCD_initialize(void); + #ifdef USE_DAP extern NC_Dispatch* NCD4_dispatch_table; extern int NCD4_initialize(void); @@ -155,6 +153,11 @@ extern NC_Dispatch* NCCR_dispatch_table; extern int NCCR_initialize(void); #endif +#ifdef BUILD_RPC +extern NC_Dispatch* NCRPC_dispatch_table; +extern int NCRPC_initialize(void); +#endif + #endif /*USE_NETCDF4*/ /* Vectors of ones and zeros */ diff --git a/libdiskless/ncddispatch.c b/libdiskless/ncddispatch.c index f0973a1ab..e8ed10733 100644 --- a/libdiskless/ncddispatch.c +++ b/libdiskless/ncddispatch.c @@ -58,6 +58,7 @@ NC_Dispatch NCD_dispatcher = NCD_inq_var_all, +#ifdef USE_NETCDF4 NCD_show_metadata, NCD_inq_unlimdims, @@ -97,7 +98,7 @@ NC_Dispatch NCD_dispatcher = NCD_def_var_endian, NCD_set_var_chunk_cache, NCD_get_var_chunk_cache, - +#endif /* USE_NETCDF4 */ }; NC_Dispatch* NCD_dispatch_table = NULL; /* Moved here from ddispatch.c */ diff --git a/libdispatch/dfile.c b/libdispatch/dfile.c index 86615644b..bc3d9c09a 100644 --- a/libdispatch/dfile.c +++ b/libdispatch/dfile.c @@ -1356,6 +1356,8 @@ NC_create(const char *path, int cmode, size_t initialsz, #endif if(model == (NC_DISPATCH_NC4)) dispatcher = NC4_dispatch_table; + else if(model == (NC_DISPATCH_DISKLESS)) + dispatcher = NCD_dispatch_table; else #endif /*USE_NETCDF4*/ #ifdef USE_DAP @@ -1365,8 +1367,6 @@ NC_create(const char *path, int cmode, size_t initialsz, #endif if(model == (NC_DISPATCH_NC3)) dispatcher = NC3_dispatch_table; - else if(model == (NC_DISPATCH_DISKLESS)) - dispatcher = NCD_dispatch_table; else return NC_ENOTNC; } diff --git a/liblib/Makefile.am b/liblib/Makefile.am index d2142a042..32cae5454 100755 --- a/liblib/Makefile.am +++ b/liblib/Makefile.am @@ -29,7 +29,7 @@ libnetcdf_la_LIBADD += ${top_builddir}/libdispatch/libnetcdf2.la endif # BUILD_V2 # The output library will always include netcdf3 and dispatch -# libraries. +# libraries libnetcdf_la_LIBADD += ${top_builddir}/libdispatch/libdispatch.la \ ${top_builddir}/libsrc/libnetcdf3.la @@ -44,8 +44,10 @@ endif # USE_DAP if USE_NETCDF4 AM_CPPFLAGS += -I${top_srcdir}/libsrc4 -libnetcdf_la_LIBADD += ${top_builddir}/libdiskless/libdiskless.la \ -${top_builddir}/libsrc4/libnetcdf4.la + +libnetcdf_la_LIBADD += ${top_builddir}/libsrc4/libnetcdf4.la + +libnetcdf_la_LIBADD += ${top_builddir}/libdiskless/libdiskless.la # netcdf4+cdmremote if BUILD_CDMREMOTE diff --git a/liblib/stub.c b/liblib/stub.c index ad31f0f8f..7512a3c3e 100644 --- a/liblib/stub.c +++ b/liblib/stub.c @@ -7,6 +7,7 @@ #include "ncdispatch.h" extern int NC3_initialize(void); + #ifdef USE_NETCDF4 extern int NC4_initialize(void); #endif @@ -22,6 +23,10 @@ extern int NCD4_initialize(void); extern int NCCR_initialize(void); #endif +#ifdef BUILD_RPC +extern int NCRPC_initialize(void); +#endif + int NC_initialize(void) { @@ -34,24 +39,30 @@ NC_initialize(void) if((stat = NC3_initialize())) return stat; -#ifdef USE_NETCDF4 - if((stat = NCD_initialize())) return stat; - if((stat = NC4_initialize())) return stat; -#endif - #ifdef USE_DAP if((stat = NCD3_initialize())) return stat; #endif -#if defined(USE_DAP) && defined(USE_NETCDF4) +#ifdef USE_NETCDF4 + if((stat = NC4_initialize())) return stat; + + if((stat = NCD_initialize())) return stat; + +#ifdef USE_DAP if((stat = NCD4_initialize())) return stat; #endif -/* cdmremote => netcdf4 */ #ifdef USE_CDMREMOTE if((stat = NCCR_initialize())) return stat; #endif +#ifdef USE_RPC + if((stat = NCRPC_initialize())) return stat; +#endif + +#endif /* USE_NETCDF4 */ + + return NC_NOERR; } diff --git a/libsrc/Makefile.am b/libsrc/Makefile.am index e88fc56f4..4c94e246e 100644 --- a/libsrc/Makefile.am +++ b/libsrc/Makefile.am @@ -15,7 +15,7 @@ endif # BUILD_DLL # These files comprise the netCDF-3 classic library code. libnetcdf3_la_SOURCES = v1hpg.c onstack.h \ -nclistmgr.c putget.m4 attr.m4 nc3dispatch.c nc.c var.c dim.c ncx.m4 \ +nclistmgr.c putget.c attr.c nc3dispatch.c nc.c var.c dim.c ncx.c \ ncx.h lookup3.c pstdint.h # Does the user want to use ffio, a replacement for posixio for Cray @@ -31,7 +31,7 @@ noinst_LTLIBRARIES = libnetcdf3.la # with m4), but they are included in the distribution so that the user # does not have to have m4. MAINTAINERCLEANFILES = attr.c ncx.c putget.c $(man_MANS) attrx.c putgetx.c -EXTRA_DIST = attr.c ncx.c putget.c $(man_MANS) +EXTRA_DIST = attr.m4 ncx.m4 putget.m4 $(man_MANS) # This tells make how to turn .m4 files into .c files. .m4.c: diff --git a/nc_test/Makefile.am b/nc_test/Makefile.am index 4f4efea06..c8a967101 100644 --- a/nc_test/Makefile.am +++ b/nc_test/Makefile.am @@ -21,7 +21,7 @@ endif # These are the source files for the main workhorse test program, # nc_test. If you pass nc_test, you are doing well. -nc_test_SOURCES = nc_test.c error.c test_get.m4 test_put.m4 \ +nc_test_SOURCES = nc_test.c error.c test_get.c test_put.c \ test_read.c test_write.c util.c error.h tests.h LDADD = ${top_builddir}/liblib/libnetcdf.la @@ -50,7 +50,7 @@ endif # USE_VALGRIND_TESTS # Distribute the .c files so that m4 isn't required on the users # machine. -EXTRA_DIST = test_get.c test_put.c run_valgrind_tests.sh +EXTRA_DIST = test_get.m4 test_put.m4 run_valgrind_tests.sh # Only clean these on mainatiner-clean, because they require m4 to # regenerate.