Commit Graph

309 Commits

Author SHA1 Message Date
Greg Sjaardema
4cbfc0f66e
Fix compression level settings
* level is unsigned, so can never be < 0
* If level is 0, then don't enable deflate filter.
2018-01-31 10:02:09 -07:00
Dennis Heimbigner
3e47f5f300 Rebuilt the filter parameter handling code to use a common
parser everywhere.
2018-01-23 16:00:11 -07:00
Ward Fisher
0f5fc7222b
Merge branch 'master' into plugins.dmh 2018-01-18 15:46:50 -07:00
Ed Hartnett
cf92670687 added guards for header files that needed them 2018-01-17 09:20:20 -07:00
Ed Hartnett
09ee32b205 fixed some header files, checked some return values 2018-01-17 08:25:15 -07:00
Dennis Heimbigner
99fccab359 1. Keep up to date by merging master
2. Fixed plugin building (nc_test4/hdf5plugins)
   to be done properly by cmake and automake.
4. Duplicated part of the nc_test4 filter test code
   in examples/C

An incomplete and untested set of hooks exist
for OS-X in nc_test4/findplugins.in. They need testing.
2018-01-16 11:00:09 -07:00
Ed Hartnett
4de61e21f2 more docs, more cleaning 2017-12-04 12:21:14 -07:00
Ed Hartnett
7e662c6b87 fixed easy warnings 2017-11-20 05:55:04 -07:00
Ed Hartnett
3b82328902
Merge branch 'master' into ejh_more_warnings 2017-11-15 03:41:12 -07:00
Ward Fisher
365afca7be Replaced the overwritten updated parsefilterflag 2017-11-13 13:19:46 -07:00
Ward Fisher
efff646587 Quick test of something to resolve conflict in generated files. 2017-11-13 12:33:19 -07:00
Ward Fisher
16d6f94f30 Merge branch 'master' into filters.dmh 2017-11-13 11:15:02 -07:00
Ed Hartnett
0e0482bc05 fixed warnings 2017-11-09 06:24:18 -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
733da154c5 1. Keep up to date by merging master
2. Factored out the parameter string parsing for ncgen and nccopy
   int libdispatch/dfilter.c + include/ncfilter.h
3. Allow a parameter string to use constant types other than
   unsigned int. See docs/filters.md for details.
4. Moved the old content of  include/netcdf_filter.h into include/netcdf.h
   and removed include/netcdf_filter.h as no longer needed.
5. Force the test filter (bzip2) in nc_test4/filter_test to
   be built using BUILT_SOURCES.
2017-10-08 15:56:45 -06:00
Ward Fisher
143fb237f9 Disabled CDF5 generation support for ncgen if USE_CDF5 is false. 2017-09-18 13:31:15 -06:00
Ward Fisher
399a43ae89 Updated nc_test to respect USE_CDF5 2017-09-18 13:24:11 -06:00
Dennis Heimbigner
ddacf2db38 When ncgen is invoked without a -k flag,
it tries to infer the file kind based on
the constructs and types used in the .cdl
file. Previously, it included cdf5 as an
inferrable kind, but this is almost never
what is wanted. So limit inferable kinds
to netcdf classic vs netcdf enhanced.
Also fix tst_inttags4.sh test.
2017-09-15 21:03:05 -06:00
Dennis Heimbigner
86fc8745dc merge master and resolve conflicts 2017-08-12 15:50:31 -06:00
Dennis Heimbigner
e2e7c20444 Merge branch 'v4.5.0-release-branch' into ncgenutf8.dmh 2017-06-18 16:38:13 -06:00
Ward Fisher
08c51e6064 Corrected a couple issues uncovered when revisiting https://github.com/Unidata/netcdf-c/issues/244 2017-06-14 14:01:09 -06:00
Dennis Heimbigner
30846cfff1 Cmake 2017-06-06 16:21:04 -06:00
Dennis Heimbigner
8f2f9b74e3 re: pull request https://github.com/Unidata/netcdf-c/pull/364
This is a follow-on in that the old utf8 code was still being
used in ncgen to convert utf8->utf16 when converting cdl to Java
(see genj.c).

The new code apparently has no utf16 support, but it does have
utf32 support. Converting utf32 -> utf16 can be approximated by
truncating the 32bits to 16 bits, unless the top 16 bits are
not zero. This latter condition is unlikely to be common because
it implies use of some rather obscure characters.

So solution is to convert to utf32 and truncate to 16 bits to
get utf16. An error is reported if the high-order truncated 16
bits are not zero. If we get complaints, then I will figure out
how to convert full utf32 to a utf16 pair.

