Commit Graph

69 Commits

Author SHA1 Message Date
Ed Hartnett
d6c0cbe234 removing unneeded file lookups 2018-08-14 08:56:58 -06:00
Ward Fisher
1783e81bfc
Merge branch 'master' into patch-23 2018-07-23 15:34:27 -06:00
Greg Sjaardema
43173957d0
Eliminate compiler warning
The `typedef struct NC_Dispatch NC_Dispatch;` declaration is in both netcdf.h and in ncdispatch.h.  Even though it is the same declaration, there are compilers which see this as an error and the compilation will fail:
```
In file included from /netcdf-c/include/nc4dispatch.h:15,
                 from /netcdf-c/libhdf5/hdf5attr.c:16:
/netcdf-c/include/ncdispatch.h:111: error: redefinition of typedef €`NC_Dispatch`
/netcdf/netcdf-c/include/netcdf.h:515: note: previous declaration of `NC_Dispatch` was here
```
This is with a very old version of gcc-4.4.7 which isn't used much anymore, but this is the default gcc compiler on RHEL6 so it might be worth fixing.
2018-07-06 08:04:11 -04:00
Wei-keng Liao
577fcea506 add missing note about CDF-5 format 2018-07-05 22:54:41 -05:00
Ed Hartnett
39ad753a3b trying to get UDF working for windows 2018-05-30 02:50:09 -06:00
Dennis Heimbigner
0a44d9ae3a Merge branch 'master' into inmemory.dmh 2018-04-23 11:30:14 -06:00
Dennis Heimbigner
4739cd3225 Master merge and conflict resolution 2018-04-12 21:51:17 -06:00
Ed Hartnett
96154d9303 added merged HDF4 changes 2018-04-04 14:11:44 -06:00
Dennis Heimbigner
ccc70d640b re: esupport MQO-415619
and https://github.com/Unidata/netcdf-c/issues/708

Expand the NC_INMEMORY capabilities to support writing and accessing
the final modified memory.

Three new functions have been added:
nc_open_memio, nc_create_mem, and nc_close_memio.

The following new capabilities were added.
1. nc_open_memio() allows the NC_WRITE mode flag
   so a chunk of memory can be passed in and be modified
2. nc_create_mem() allows the NC_INMEMORY flag to be set
   to cause the created file to be kept in memory.
3. nc_close_mem() allows the final in-memory contents to be
   retrieved at the time the file is closed.
4. A special flag, NC_MEMIO_LOCK, is provided to ensure that
   the provided memory will not be freed or reallocated.

Note the following.
1. If nc_open_memio() is called with NC_WRITE, and NC_MEMIO_LOCK is not set,
   then the netcdf-c library will take control of the incoming memory.
   This means that the original memory block should not be freed
   but the block returned by nc_close_mem() must be freed.
2. If nc_open_memio() is called with NC_WRITE, and NC_MEMIO_LOCK is set,
   then modifications to the original memory may fail if the space available
   is insufficient.

Documentation is provided in the file docs/inmemory.md.
A test case is provided: nc_test/tst_inmemory.c driven by
nc_test/run_inmemory.sh

WARNING: changes were made to the dispatch table for
the close entry. From int (*close)(int) to int (*close)(int,void*).
2018-02-25 21:45:31 -07:00
Dennis Heimbigner
8cb1fc4cfe This is the second step in refactoring the libsrc4 code.
The first was branch newhash0.dmh.

As with newhash0.dmh, these changes should be transparent.
2018-02-24 20:36:24 -07:00
Ed Hartnett
2358d4a910 moved HDF4 to its own dispatch layer 2018-02-08 06:20:58 -07:00
Wei-keng Liao
0f4a85b9f2 a clean commit for #383 2017-12-20 20:53:30 -06:00
Ward Fisher
16d6f94f30 Merge branch 'master' into filters.dmh 2017-11-13 11:15:02 -07:00
Dennis Heimbigner
9983b9d911 re e-support UBS-599337
re pull request https://github.com/Unidata/netcdf-c/pull/405
re pull request https://github.com/Unidata/netcdf-c/pull/446

Notes:
1. This branch is a cleanup of the magic.dmh branch.
2. magic.dmh was originally merged, but caused problems with parallel IO.
   It was re-issued as pull request https://github.com/Unidata/netcdf-c/pull/446.
3. This branch + pull request replace any previous pull requests and magic.dmh branch.

Given an otherwise valid netCDF file that has a corrupted header,
the netcdf library currently crashes. Instead, it should return
NC_ENOTNC.

Additionally, the NC_check_file_type code does not do the
forward search required by hdf5 files. It currently only looks
at file position 0 instead of 512, 1024, 2048,... Also, it turns
out that the HDF4 magic number is assumed to always be at the
beginning of the file (unlike HDF5).
The change is localized to libdispatch/dfile.c See
https://support.hdfgroup.org/release4/doc/DSpec_html/DS.pdf

