Commit Graph

932 Commits

Author SHA1 Message Date
Ward Fisher
ebd0229749 Merge branch 'main' of https://github.com/Unidata/netcdf-c into minpluginx.dmh 2024-09-30 17:06:15 -06:00
Ward Fisher
7a0999ef3f Fix in support of https://github.com/Unidata/netcdf-c/issues/3007 2024-09-30 16:19:38 -06:00
Dennis Heimbigner
ef425b9171 ckp 2024-09-30 14:39:48 -06:00
Ward Fisher
a7077c6e6e Add configure option to enable potentially-problematic legacy macro _FillValue 2024-09-19 14:56:35 -05:00
Georg Semmler
00a72cf9ca
Add two missing includes 2024-08-26 09:09:01 +02:00
Manuel Reis
9b570f37e3 Recognize _unknown_ S3 server type 2024-07-09 13:45:40 +02:00
Dennis Heimbigner
06d2fe5b13 # Addendum
As suggested by Ward, I ensured that this PR supports
read backward compatibility with old key format.
This addition also adds a test case for this.

## Misc. Other Changes
* Remove some unused code
* Cleanup json error handling
* Fix some more unsigned/signed conversions warning
2024-06-25 17:13:02 -06:00
Dennis Heimbigner
076da97aa4 Convert NCzarr meta-data to use only Zarr attributes
As discussed in a netcdf meeting, convert NCZarr V2 to store all netcdf-4 specific info as attributes. This improves interoperability with other Zarr implementations by no longer using non-standard keys.

## Other Changes
* Remove support for older NCZarr formats.
* Update anonymous dimension naming
* Begin the process of fixing the -Wconversion and -Wsign-compare warnings in libnczarr, nczarr_test, and v3_nczarr_test.
* Update docs/nczarr.md
* Rebuild using the .y and .l files
2024-06-19 18:09:29 -06:00
Dennis Heimbigner
fd637fd460 Cleanup handling of NETCDF_ENABLE_SET_LOG_LEVEL and NETCDF_ENABLE_SET_LOG_LEVEL_FUNC
The NETCDF_ENABLE_SET_LOG_LEVEL_FUNC option is apparently not used, but
is effectively used to set NETCDF_ENABLE_SET_LOG_LEVEL.
This is not clear from the build files CMakeLists.txt and configure.ac.
So this PR cleanups the code to make it more clear what is going on.
2024-05-24 16:48:04 -06:00
Dennis Heimbigner
9a478edb06 Fix duplicate definition when using aws-sdk-cpp.
re: Issue https://github.com/Unidata/netcdf-c/issues/2927

The NC_s3sdkinitialize NC_s3sdkfinalize functions were
misplaced. They should have been moved from ds3util.c to
ncs3sdk_h5.c.  When using ncs3sdl_aws.cpp, this resulted in a
duplicate definition.

Also, found and fixed a memory leak in the NCZarr S3 code.
2024-05-20 19:15:19 -06:00
Dennis Heimbigner
d80c6d27cf Merge branch 'master' into cleanup.dmh 2024-05-15 19:05:54 -06:00
Dennis Heimbigner
f0f0f39950 Cleanup various Zarr-related build issues
# Description
Remove various obsolete build options. Also do some code movement.

## Specific Changes

* The remotetest server is sometimes unstable, so provide a mechanism
  to force disabling calls to remotetest.unidata.ucar.edu.
  This is enabled by adding a repository variable named
  REMOTETESTDOWN with the value "yes".
* Fix CMakeLists.txt to use the uname command as an alternate
  to using the hostname command (which does not work under cygwin).
* Remove the JNA stuff as obsolete
* Remove the ENABLE_CLIENTSIDE_FILTERS options since it has been
  disabled for a while.
* Fix bad option flag in some github action .yml files: change --disable-xml2 to --disable-libxml2
* Collect globalstate definitions into nc4internal.h
* Remove ENABLE_NCZARR_FILTERS_TESTING option as obsolete and replace
  with ENABLE_NCZARR_FILTERS
