Commit Graph

1033 Commits

Author SHA1 Message Date
Ward Fisher
988e771a9e
Merge pull request #2171 from DennisHeimbigner/fixmingw.dmh
Support MSYS2/Mingw platform
2022-01-04 16:17:37 -07:00
Dave Allured
b58165f755
tst_misc.sh: Fix hang in make check 2021-12-23 23:18:43 -07:00
Dennis Heimbigner
9380790ea8 Support MSYS2/Mingw platform
re:

The current netcdf-c release has some problems with the mingw platform
on windows. Mostly they are path issues.

Changes to support mingw+msys2:
-------------------------------
* Enable option of looking into the windows registry to find
  the mingw root path. In aid of proper path handling.
* Add mingw+msys as a specific platform in configure.ac and move testing
  of the platform to the front so it is available early.
* Handle mingw X libncpoco (dynamic loader) properly even though
  mingw does not yet support it.
* Handle mingw X plugins properly even though mingw does not yet support it.
* Alias pwd='pwd -W' to better handle paths in shell scripts.
* Plus a number of other minor compile irritations.
* Disallow the use of multiple nc_open's on the same file for windows
  (and mingw) because windows does not seem to handle these properly.
  Not sure why we did not catch this earlier.
* Add mountpoint info to dpathmgr.c to help support mingw.
* Cleanup dpathmgr conversions.

Known problems:
---------------
* I have not been able to get shared libraries to work, so
  plugins/filters must be disabled.
* There is some kind of problem with libcurl that I have not solved,
  so all uses of libcurl (currently DAP+Byterange) must be disabled.

Misc. other fixes:
------------------
* Cleanup the relationship between ENABLE_PLUGINS and various other flags
  in CMakeLists.txt and configure.ac.
* Re-arrange the TESTDIRS order in Makefile.am.
* Add pseudo-breakpoint to nclog.[ch] for debugging.
* Improve the documentation of the path manager code in ncpathmgr.h
* Add better support for relative paths in dpathmgr.c
* Default the mode args to NCfopen to include "b" (binary) for windows.
* Add optional debugging output in various places.
* Make sure that everything builds with plugins disabled.
* Fix numerous (s)printf inconsistencies betweenb the format spec
  and the arguments.
2021-12-23 22:18:56 -07:00
Dennis Heimbigner
289103d2b1 Merge branch 'master' into zarrs3.dmh 2021-10-07 15:10:03 -06:00
Dennis Heimbigner
dc2ecc74ac (1) improve INI parser (2) Fix make discheck 2021-09-30 13:45:09 -06:00
Edward Hartnett
5200477de1 now nsd of 0 is NC_EINVAL for nc_def_var_quantize() 2021-09-10 06:10:20 -06:00
Edward Hartnett
0ce463761c
Merge branch 'main' into ejh_quantize_2 2021-09-07 10:44:45 -06:00
Dennis Heimbigner
11fe00ea05 Add filter support to NCZarr
Filter support has three goals:

1. Use the existing HDF5 filter implementations,
2. Allow filter metadata to be stored in the NumCodecs metadata format used by Zarr,
3. Allow filters to be used even when HDF5 is disabled

Detailed usage directions are define in docs/filters.md.

For now, the existing filter API is left in place. So filters
are defined using ''nc_def_var_filter'' using the HDF5 style
where the id and parameters are unsigned integers.

This is a big change since filters affect many parts of the code.

In the following, the terms "compressor" and "filter" and "codec" are generally
used synonomously.

### Filter-Related Changes:
* In order to support dynamic loading of shared filter libraries, a new library was added in the libncpoco directory; it helps to isolate dynamic loading across multiple platforms.
* Provide a json parsing library for use by plugins; this is created by merging libdispatch/ncjson.c with include/ncjson.h.
* Add a new _Codecs attribute to allow clients to see what codecs are being used; let ncdump -s print it out.
* Provide special headers to help support compilation of HDF5 filters when HDF5 is not enabled: netcdf_filter_hdf5_build.h and netcdf_filter_build.h.
* Add a number of new test to test the new nczarr filters.
* Let ncgen parse _Codecs attribute, although it is ignored.

### Plugin directory changes:
* Add support for the Blosc compressor; this is essential because it is the most common compressor used in Zarr datasets. This also necessitated adding a CMake FindBlosc.cmake file
* Add NCZarr support for the big-four filters provided by HDF5: shuffle, fletcher32, deflate (zlib), and szip
* Add a Codec defaulter (see docs/filters.md) for the big four filters.
* Make plugins work with windows by properly adding __declspec declaration.

