Commit Graph

923 Commits

Author SHA1 Message Date
Kyle Shores
e995c2e696 moving the version into the project command in cmake 2024-01-05 10:06:32 -06:00
Ward Fisher
489d978f63
Merge pull request #2595 from johnwparent/import-mpi-dep-on-export
CMake: Add improvements to MPI support
2023-12-12 13:57:20 -07:00
Ward Fisher
61c9a8641d Fix cmake syntax typo. 2023-12-12 10:06:55 -07:00
Ward Fisher
ed90d50078 Typo fix in support of gh2824.wif 2023-12-12 10:04:18 -07:00
Ward Fisher
8d422704ec Replace exec_program with execute_process 2023-10-27 12:20:46 -06:00
Ward Fisher
a5d15a5857
Merge pull request #2776 from ZedThree/cmake-optional-uninstall-target
CMake: Don't add uninstall target and CPack config if not top-level
2023-10-27 10:58:34 -06:00
Peter Hill
b41b79a8e5
CMake: Add backport of PROJECT_IS_TOP_LEVEL for CMake <3.21 2023-10-25 11:50:07 +01:00
Ward Fisher
d476629704 Replace accidental flag removal 2023-10-24 13:16:11 -06:00
Ward Fisher
347b2504bf Undo previous change. 2023-10-24 13:15:12 -06:00
Ward Fisher
dcad99082d Remove sensitive info being sent to standard output when using ctest scripts. 2023-10-24 11:13:04 -06:00
Peter Hill
523c648e5d
CMake: Don't add uninstall target and CPack config if not top-level
Fixes #2597
2023-10-23 10:20:29 +01:00
Ward Fisher
17a7577701 Revert a change made in d3c2cf236 that is proving confounding in MSYS2-based bash environments. 2023-10-09 10:51:13 -06:00
Ward Fisher
b62da98420
Merge pull request #2757 from ZedThree/cmake-fix-hdf5-zlib-check
CMake: Change header in check for HDF5 zlib/szip support
2023-10-02 16:22:55 -06:00
Peter Hill
b6cb581cec
CMake: Change header in check for HDF5 zlib/szip support
H5public.h might require MPI headers which we haven't found at this
point

Fixes #2742
2023-10-02 10:13:26 +01: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
2bb6013dfd Update S3 subtree 2023-09-27 18:53:45 -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
Ward Fisher
99e8ff31d8 Add a missing include_directories invocation in CMakeLists.txt 2023-09-05 14:38:48 -06:00
Ward Fisher
af07326a6b Disable 'force internal S3 on Windows' 2023-08-30 10:17:00 -06:00
Ward Fisher
2e25cfc25a Added checks for -lssl and -lcrypto for cmake-based builds. We can't assume they are available. 2023-08-29 12:15:15 -05:00
Ward Fisher
ac4aade4f2 Add an explicit check for ctype.h to CMake so that S3_INTERNAL=TRUE works. 2023-08-29 10:12:14 -06:00
Ward Fisher
2f43247610 Adding a test which can be used to ensure that the AWSSDK which was discovered at configure time is functional. Still need to wire it into autotools. 2023-08-28 16:43:37 -06:00
Ward Fisher
0f7ebad42e Remove diagnostic print statement. 2023-08-23 15:29:42 -06:00
Ward Fisher
dd69bb8d28 Correct some logic so that S3 SDK is linked against if and when it is found. 2023-08-23 15:29:23 -06:00
Dennis Heimbigner
f1a3a64b65 Cleanup the handling of cache parameters.
re: https://github.com/Unidata/netcdf-c/issues/2733

When addressing the above issue, I noticed that there was a disconnect
in NCZarr between nc_set_chunk_cache and nc_set_var_chunk cache.
Specifically, setting nc_set_chunk_cache had no impact on the per-variable cache parameters when nc_set_var_chunk_cache was not used.

