Commit Graph

673 Commits

Author SHA1 Message Date
Ward Fisher
288c9a7c52 Update to fix an environmental issue in ncconfigure.h 2019-02-19 14:42:34 -07:00
Ed Hartnett
a22e895c10 cleanup of whitespace in include directory 2019-02-19 06:10:30 -07:00
Ed Hartnett
58a801c91a cleanup of whitespace in include directory 2019-02-19 06:09:10 -07:00
Ward Fisher
6830cfa4f2 Restored EXTERNL definition to netcdf_mem.h in support of https://github.com/Unidata/netcdf-c/issues/1148 2019-02-15 17:17:06 -07:00
Dennis Heimbigner
ddd324c1f0 Fix LGTM complaint 2019-02-15 12:40:30 -07:00
Dennis Heimbigner
24510f2ffb Forgot to distribute ncmodel.h 2019-02-13 21:46:01 -07:00
Dennis Heimbigner
a1f080db19
Merge branch 'master' into byterange.dmh 2019-02-13 14:45:53 -07:00
Ward Fisher
3a14251dd9
Merge branch 'master' into bigend.dmh 2019-02-07 14:28:39 -07:00
Ward Fisher
1fde39c8d7
Merge branch 'master' into byterange.dmh 2019-02-07 14:28:23 -07:00
Ward Fisher
035b3030ef Merge branch 'ejh_rename_var_to_non_coord_var' of https://github.com/NetCDF-World-Domination-Council/netcdf-c into pr-aggregation.wif 2019-02-06 14:09:48 -07:00
Ward Fisher
2c335466bd Merge branch 'ejh_not_read_rename_2' of https://github.com/NetCDF-World-Domination-Council/netcdf-c into pr-aggregation.wif 2019-02-06 14:08:06 -07:00
Dennis Heimbigner
8714066b18 Fix errors when building on big-endian machine
re: issue https://github.com/Unidata/netcdf-c/issues/1278
re: issue https://github.com/Unidata/netcdf-c/issues/876
re: issue https://github.com/Unidata/netcdf-c/issues/806

* Major change to the handling of 8-byte parameters for nc_def_var_filter.
  The old code was not well thought out.
  * The new algorithm is documented in docs/filters.md.
  * Added new utility file plugins/H5Zutil.c to support
  * Modified plugins/H5Zmisc.c to use new algorithm
  the new algorithm.
  * Renamed include/ncfilter.h to include/netcdf_filter.h
    and made it an installed header so clients can access the
    new algorithm utility.
  * Fixed nc_test4/tst_filterparser.c and nc_test4/test_filter_misc.c
    to use the new algorithm
* libdap4/ fixes:
  * d4swap.c has an error in the endian pre-processing such
    that record counts were not being swapped correctly.
  * d4data.c had an error in that checksums were being computed
    after endian swapping rather than before.
* ocinitialize() was never being called, so xxdr bigendian handling
  was never set correctly.
  * Required adding debug statements to occompile
* Found and fixed memory leak in ncdump.c