Also, it turns out that the code in NC_check_file_type is duplicated
(mostly) in the function libsrc4/nc4file.c#nc_check_for_hdf.

This branch does the following.
1. Make NC_check_file_type return NC_ENOTNC instead of crashing.
2. Remove nc_check_for_hdf and centralize all file format checking
   NC_check_file_type.
3. Add proper forward search for HDF5 files (but not HDF4 files)
   to look for the magic number at offsets of 0, 512, 1024...
4. Add test tst_hdf5_offset.sh. This tests that hdf5 files with
   an offset are properly recognized. It does so by prefixing
   a legal file with some number of zero bytes: 512, 1024, etc.
5. Off-topic: Added -N flag to ncdump to force a specific output dataset name.
2017-10-24 16:25:09 -06:00
Dennis Heimbigner
ed44fd7306 Add szip support via libaec 2017-08-27 13:35:20 -06:00
Dennis Heimbigner
7c3164577e Finalize the compression support.
This relies on the HDF5 capability to
dynamically load compression filters.
Note that a compression filter is just
a subcase of filters.

The primary user-visible changes are as follows:
1. Add a standard header "netcdf_filter.h" that defines
   the necessary API extensions
2. Modify ncgen to support two new special attributes
   "_Filter_ID" and "_Filter_Parameters" so that compression
   can be turned on when creating a file using ncgen.
4. Add a detailed description of filtering support
   to the user's guide; see the file filters.md
5. Add a test case directory for this: nc_test4/filter_test.
   It is fragile and a ./configure flags (-enable-filter-test)
   is defined (default disabled) to shut this off this test
   to avoid spurious 'make check' failures.

Note that the HDF5 documentation is not up-to-date, so
much of what is encoded here comes from examining the
actual code in the file H5PL.c in the HDF5 source code.
2017-04-27 13:01:59 -06:00
Dennis Heimbigner
3db4f013bf Primary change: add dap4 support
Specific changes:
1. Add dap4 code: libdap4 and dap4_test.
   Note that until the d4ts server problem is solved, dap4 is turned off.
2. Modify various files to support dap4 flags:
	configure.ac, Makefile.am, CMakeLists.txt, etc.
3. Add nc_test/test_common.sh. This centralizes
   the handling of the locations of various
   things in the build tree: e.g. where is
   ncgen.exe located. See nc_test/test_common.sh
   for details.
4. Modify .sh files to use test_common.sh
5. Obsolete separate oc2 by moving it to be part of
   netcdf-c. This means replacing code with netcdf-c
   equivalents.
5. Add --with-testserver to configure.ac to allow
   override of the servers to be used for --enable-dap-remote-tests.
6. There were multiple versions of nctypealignment code. Try to
   centralize in libdispatch/doffset.c and include/ncoffsets.h
7. Add a unit test for the ncuri code because of its complexity.
8. Move the findserver code out of libdispatch and into
   a separate, self contained program in ncdap_test and dap4_test.
9. Move the dispatch header files (nc{3,4}dispatch.h) to
   .../include because they are now shared by modules.
10. Revamp the handling of TOPSRCDIR and TOPBUILDDIR for shell scripts.
11. Make use of MREMAP if available
12. Misc. minor changes e.g.
	- #include <config.h> -> #include "config.h"
	- Add some no-install headers to /include
	- extern -> EXTERNL and vice versa as needed
	- misc header cleanup
	- clean up checking for misc. unix vs microsoft functions