### Misc. Non-Filter Changes
* Replace most uses of USE_NETCDF4 (deprecated) with USE_HDF5.
* Improve support for caching
* More fixes for path conversion code
* Fix misc. memory leaks
* Add new utility -- ncdump/ncpathcvt -- that does more or less the same thing as cygpath.
* Add a number of new test to test the non-filter fixes.
* Update the parsers
* Convert most instances of '#ifdef _MSC_VER' to '#ifdef _WIN32'
2021-09-02 17:04:26 -06:00
Edward Hartnett
18aebd9a15 added parallel I/O quantize test 2021-09-02 10:21:44 -06:00
Edward Hartnett
f880a63f73 added parallel I/O quantize test 2021-09-02 10:18:42 -06:00
Edward Hartnett
09defc5c72 more tests for quantize 2021-09-02 08:18:27 -06:00
Edward Hartnett
ae3b083e20 turned off failing quantize test 2021-09-01 02:29:17 -06:00
Edward Hartnett
3e056f4f35 more tests 2021-09-01 02:24:28 -06:00
Edward Hartnett
4cd4aff1af testing with fill values 2021-08-31 07:12:46 -06:00
Edward Hartnett
e3c8be89f6 testing with fill values 2021-08-31 07:10:54 -06:00
Edward Hartnett
f809aadc6c testing with fill values 2021-08-31 06:59:59 -06:00
Edward Hartnett
bb40936a7e more testing with type conversion 2021-08-31 06:42:30 -06:00
Edward Hartnett
1e6ad091b6 type conversion with quantize between float and double 2021-08-29 23:06:16 -06:00
Edward Hartnett
5d1aa2a926 added more documentation, also started on test code for type conversion 2021-08-29 22:34:14 -06:00
Edward Hartnett
f5e2926f02 testing of quantize with scalars 2021-08-29 22:25:57 -06:00
Edward Hartnett
229e101569 quantize now working for NC_DOUBLE 2021-08-29 20:50:19 -06:00
Edward Hartnett
d3e725b3c8 attempting to fix ncdap test on appvayor 2021-08-29 20:39:51 -06:00
Edward Hartnett
ed60a16529 moving quantize to its own function 2021-08-29 08:42:21 -06:00
Edward Hartnett
5aa429cda4 whitespace cleanup 2021-08-29 01:13:39 -06:00
Edward Hartnett
bec26aa3de more quantize testing 2021-08-29 01:04:09 -06:00
Edward Hartnett
eabbd686b0 bitgroom working for floats 2021-08-29 00:30:17 -06:00
Edward Hartnett
0265953207 more quantize testing 2021-08-26 07:24:22 -06:00
Edward Hartnett
c609a17a4f more quantize testing 2021-08-26 07:21:07 -06:00
Edward Hartnett
539578dab8 more tests for quantization 2021-08-26 06:37:45 -06:00
Edward Hartnett
c655488400 more quantize testing 2021-08-25 02:17:57 -06:00
Edward Hartnett
ee788d6f25 more quantize testing 2021-08-25 02:07:09 -06:00
Edward Hartnett
4ac7fa9584 more quantize testing 2021-08-25 02:00:14 -06:00
Edward Hartnett
b2c0bb9810 more quantize testing 2021-08-25 01:54:25 -06:00
Edward Hartnett
a02faa0cb5 more testing of qunatize setting 2021-08-25 01:45:38 -06:00
Edward Hartnett
148706b657 now reading quantize attribute to get settings 2021-08-24 03:35:52 -06:00
Edward Hartnett
d6d9825b2c now qunatizing with inq function in dispatch table 2021-08-24 01:53:16 -06:00
Edward Hartnett
9a18689ffa getting ready for next try at quantization code 2021-08-24 00:45:38 -06:00
Greg Sjaardema
28457cb570 Disable varible rename test
This PR adds the coordinate dimids to all variables; previously 1D
variables did not have it.  There is an issue with renaming variables
with the coordinate dimid which is now exposed in this test which
renames a 1D variable.