Not tested:
* HDF4
* Pnetcdf
* parallel HDF5
2019-01-31 21:13:06 -07:00
Ward Fisher
9ca942b201
Merge branch 'master' into fix-warnings 2019-01-31 12:39:06 -07:00
Ed Hartnett
e74ec6f2a0 made function give_var_secret_name() not static, fixed warning 2019-01-27 11:10:41 -07:00
Ed Hartnett
627a55cf78 added function give_var_secret_name() 2019-01-27 11:06:02 -07:00
Ward Fisher
b27c7d899d Merge branch 'master' into byterange.dmh 2019-01-25 14:50:23 -07:00
Ward Fisher
688c06d50c
Merge branch 'master' into fix-warnings 2019-01-23 15:12:20 -07:00
Ed Hartnett
840d51d035 changed NC_GRP_INFO_T to use atts_read instead of atts_not_read 2019-01-22 08:11:52 -07:00
Ed Hartnett
243cef8fa5 changed var atts_not_read to atts_read 2019-01-21 08:40:04 -07:00
Ed Hartnett
15e6a782db removed unneeded variable, shortened function name 2019-01-20 09:25:04 -07:00
Ben Boeckel
eda449b947 ncconfigure: add NC_UNUSED macro
This should be used to indicate that a variable is unused in a
codeblock.
2019-01-16 15:51:50 -05:00
Ward Fisher
2285e1dfa1 Merge branch 'ejh_test_null_vars_stride' of https://github.com/NetCDF-World-Domination-Council/netcdf-c into pr-aggregation.wif 2019-01-15 15:10:40 -07:00
Ward Fisher
c6ca9dfa1e Merge branch 'ejh_coords_3' of https://github.com/NetCDF-World-Domination-Council/netcdf-c into pr-aggregation.wif 2019-01-15 15:03:36 -07:00
Ward Fisher
9a365be6d0 Merge branch 'ansifix.dmh' into pr-aggregation.wif 2019-01-15 14:58:54 -07:00
Ward Fisher
d66d642e24 Corrected an issue observed on OSX 2019-01-15 14:36:07 -07:00
Ward Fisher
c21820a1ae Merge branch 'master' into ansifix.dmh 2019-01-02 22:26:59 -08:00
Dennis Heimbigner
84c2bc0d78 Merge branch 'master' into byterange.dmh 2019-01-02 13:18:45 -07:00
Ed Hartnett
6416abe887 fixed HDF4 abort warning 2019-01-02 05:58:54 -07:00
Ed Hartnett
bdf7eef7c6 merged master 2019-01-02 03:52:51 -07:00
Ed Hartnett
52683c5ec7
Merge branch 'master' into ejh_coords_3 2019-01-02 03:49:46 -07:00
Dennis Heimbigner
bf2746b8ea Provide byte-range reading of remote datasets
re: issue https://github.com/Unidata/netcdf-c/issues/1251

Assume that you have the URL to a remote dataset
which is a normal netcdf-3 or netcdf-4 file.

This PR allows the netcdf-c to read that dataset's
contents as a netcdf file using HTTP byte ranges
if the remote server supports byte-range access.

Originally, this PR was set up to access Amazon S3 objects,
but it can also access other remote datasets such as those
provided by a Thredds server via the HTTPServer access protocol.
It may also work for other kinds of servers.

Note that this is not intended as a true production
capability because, as is known, this kind of access to
can be quite slow. In addition, the byte-range IO drivers
do not currently do any sort of optimization or caching.

An additional goal here is to gain some experience with
the Amazon S3 REST protocol.

This architecture and its use documented in
the file docs/byterange.dox.

There are currently two test cases:

1. nc_test/tst_s3raw.c - this does a simple open, check format, close cycle
   for a remote netcdf-3 file and a remote netcdf-4 file.
2. nc_test/test_s3raw.sh - this uses ncdump to investigate some remote
   datasets.