* Move some dispatcher independent functions from libsrc4/nc4internal.c to libdispatch/ddispatch.c
* As a long term goal, and because it is now the case that --enable-nczarr
    => USE_NETCDF4, make the external options --enable-netcdf-4 and
    --enable-netcdf4 obsolete in favor of --enable-hdf5
    We will do the following for one more release cycle.
        1. Make --enable-netcdf-4 be an alias for --enable-netcdf4.
        2. Make --enable-netcdf4 an alias for --enable-hdf5.
        3. Internally, convert most uses of USE_NETCDF_4 ad USE_NETCDF4 to USE_HDF5
    After the next release, --enable-netcdf-4 and --enable-netcdf4 will
    be removed.
2024-05-15 18:46:25 -06:00
Peter Hill
54fb03e69b
Fix conversion warning in flag set/check/clear macros 2024-04-25 09:39:57 +01:00
Ward Fisher
c26f7eabf4 Refactor macro _FillValue to NC_FillValue in support of https://github.com/Unidata/netcdf-c/issues/2858 2024-04-24 11:38:07 -06:00
Georg Semmler
4693556520
Rename the vendored strlcat symbol
Fixes #927
2024-04-08 13:13:08 +02:00
Ward Fisher
e8e867bf10
Merge pull request #2883 from ZedThree/silence-libsrc-warnings
Silence most warnings in `libsrc`
2024-03-21 16:57:05 -06:00
Ward Fisher
fa6df050ce
Merge pull request #2874 from ZedThree/silence-libhdf5-warnings
Silence most warnings in libhdf5
2024-03-20 17:26:58 -06:00
Ward Fisher
37e6b92703
Merge pull request #2895 from K20shores/prefix_options
Prefix all options with NETCDF_
2024-03-20 12:07:23 -06:00
Ward Fisher
c38cfc5d7c Remove dangling define in netcdf_meta.h template file. 2024-03-19 11:37:40 -06:00
Kyle Shores
8fd6dcb979 Replace ENABLE_S3 with NETCDF_ENABLE_S3 2024-03-18 15:54:15 -05:00
Kyle Shores
dba34ac5c2 Replace ENABLE_PNETCDF with NETCDF_ENABLE_PNETCDF 2024-03-18 15:54:02 -05:00
Kyle Shores
2baf0ba862 Replace ENABLE_PARALLEL4 with NETCDF_ENABLE_PARALLEL4 2024-03-18 15:53:49 -05:00
Kyle Shores
d1334f7b88 Replace ENABLE_NCZARR with NETCDF_ENABLE_NCZARR 2024-03-18 15:52:19 -05:00
Kyle Shores
d270aa8e93 Replace ENABLE_DAP with NETCDF_ENABLE_DAP 2024-03-18 15:51:14 -05:00
Kyle Shores
b4eb8bf019 Replace ENABLE_BYTERANGE with NETCDF_ENABLE_BYTERANGE 2024-03-18 15:50:57 -05:00
Peter Hill
ab052f65ec
Fix default type for alloca argument 2024-03-11 15:53:31 +00:00
Ward Fisher
cc1494d988
Merge branch 'main' into awsdfalt.dmh 2024-03-05 12:50:08 -07:00
Peter Hill
04db10e5c1
Change NC_ATT_INFO.len to size_t
Fixes about 20 warnings
2024-03-04 17:05:03 +00:00
Ward Fisher
d59660ccc7 Updated netcdf_json.h 2024-02-07 10:20:02 -07:00
Ward Fisher
fb537e61eb Correct previous fix to remove inclusion of internal header. 2024-02-07 10:18:37 -07:00
Ward Fisher
f557108b16 Make changes in support of https://github.com/Unidata/netcdf-c/issues/2859 2024-02-06 10:35:46 -07:00
Ward Fisher
16bcb1ddb9 Merge branch 'silence-nclist-warnings' of https://github.com/ZedThree/netcdf-c into rebase-gh2812.wif 2024-01-19 11:11:21 -07:00
Kyle Shores
e995c2e696 moving the version into the project command in cmake 2024-01-05 10:06:32 -06:00
Ward Fisher
c1fb4b0bae
Merge pull request #2809 from ZedThree/silence-malloc-warnings
Silence conversion warnings from `malloc` arguments
2023-12-21 17:20:56 -07:00
Ward Fisher
1442762331
Merge branch 'main' into idint.dmh 2023-12-18 15:23:39 -07:00
Sean McBride
4f15a9265e Removed a use of sprintf that required changing a function signature 2023-12-08 13:30:54 -05:00
Dennis Heimbigner
27f615bebc Properly handle missing regions in URLS
NOTE: it is important that this fix gets into 4.9.3