Disabling parts of this test until the variable renaming code can be
refactored.
2021-08-12 10:56:39 -06:00
Ward Fisher
9f798e2ed6 Merge branch 'virtual_datasets' of https://github.com/d70-t/netcdf-c into gh1983.wif 2021-07-19 09:44:35 -07:00
Ward Fisher
b6c3568ec0 Fix in support of https://github.com/Unidata/netcdf-c/issues/2027 2021-07-06 11:34:30 -06:00
Dennis Heimbigner
4bf58c65dd fix conflicts 2021-06-02 10:59:26 -06:00
Ward Fisher
94262989eb
Merge pull request #1991 from gsjaardema/eliminate_need_for_hdf5-1.6-API
Remove need for HDF5-1.6 API being defined
2021-06-01 16:36:28 -06:00
Ward Fisher
384e77d9fe
Merge pull request #2012 from DennisHeimbigner/dimscope.dmh
Regularize the scoping of dimensions
2021-06-01 16:28:12 -06:00
Ward Fisher
7446311dfd
Merge pull request #2014 from Unidata/fix-makedist.wif
Another PR to fix 'make distcheck' issues that had crept in.
2021-06-01 15:26:23 -06:00
Ward Fisher
c41f7943cb
Merge branch 'master' into dimscope.dmh 2021-06-01 14:12:04 -06:00
Ward Fisher
e21ef7bcb0
Merge branch 'master' into dap4fixes2.dmh 2021-06-01 14:11:39 -06:00
Ward Fisher
64fa63a774 Clean up stray file that was fouling make distcheck 2021-06-01 13:55:10 -06:00
Dennis Heimbigner
ec5b3f9a4f Regularize the scoping of dimensions
This is a follow-on to pull request
````https://github.com/Unidata/netcdf-c/pull/1959````,
which fixed up type scoping.

The primary changes are to _nc\_inq\_dimid()_ and to ncdump.

The _nc\_inq\_dimid()_ function is supposed to allow the name to be
and FQN, but this apparently never got implemented. So if was modified
to support FQNs.

The ncdump program is supposed to output fully qualified dimension names
in its generated CDL file under certain conditions.

Suppose ncdump has a netcdf-4 file F with variable V, and V's parent group
is G. For each dimension id D referenced by V, ncdump needs to determine
whether to print its name as a simple name or as a fully qualified name (FQN).

The algorithm is as follows:

1. Search up the tree of ancestor groups.
2. If one of those ancestor groups contains the dimid, then call it dimgrp.
3. If one of those ancestor groups contains a dim with the same name as the dimid, but with a different dimid, then record that as duplicate=true.
4. If dimgrp is defined and duplicate == false, then we do not need an fqn.
5. If dimgrp is defined and duplicate == true, then we do need an fqn to avoid incorrectly using the duplicate.
6. If dimgrp is undefined, then do a preorder breadth-first search of all the groups looking for the dimid.
7. If found, then use the fqn of the first found such dimension location.
8. If not found, then fail.

Test case ncdump/test_scope.sh was modified to test the proper
operation of ncdump and _nc\_inq\_dimid()_.

Misc. Other Changes:
* Fix nc_inq_ncid (NC4_inq_ncid actually) to return root group id if the name argument is NULL.
* Modify _ncdump/printfqn_ to print out a dimid FQN; this supports verification that the resulting .nc files were properly created.
2021-05-31 15:51:12 -06:00
Dennis Heimbigner
e632d02041 Re-enable DAP2 authorization tests
The thredds-test server now has some password protected datasets
that can be used to test DAP2 authorization support.
The general location is
````
https://thredds.ucar.edu/thredds/tdscapabilities/authTest.html
````
and specifically:
````
https://thredds.ucar.edu/thredds/dodsC/test3/testData.nc.html
````

This PR replaces old testcases with ncdap_test/testauth.sh.
This testcase allows us to test use of the .dodsrc file and .netrc file
and embedded user+pwd.

As part of this, I had to create a program (ncdap_test/pathcvt.c)
that is essentially the equivalent to cygpath. Given a path in
windows, unix, msys or cygwin format, it converts it to the
equivalent format in one of those four cases.  So it can be used
to convert a cygwin path to a windows path, for example. This is
needed in testpathcvt and testauth to make sure that the paths
in .daprc (e.g. the reference to .netrc) are of the proper
format.

Misc. Other Changes:
1. Fix some memory leaks in libdap2
2. Setting the env variable CURLOPT_VERBOSE allows tracking of curl
   operations.
3. Make tst_charvlenbug be conditional on NC_VLEN_NOTEST.
2021-05-29 21:30:33 -06:00
Greg Sjaardema
e2d0bbb8ea
Merge branch 'master' into eliminate_need_for_hdf5-1.6-API 2021-05-28 07:11:13 -06:00