Also removed the old code from ncgen.
2017-06-06 15:23:59 -06:00
Ward Fisher
37e3f0a6eb Removed redundant scripts. 2017-05-24 14:41:55 -06:00
Ward Fisher
cc496d0c6f Corrected a typo. 2017-05-24 14:33:55 -06:00
Ward Fisher
59ded4a82c Moving some tests around so that 'make check' works properly, in support of https://github.com/Unidata/netcdf-c/issues/339 2017-05-24 14:25:22 -06:00
Dennis Heimbigner
d37ac215e2 Add new capabilities to filter code:
1. Allow nccopy to apply filters, especially on the output file.
   This provides a third way to do this other than using ncgen or
   programatically
2. Make sure that even if the filter code is not available, it is
   possible to see the filter id and parameters for variables using
   e.g ncdump -hs.
3. Fix bug in nccopy so that the input file does
   not necessarily have to be netcdf-4.
4. At last minute decided to change to using a
   single "_Filter" attribute for ncgen
5. Added a test to tst_filter.sh to generate C code using ncgen.
2017-05-14 18:10:02 -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
Ward Fisher
8dddd222a3 Merged master, DAP4 support into branch. 2017-04-19 09:29:35 -06:00
Dennis Heimbigner
32fe709615 ckp 2017-04-14 11:05:30 -06:00
Dennis Heimbigner
6a4ba35565 Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh)
1. Cleanup test_common.sh to expunge (mostly) the use of the VS
   path value. This has the effect of being unable to use the
   Visual Studio C compiler for shell tests.
2. There is a missing case in CMakeLists.txt so add
   defaulting for HDF5_C_LIBRARY_hdf5 using HDF5_C_LIBRARY.
   Ward should probably examine this to get it fixed correctly.
3. Put back ref to esg.md in docs/Doxyfile.in
4. Fix minor warning in dut8proc.h
2017-04-10 09:26:57 -06:00
Dennis Heimbigner
6d8809100f Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh)
1. When running under windows (as opposed to cygwin)
   we need to make sure to not user /cygdrive/ file paths.
   This was ocurring in libdap4/d4read.c, but may occur
   elsewhere.
2. Shell scripts in the git repo are not being checked-out
   with the executable mode set. Had core.filemode set to false.
   Was a major hassle to fix.
2017-04-03 21:39:44 -06:00
Dennis Heimbigner
7d9a1107c9 Master merge to remove conflicts 2017-03-29 14:40:08 -06:00
Ward Fisher
156e6a8e39 Merged master into ghpull-375 2017-03-27 15:31:34 -06:00
Dennis Heimbigner
80390b94e5 keep up-to-date with master 2017-03-27 12:16:24 -06:00
Dennis Heimbigner
38bf48d2ca re: gihub issue https://github.com/Unidata/netcdf-c/issues/380
Re: esupport ticket support-netcdf : SKS-534087
Ncgen treats an integer with just a U/u suffix as uint64 instead of uint32.
Fix is in ncgen.l
2017-03-24 18:56:14 -06:00
Ward Fisher
eeb673bf8c Merge branch 'master' into ghpull-375 2017-03-22 11:24:56 -06:00
Dennis Heimbigner
24414335f3 debug cmake failures 2017-03-20 14:40:00 -06:00
Dennis Heimbigner
8e290f2aec CMake fixes 2017-03-20 14:28:38 -06:00
Dennis Heimbigner
44e52e0515 More distcheck cleanup 2017-03-20 13:50:44 -06:00
Dennis Heimbigner
a763bb51d4 Add the intermediate file to be cleaned up 2017-03-18 18:47:19 -06:00
Dennis Heimbigner
cb473bf6ff Apparently we have no .cdl test cases that have
a global attribute whose type is an enum.

Turns out this case fails because of an
oversight in ncgen.

This pr fixes that problem (in semantics.c).
Also added test case .cdl file: tst_gattenum.cdl
2017-03-18 17:57:48 -06:00
Ward Fisher
53c018a3f6 Attempting to fix visual studio errors in support of https://github.com/Unidata/netcdf-c/pull/375 2017-03-13 15:12:47 -06:00
Ward Fisher
287374aee4 Regenerated parser files on ARM. 2017-03-09 13:23:30 -07:00
Ward Fisher
8e3790f7ce Merged master. 2017-03-09 12:53:28 -07: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
78c0f34c82 Merging master into branch. 2017-02-27 11:00:24 -07:00
Dennis Heimbigner
ba429bcc56 Add comment to explain change of OPAQUE to OPAQUE_ 2017-02-23 22:51:32 -07:00
Dennis Heimbigner
0415300fbc It appears that the token OPAQUE in ncgen.y
is somehow in interference with something
in the HDF4 code. So, I changed
the OPAQUE -> OPAQUE_ and that appears
to fix the problem with bison when HDF4
is enabled.

ps. when Visual Studio complained about token
'constant' it turn out that it mean token type,
not the actual token named 'constant'. Instead
the actual token that was causing the problem
was 'OPAQUE'.
2017-02-23 22:34:11 -07:00
Ward Fisher
1cdde8bbd2 Invoked makeparser from OSX. 2017-02-23 12:22:44 -07:00