So, modified the NCZarr code so that the per-variable cache parameters are set in this order (#1 is first choice):
1. The values set by nc_set_var_chunk_cache
2. The values set by nc_set_chunk_cache
3. The defaults set by configure.ac
2023-08-10 16:57:57 -06:00
Ward Fisher
11e589d394 Merge branch 'gh2712-parity.wif' of github.com:WardF/netcdf-c into gh2712-parity.wif 2023-07-24 09:32:42 -06:00
Ward Fisher
b65bba0b79 Additional cmake-based logic. 2023-07-24 09:32:39 -06:00
Ward Fisher
c6b853a860 Logic to ensure libsz is searched for if Zarr is enabled but enable_filter_szip is false. 2023-07-21 14:46:45 -06:00
Ward Fisher
ae28dd36e6 Additional tweaking of search logic. 2023-07-21 14:32:25 -06:00
Ward Fisher
890251c611 String handling in CMakeLists.txt 2023-07-21 14:19:50 -06:00
Ward Fisher
9787de121c Small change in CMakeLists.txt 2023-07-21 14:02:30 -06:00
Ward Fisher
401bdd5541 Parity for enable_bz2. BZ2 cannot be disabled altogether, but can fall back to inbternal implementation. 2023-07-20 15:54:56 -06:00
Ward Fisher
4a092c7f5d Merge branch 'patch-57' of https://github.com/gsjaardema/netcdf-c into gh2712-parity.wif 2023-07-20 13:51:12 -06:00
Ward Fisher
9137873b3d
Merge pull request #2707 from WardF/remove_fortran_bootstrap.wif
Remove fortran bootstrap option
2023-06-26 10:31:09 -06:00
Greg Sjaardema
05d5b3c130
Don't call find_package if not enabled
The `FIND_PACKAGE` should not be called if the filter/compression library is not enabled.  It was causing some inconsistencied in link libraries and CMake configure output...
2023-06-14 08:22:01 -06:00
Greg Sjaardema
a7c888b236
Add capability to enable/disable compression libraries 2023-06-13 17:11:53 -06:00
Ward Fisher
8c8c10e790 Change the network access nomenclature to be less ambiguous. As it stood, did it refer to networked drives? Other things that are network adjacent? 2023-06-12 15:23:44 -06:00
Dennis Heimbigner
cdbf04956b Provide a single option to disable all network access and testing.
Add the option "--disable-network-access" (automake)
or "-DENABLE_NETWORK_ACCESS=OFF" (cmake).
When disabled, this option transitively disables all
network access capabilities and testing.
If set, this option implies the following:
* --disable-dap
* --disable-byterange
* --disable-s3

This PR answers a request for a feature from Ed Hartnett.

## Misc. Other changes
* Take the opportunity to clean up some old, unused options;
e.g. --enable-multifilters.
* Fix bug in using S3 urls.
2023-06-10 14:08:04 -06:00
Ward Fisher
2d4f2e5d05 Removing unmaintained fortran boostrap code. It was a nice thought, but never broadly adopted and didn't work super well. 2023-06-08 14:36:37 -06:00
Ward Fisher
a082acc9dc
Merge pull request #2663 from poelmanc/patch-1
CMakeLists.txt use ON vs yes, indent
2023-06-07 13:21:09 -06:00
Ward Fisher
d3c2cf236f Adding a workaround for older versions of cmake that are still common in the wild, rather than force manual upgrades. 2023-05-25 13:23:21 -05:00
Dennis Heimbigner
98477b9f25 ## Addendum [5/9/23]
It turns out that attempting to test S3 using a github action secret is a very complex process. So, this was disabled for github actions. However, a new *run_tests_s3.yml* action file was added that will eventually encapsulate S3 testing.
2023-05-09 21:13:49 -06:00
Dennis Heimbigner
d79f08176a Merge branch 'master' into s3update.dmh 2023-05-09 19:31:18 -06:00
Ward Fisher
7f325464df Fix a syntax issue that may have been fouling other things, in cmake shell-script macro. 2023-05-02 09:10:14 -06:00
Dennis Heimbigner
49737888ca Improve S3 Documentation and Support
## Improvements to S3 Documentation
* Create a new document *quickstart_paths.md* that give a summary of the legal path formats used by netcdf-c. This includes both file paths and URL paths.
* Modify *nczarr.md* to remove most of the S3 related text.
* Move the S3 text from *nczarr.md* to a new document *cloud.md*.
* Add some S3-related text to the *byterange.md* document.

Hopefully, this will make it easier for users to find the information they want.

## Rebuild NCZarr Testing
In order to avoid problems with running make check in parallel, two changes were made:
1. The *nczarr_test* test system was rebuilt. Now, for each test.
any generated files are kept in a test-specific directory, isolated
from all other test executions.
2. Similarly, since the S3 test bucket is shared, any generated S3 objects
are isolated using a test-specific key path.

## Other S3 Related Changes
* Add code to ensure that files created on S3 are reclaimed at end of testing.
* Used the bash "trap" command to ensure S3 cleanup even if the test fails.
* Cleanup the S3 related configure.ac flag set since S3 is used in several places. So now one should use the option *--enable-s3* instead of *--enable-nczarr-s3*, although the latter is still kept as a deprecated alias for the former.
* Get some of the github actions yml to work with S3; required fixing various test scripts adding a secret to access the Unidata S3 bucket.
* Cleanup S3 portion of libnetcdf.settings.in and netcdf_meta.h.in and test_common.in.
* Merge partial S3 support into dhttp.c.
* Create an experimental s3 access library especially for use with Windows. It is enabled by using the options *--enable-s3-internal* (automake) or *-DENABLE_S3_INTERNAL=ON* (CMake). Also add a unit-test for it.
* Move some definitions from ncrc.h to ncs3sdk.h

## Other Changes
* Provide a default implementation of strlcpy and move this and similar defaults into *dmissing.c*.
2023-04-25 17:15:06 -06:00
Ward Fisher
1e5d82c8c0 Fix a mismatched if,endif block label. 2023-04-12 16:07:57 -06:00
Ward Fisher
c8b3b37b1a Merge branch 'dap4tests2.dmh' of https://github.com/DennisHeimbigner/netcdf-c 2023-04-11 16:42:32 -06:00
Ward Fisher
9459f92f1f
Merge branch 'main' into dap4tests1.dmh 2023-04-11 16:23:48 -06:00
Ward Fisher
91591d37a0
Merge pull request #2660 from Unidata/v4.9.2-wellspring.wif
v4.9.2 Wellspring branch
2023-04-11 15:32:26 -06:00
Dennis Heimbigner
3765d86e46 "Simplify" XGetopt usage
When "getopt()" is not available, various of the netcdf-c utilities
use XGetopt instead. This occurs primarily when building under Window,
so the build changes are restricted to CMake.

This PR tries to isolate XGetopt.c to the libdispatch directory
and then builds the various utilities using this cliche:
````
IF(USE_X_GETOPT)
  SET(XGETOPTSRC "${CMAKE_CURRENT_SOURCE_DIR}/../libdispatch/XGetopt.c")
ENDIF()
````

This avoids the need to copy XGetopt.c to all the directories that
use it.
2023-04-09 13:10:41 -06:00