13. Change copyright decls in some files to point to LICENSE file.
14. Add notes to RELEASENOTES.md
2017-03-08 17:01:10 -07:00
Ward Fisher
9a1f1a92cd Brought definitions into sync 2017-01-09 15:29:19 -07:00
Ward Fisher
5502767d98 Added code to accomodate Visual Studio 2012 in support of https://github.com/Unidata/netcdf-c/issues/304 2017-01-09 13:02:08 -07:00
dmh
764a1c40a3 ckp 2016-04-06 19:51:40 -06:00
Dennis Heimbigner
a8ff523677 ckp 2016-04-06 14:05:58 -06:00
Ward Fisher
f2b8e69ea8 Corrected logic use of USE_PARALLEL for no-hdf5 but still using pnetcdf.
Added fix for github issue http://github.com/Unidata/netcdf-c/issues/143 as suggested by Wei-keng Liao.
2015-11-09 18:21:11 +00:00
Ward Fisher
a81773e5bf Corrected an issue Visual Studio has with how externals are managed. 2015-11-05 12:57:49 -07:00
Dennis Heimbigner
cd7a06b193 pull request 2015-10-12 17:09:37 -06:00
Ward Fisher
aa2af5cd5a Corrected an issue with a dangling endif. 2015-10-09 11:15:15 -06:00
dmh
9f65c3b808 cleanup and squash changes vav master 2015-10-09 10:26:49 -06:00
dmh
8fc86035b2 merge-squash 2015-10-09 10:22:00 -06:00
dmh
087ae58ffd cleanup and squash changes vav master 2015-10-09 10:12:11 -06:00
dmh
49597a64af merge-squash 2015-10-09 10:12:11 -06:00
dmh
2bfe9bba32 cleanup and squash changes vav master 2015-08-16 21:44:18 -06:00
dmh
859f105005 merge-squash 2015-08-15 16:26:35 -06:00
dmh
fab66699d1 Moved libsrc5 to libsrcp
because pnetcdf is used for
more than CDF-5 files.
2015-08-14 20:39:56 -06:00
Ward Fisher
90ff3b728a Corrected a few things to work with MSVC. 2015-06-01 15:26:58 -06:00
dmh
3dd807a155 The original mem branch somehow got
hosed, so I rebuilt it as a new mem2 branch.
2015-05-28 15:10:10 -06:00
Russ Rew
67ad8d89a8 Fix and test resolution of NCF-326, Unlimited Dimensions NC_EEDGE error. 2015-03-10 06:13:07 -06:00
dmh
1739c50622 Modified a number of tests
to make use of remotetest.unidata.ucar.edu
optional. Purpose is purely for testing
new dts and thredds servers.
2014-10-04 15:59:16 -06:00
dmh
af566dd300 In preparation for adding dap4 support, I have cleaned up
the libdap2 code to make it dap2 protocol + netcdf classic
only.
2014-03-24 14:02:52 -06:00
dmh
9d5c8ba308 1. Previous ci of conversion fixes in libdispatch
was incomplete; complete the fix.
2. There is an inconsistency in the netcdfh interface
   about whether rank (# dimensions) is an int or
   size_t. I inadvertently assumed the latter and that
   breaks some API calls; so revert back.
2014-03-10 12:09:36 -06:00
dmh
1b941d342d 1. Attempted to reduce the number of conversion errors
when -Wconversion is set. Fixed libdispatch, but
   rest of netcdf remains to be done.
2014-03-09 15:51:45 -06:00
Quincey Koziol
fd981824c1 Correct handling of variablen-length sequences for attributes, plus uncomment a
bunch of tests that stress this area of the library.

Also clean up some compiler warnings in the dispatch code.
2014-02-14 08:07:14 -06:00
Quincey Koziol
b2dfacbcfa Big clean up to type handling in libsrc4, which makes fill-values work
correctly for variables with string datatype, plus a few other minor changes.
2014-02-11 17:12:08 -06:00
dmh
582410a407 [NCF-273]/HZY-708311
Add a new function called nc_inq_format_extended that
returns more detailed format information (vis-a-vis
nc_inq_format) about an open dataset.

Note that the netcdf API will present the file as if it had
the format specified by nc_inq_format.  The true file
format, however, may not even be a netcdf file; it might be
DAP, HDF4, or PNETCDF, for example. This function returns
that true file type.  It also returns the effective mode for
the file.

signature: nc_inq_format_extended(int ncid, int* formatp, int* modep)
where
* ncid is the NetCDF ID from a previous call to nc_open() or
  nc_create().
* formatp is a pointer to a location for returned true format.
* modep is a pointer to a location for returned mode flags.

Refer to the actual list in the file netcdf.h to see the
currently defined set.

Also added test cases (tst_formatx*).
2013-12-22 12:53:20 -07:00
Quincey Koziol
7a4479be6b Minor cleanups to reduce warnings in headers, and switch from MPI_BYTE to MPI_INT
for MPI_Allreduce() call.
2013-09-14 13:19:58 -05:00
Dennis Heimbigner
b85d3568ec Added the necessary code to support
group renaming. The primary API
is 'nc_rename_grp(int grpid, const char* name)'.
No test cases provided yet.
This also required adding a rename_grp entry
to the dispatch tables.
2013-07-19 21:48:37 +00:00
Russ Rew
6cd8fca60d Quincey's fixes for NCF-250, netCDF-4 parallel independent access with
unlimited dimension hanging.  Extending the size of an unlimited
dimension in HDF5 must be a collective operation, so now an error is
returned if trying to extend in independent access mode.

Quincey's bug fixes for parallel build portability, particularly
OpenMPI on MacOS-X.
2013-07-08 21:31:13 +00:00
Dennis Heimbigner
dea3c726c8 merge trunk into this branch 2013-03-15 20:31:07 +00:00
Ward Fisher
57084316de Merging changes from netCDF branch. 2013-02-28 21:50:55 +00:00
Dennis Heimbigner
5ca78309cc The effect of this change is to make the struct NC structure
contain as little file-type specific info as possible.  It
modifies especially libsrc so that all of the netcdf-3 data
that used to be in struct NC is now kept in a separate chunk
of data pointed to by the struct NC. This makes all of
current protocols consistent: netcdf-3, netcdf-4, and dap.
2012-09-06 19:44:03 +00:00
Dennis Heimbigner
499f8d3a1c complete update of utilities: ncbyte, nclist, ncuri, nclog 2012-08-08 23:15:18 +00:00
Dennis Heimbigner
f1713dcfe9 fix missing #endif 2012-08-01 17:26:06 +00:00