This PR also incorporates significantly changed model inference code
(see the superceded PR https://github.com/Unidata/netcdf-c/pull/1259).

1. It centralizes the code that infers the dispatcher.
2. It adds support for byte-range URLs

Other changes:

1. NC_HDF5_finalize was not being properly called by nc_finalize().
2. Fix minor bug in ncgen3.l
3. fix memory leak in nc4info.c
4. add code to walk the .daprc triples and to replace protocol=
   fragment tag with a more general mode= tag.

Final Note:
Th inference code is still way too complicated. We need to move
to the validfile() model used by netcdf Java, where each
dispatcher is asked if it can process the file. This decentralizes
the inference code. This will be done after all the major new
dispatchers (PIO, Zarr, etc) have been implemented.
2019-01-01 18:27:36 -07:00
Ward Fisher
9e94e3298d Merge branch 'ejh_fast_var_prep_2' of https://github.com/NetCDF-World-Domination-Council/netcdf-c into pr-aggregation.wif 2018-12-31 00:02:04 -08:00
Ward Fisher
e6f768b983 Merge branch 'ejh_fast_var_prep' of https://github.com/NetCDF-World-Domination-Council/netcdf-c into pr-aggregation.wif 2018-12-30 23:56:12 -08:00
Ward Fisher
c62d7eb541 Merge remote-tracking branch 'origin/gh1233.dmh' into pr-aggregation.wif 2018-12-30 23:55:30 -08:00
Ward Fisher
718537af7e A bit of cleanup. 2018-12-30 23:49:22 -08:00
Ward Fisher
6b2156bbcc
Merge branch 'master' into patch-30 2018-12-31 00:38:09 -07:00
Ed Hartnett
7249350c3f now remember whether coords att has been read for a var 2018-12-19 09:43:32 -07:00
Ed Hartnett
1b38d9aef8 lazy read of some var metadata 2018-12-18 07:48:22 -07:00
Ed Hartnett
3697f43b1d whitespace fixes in header file, fixed enable-benchmarks doc string in configure.ac 2018-12-17 07:59:33 -07:00
Dennis Heimbigner
735ae80928 merge master and fix conflicts 2018-12-12 11:47:54 -07:00
Ed Hartnett
8ca5a1ac17
Merge branch 'master' into ejh_fast_var_prep 2018-12-12 07:05:45 -07:00
Ward Fisher
30ea33435c Merge remote-tracking branch 'origin/license_update.wif' into pr-aggregation.wif 2018-12-11 17:08:21 -05:00
Ward Fisher
50fa6b4f32 Merge branch 'ejh_next_22' of https://github.com/NetCDF-World-Domination-Council/netcdf-c into pr-aggregation.wif 2018-12-11 17:06:43 -05:00
Ward Fisher
dedc8e7dde Merge branch 'ejh_next_20' of https://github.com/NetCDF-World-Domination-Council/netcdf-c into pr-aggregation.wif 2018-12-11 17:06:32 -05:00
Ward Fisher
dd8ae88add Merge remote-tracking branch 'origin/fixcomments.dmh' into pr-aggregation.wif 2018-12-11 17:06:24 -05:00
Ward Fisher
6deb77bade Merge branch 'master' into gh1207.dmh 2018-12-11 16:44:04 -05:00
Ed Hartnett
dc1115ae76 moved rec_match_dimscales() to hdf5open.c, made it faster by skipping already-identified dims 2018-12-11 09:40:59 -07:00
Ed Hartnett
3c9a141ee3 moved function detect_preserve_dimids and made it static 2018-12-11 06:15:47 -07:00
Greg Sjaardema
30540026db
Eliminate nested comments
Looks like extra comment begin and a missing comment end resulted in nested comments.  Results in warning on at least the ibm compiler:
```
In file included from /g/g16/TPL/netcdf/netcdf-c/include/nc4internal.h:24:0,
                 from /g/g16/TPL/netcdf/netcdf-c/ncgen/includes.h:50,
                 from /g/g16/TPL/netcdf/netcdf-c/ncgen/genc.c:7:
/g/g16/TPL/netcdf/netcdf-c/include/nc_provenance.h:4:1: warning: "/*" within comment [-Wcomment]
 /**
 ^
```
2018-12-07 08:44:46 -07:00
Ward Fisher
5be0126920 More standardizing of the copyright stanza. 2018-12-06 14:13:56 -07:00
Dennis Heimbigner
1a7531392f Make the netcdf-c library compile with gcc -ansi.
Primary fixes to get -ansi to work.
1. Convert all '//' C++ style comments to /*...*/ or to use #if 0...#endif
2. It turns out that when -ansi is specified, then a number of
   functions no longer are defined in the header -- but they are still
   in the .so file.<br>
   The big example is strdup(). So, added code to include/ncconfig.h to define
   externs for those missing functions that occur in more than one place.
   These are enabled if !_WIN32 && __STDC__ == 1 (__STDC__ is supposed to
   be the equivalent compile time flag to -ansi). Note that this requires
   config.h (which references ncconfig.h) to be included in files where it is
   currently not included. Single uses will be only in the file that uses them.
3. Added mmap test for the MAP_ANONYMOUS flag to configure.ac. Apparently
   this is not always defined with -ansi.
4. fix some large integer constants in nc_test4/tst_atts3.c and nc_test4/tst_filterparser.c
   to avoid compiler complaints.
5. fix a double constant in nc_test4/tst_filterparser.c to avoid compiler complaints.

[Note I suspect #4 and #5 will be a problem on big-endian machines, but we have no way to test]

Misc. Changes:
1. convert more instances of _MSC_VER to _WIN32.
2. added some debugging code to include/nctestserver.h
3. added comment about libdispatch/drc.c always being compiled.
4. modify parser generation in ncgen to remove unneeded files.
2018-12-05 19:20:43 -07:00
Dennis Heimbigner
30d63bbaa5 Fix failings of nc_test/run_inmemory.sh
re: issue https://github.com/Unidata/netcdf-c/issues/1233

Changes:

1. remove exit that was there for testing.
2. the program tst_open_mem must be netcdf-4 only.
3. fix some diff problems
   - Change dataset name for tst_inmemory4_create to tst_inmemory4
   - Modify tst_inmemory.c to reorder the variables (somewhat major rewrite)

Minor Unrelated Fixes:
1. fix comment problem in nc_provenance.h
2. Fix memory leak in tst_open_mem.c
3. fix ncdump/bindata.c to properly compile if netcdf4 is disabled.
4. minor changes to ncgen.l
2018-12-04 19:22:02 -07:00
Ward Fisher
3c59fb860d Updating files to refer to the top-level COPYRIGHT file. 2018-12-04 15:52:43 -07:00
Ed Hartnett
693271c278 now always relax coord bounds checking, also fix parallel builds for --enable-pnetcdf 2018-12-03 06:17:23 -07:00
Ward Fisher
34c4298cf5
Merge branch 'master' into fixcomments.dmh 2018-11-30 13:08:31 -07:00
Ed Hartnett
77d0922d49 starting to deal with normalized name in HDF5 attribute code 2018-11-30 08:59:58 -07:00
Ed Hartnett
d51b221c62 move setting of var chunk cache to libhdf5 2018-11-29 06:10:39 -07:00
Ed Hartnett
c824ad9ec9 further removal of libhdf5 code from libsrc4 2018-11-28 15:48:08 -07:00
Ward Fisher
0f72f42d3a Merge branch 'ejh_next_17' of https://github.com/NetCDF-World-Domination-Council/netcdf-c into pr-aggregation.wif 2018-11-28 13:28:26 -07:00
Ward Fisher
a8673c3dfe Moving provenance info out so that it doesn't depend on netCDF4 support to display. 2018-11-27 16:09:17 -07:00
Ed Hartnett
c638c8de92 cleanup 2018-11-26 11:22:32 -07:00
Ed Hartnett
016f675fad more separation of lazy att reads from libsrc4 2018-11-26 10:44:48 -07:00
Ed Hartnett
c710b42707 moving lazy att code to libhdf5 2018-11-26 10:14:03 -07:00
Ed Hartnett
cc18944fa7 moved lazy atts handling for nc_inq_attid() 2018-11-26 09:58:31 -07:00
Ed Hartnett
d97824d3e6 moved lazy atts handling for nc_inq_att() 2018-11-26 09:51:28 -07:00
Ed Hartnett
ff0d526404 adding hdf5dispatch.h to git 2018-11-26 08:26:28 -07:00
Ed Hartnett
1df4bb1762 moving lazy atts code to libhdf5 2018-11-26 08:21:32 -07:00
Ed Hartnett
1f64c66cdf rename HDF5 dispatch functions to start with NC4_HDF5 2018-11-26 08:13:57 -07:00
Ed Hartnett
aade08ee22 moving checking for lazy att reads to libhdf5 2018-11-26 07:49:58 -07:00
Ed Hartnett
0e9784a867 more changes to separate HDF5 from libsrc4 initialization 2018-11-26 05:44:59 -07:00
Ed Hartnett
e8ab6286e3 header file cleanup 2018-11-26 05:20:35 -07:00
Ed Hartnett
6dbcc42eb6 changes in support of separating HDF5 and libsrc4 2018-11-26 04:31:23 -07:00
Ed Hartnett
8dc1ffea38 removing HDF5 type info from libsrc4 2018-11-20 14:26:11 -07:00
Ed Hartnett
ab963e3d41 removing HDF5 type info from libsrc4 2018-11-20 14:24:40 -07:00
Ed Hartnett
9aedbd0c41 changing over native_hdf_typeid 2018-11-20 10:55:45 -07:00
Ed Hartnett
5104262f6b changing types 2018-11-20 08:00:48 -07:00
Ed Hartnett
7d01ffb030 merged master 2018-11-20 06:38:47 -07:00
Ed Hartnett
6bebb703a6 trying types again 2018-11-20 06:37:53 -07:00
Ward Fisher
9357723280
Merge branch 'master' into gh1207.dmh 2018-11-19 16:27:19 -07:00
Ed Hartnett
1d5307b600 merged in ejh_next_10 2018-11-19 09:25:04 -07:00
Ed Hartnett
3ec8b34bfb removed unneeded HDF5 fields 2018-11-19 09:23:43 -07:00
Dennis Heimbigner
4bb92b77db Fix error report coming out of nc4info.c
re: issue https://github.com/Unidata/netcdf-c/issues/1207

The NC4_get_provenance is generating a spurious error message.
This properly suppresses it.
2018-11-16 15:31:37 -07:00
Ward Fisher
128b649190 Fixed a whitespace issue that occurs on OSX. 2018-11-16 15:08:17 -07:00
Dennis Heimbigner
0db7b873ef Remove // style comments from source code.
We need to do this periodically because they sneek in.
2018-11-16 11:56:32 -07:00
Ed Hartnett
4c1b3a225b clean up 2018-11-16 10:07:54 -07:00
Ed Hartnett
8ae5ebf6bc remove unneeded params from function 2018-11-16 08:26:09 -07:00
Ed Hartnett
60a33b9e8b removed hdf5 stuff from NC_FIELD_INFO_T 2018-11-15 16:46:22 -07:00
Ed Hartnett
8aa4577bef merged ejh_next_7 2018-11-15 16:40:14 -07:00
Dennis Heimbigner
751300ec59 Fix more memory leaks in netcdf-c library
This is a follow up to PR https://github.com/Unidata/netcdf-c/pull/1173

Sorry that it is so big, but leak suppression can be complex.

This PR fixes all remaining memory leaks -- as determined by
-fsanitize=address, and with the exceptions noted below.

Unfortunately. there remains a significant leak that I cannot
solve. It involves vlens, and it is unclear if the leak is
occurring in the netcdf-c library or the HDF5 library.

I have added a check_PROGRAM to the ncdump directory to show the
problem.  The program is called tst_vlen_demo.c To exercise it,
build the netcdf library with -fsanitize=address enabled. Then
go into ncdump and do a "make clean check".  This should build
tst_vlen_demo without actually executing it.  Then do the
command "./tst_vlen_demo" to see the output of the memory
checker.  Note the the lost malloc is deep in the HDF5 library
(in H5Tvlen.c).

I am temporarily working around this error in the following way.
1. I modified several test scripts to not execute known vlen tests
   that fail as described above.
2. Added an environment variable called NC_VLEN_NOTEST.
   If set, then those specific tests are suppressed.

This should mean that the --disable-utilities option to
./configure should not need to be set to get a memory leak clean
build.  This should allow for detection of any new leaks.

Note: I used an environment variable rather than a ./configure
option to control the vlen tests. This is because it is
temporary (I hope) and because it is a bit tricky for shell
scripts to access ./configure options.

Finally, as before, this only been tested with netcdf-4 and hdf5 support.
2018-11-15 10:00:38 -07:00
Ed Hartnett
fda69e6b23 moving rest of var stuff 2018-11-13 17:05:50 -07:00
Ed Hartnett
6a66ecd3d0 moving rest of var stuff 2018-11-13 17:03:11 -07:00
Ed Hartnett
d7fe095066 moving rest of var stuff 2018-11-13 16:59:07 -07:00
Ed Hartnett
d7aac4501b removing hid_t from NC_VAR_INFO_T 2018-11-13 16:10:49 -07:00
Ed Hartnett
4045588516 removing hid_t from NC_VAR_INFO_T 2018-11-13 16:10:34 -07:00
Ed Hartnett
f7cb5ead1c moving var hdf5-specific info into libhdf5 2018-11-13 05:44:39 -07:00
Ed Hartnett
578ddb2a28 cleaning up nc4internal.h 2018-11-13 05:27:46 -07:00
Ed Hartnett
286e276390 cleaning up nc4internal.h 2018-11-13 05:18:00 -07:00
Ed Hartnett
825047b8f6 rest of moving HDF5 specific group info to libhdf5 2018-11-12 14:04:17 -07:00
Ed Hartnett
c35aa3ccb9 changed header files to separate HDF5-specific grp info 2018-11-12 07:40:15 -07:00
Ed Hartnett
7534cb24fe cleanup 2018-11-08 11:12:38 -07:00