re: Issue https://github.com/Unidata/netcdf-c/issues/2798

## Modifications
* This PR includes PR https://github.com/Unidata/netcdf-c/pull/2813
* Support the following AWS environment variables in the internal S3 library
  (they are already supported by aws-sdk-cpp).
  - AWS_REGION
  - AWS_DEFAULT_REGION
  - AWS_ACCESS_KEY_ID
  - AWS_CONFIG_FILE
  - AWS_PROFILE
  - AWS_SECRET_ACCESS_KEY
  - (source https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html).
* Support an empty region when specifying s3.amazonaws.com as the host.
* Move some S3/AWS related functions to ds3util.c
* Add a test case to test empty region and AWS_[DEFAULT]_REGION.
2023-12-02 21:03:59 -07:00
Dennis Heimbigner
58dd53022f Fix some important bugs in various files
The most critical bug is in nch5s3comms.c.
I for some reason assumed that signing keys
did not contain any zero bytes. But obviously
it can, so a test was removed.

Other fixes:
1. Guarantee allocated memory is initialized to all zeros.
2. Cleanup errmsg handling in libncpoco.
3. Fix processing of aws list-objects-v2 because I misread the syntax.
2023-11-27 18:46:10 -07:00
Peter Hill
99f5ec3f24
Include header for size_t in nclist.h 2023-11-27 09:22:29 +00:00
Peter Hill
d07dac918c
Silence conversion warnings from malloc arguments
Mostly just add an explicit cast when calling `malloc` and its
variants. Sometimes instead change the type of a local variable if
this would silence multiple warnings.
2023-11-24 18:20:52 +00:00
Ward Fisher
9fe1a346ba
Merge branch 'main' into dap4ce.dmh 2023-11-16 12:22:11 -07:00
Ward Fisher
33c77f3c59
Merge branch 'main' into tinyxmlupdate.dmh 2023-11-15 15:33:47 -07:00
Dennis Heimbigner
b10ab54b56 Update to latest master 2023-11-04 20:45:40 -06:00
Dennis Heimbigner
87497d79cf update 2023-11-04 16:08:59 -06:00
Dennis Heimbigner
bef8cf0460 Reduce warning by changing type of NC_OBJ.id.
re: https://github.com/Unidata/netcdf-c/issues/2780

As noted in the above issue, changing the NC_OBJ.id field
type from size_t to int reduces irrelevant warning.
There is no semantic effect since the number of distinct ids
will never approach the max positive integer value.
Note that this could change in the future if the id becomes
more than a simple counter.
2023-10-25 15:14:29 -06:00
Dennis Heimbigner
24e49b818e Update internal tinyxml2 code to the latest version
Periodic update of the internal tinyxml2 code for processing
XML.  This also required some changes to the "tinyxml2" target
in libncxml/Makefile.am to modify the code to compile in the
netcdf-c environment.
2023-10-12 16:22:47 -06:00
Dennis Heimbigner
5fa2defc7e Improve fetch performance of DAP4
Prior to this PR, DAP4 always fetched the whole (constrained) dataset
This PR changes the query processing so
1. It reads data on a per-variable request (equivalent to calling nc_get_var()).
2. It tracks a response for every query.

Most of the changes reflect having to do per-variable requests.
In any case, doing all this significantly reduces the amount of data transmitted and hence speeds up DAP4 requests.
2023-10-08 19:59:28 -06:00
Dennis Heimbigner
1552d894a2 Cleanup a number of issues.
re: Issue https://github.com/Unidata/netcdf-c/issues/2748

This PR fixes a number of issues and bugs.

## s3cleanup fixes
* Delete extraneous s3cleanup.sh related files.
* Remove duplicate s3cleanup.uids entries.

## Support the Google S3 API
* Add code to recognize "storage.gooleapis.com"
* Add extra code to track the kind of server being accessed: unknown, Amazon, Google.
* Add a new mode flag "gs3" (analog to "s3") to support this api.
* Modify the S3 URL code to support this case.
* Modify the listobjects result parsing because Google returns some non-standard XML elements.
* Change signature and calls for NC_s3urlrebuild.

## Handle corrupt Zarr files where shape is empty for a variable.
Modify behavior when a variable's "shape" dictionary entry.
Previously it returned an error, but now it suppresses such a variable.
This change makes it possible to read non-corrupt data from the file.
Also added a test case.

## Misc. Other Changes
* Fix the nclog level handling to suppress output by default.
* Fix de-duplicates code in ncuri.c
* Restore testing of iridl.ldeo.columbia.edu.
* Fix bug in define_vars() which did not always do a proper reclaim between variables.
2023-10-08 11:22:52 -06:00
Ward Fisher
3c013ce342 Merged in current state of https://github.com/Unidata/netcdf-c/pulls/2741 2023-09-29 15:05:43 -06:00
Dennis Heimbigner
df3636b959 Mitigate S3 test interference + Unlimited Dimensions in NCZarr
This PR started as an attempt to add unlimited dimensions to NCZarr.
It did that, but this exposed significant problems with test interference.
So this PR is mostly about fixing -- well mitigating anyway -- test
interference.

The problem of test interference is now documented in the document docs/internal.md.
The solutions implemented here are also describe in that document.
The solution is somewhat fragile but multiple cleanup mechanisms
are provided. Note that this feature requires that the
AWS command line utility must be installed.

## Unlimited Dimensions.
The existing NCZarr extensions to Zarr are modified to support unlimited dimensions.
NCzarr extends the Zarr meta-data for the ".zgroup" object to include netcdf-4 model extensions. This information is stored in ".zgroup" as dictionary named "_nczarr_group".
Inside "_nczarr_group", there is a key named "dims" that stores information about netcdf-4 named dimensions. The value of "dims" is a dictionary whose keys are the named dimensions. The value associated with each dimension name has one of two forms
Form 1 is a special case of form 2, and is kept for backward compatibility. Whenever a new file is written, it uses format 1 if possible, otherwise format 2.
* Form 1: An integer representing the size of the dimension, which is used for simple named dimensions.
* Form 2: A dictionary with the following keys and values"
   - "size" with an integer value representing the (current) size of the dimension.
   - "unlimited" with a value of either "1" or "0" to indicate if this dimension is an unlimited dimension.

For Unlimited dimensions, the size is initially zero, and as variables extend the length of that dimension, the size value for the dimension increases.
That dimension size is shared by all arrays referencing that dimension, so if one array extends an unlimited dimension, it is implicitly extended for all other arrays that reference that dimension.
This is the standard semantics for unlimited dimensions.

Adding unlimited dimensions required a number of other changes to the NCZarr code-base. These included the following.
* Did a partial refactor of the slice handling code in zwalk.c to clean it up.
* Added a number of tests for unlimited dimensions derived from the same test in nc_test4.
* Added several NCZarr specific unlimited tests; more are needed.
* Add test of endianness.

## Misc. Other Changes
* Modify libdispatch/ncs3sdk_aws.cpp to optionally support use of the
   AWS Transfer Utility mechanism. This is controlled by the
   ```#define TRANSFER```` command in that file. It defaults to being disabled.
* Parameterize both the standard Unidata S3 bucket (S3TESTBUCKET) and the netcdf-c test data prefix (S3TESTSUBTREE).
* Fixed an obscure memory leak in ncdump.
* Removed some obsolete unit testing code and test cases.
* Uncovered a bug in the netcdf-c handling of big-endian floats and doubles. Have not fixed yet. See tst_h5_endians.c.
* Renamed some nczarr_tests testcases to avoid name conflicts with nc_test4.
* Modify the semantics of zmap\#ncsmap_write to only allow total rewrite of objects.
* Modify the semantics of zodom to properly handle stride > 1.
* Add a truncate operation to the libnczarr zmap code.
2023-09-26 16:56:48 -06:00