Commit Graph

235 Commits

Author SHA1 Message Date
Dennis Heimbigner
69ed78e7d7 Convert the ENABLE_XXX options to NETCDF_ENABLE_XXX options
# Primary Change
In order to conform to the cmake overhaul, occurrences of
ENABLE_XXX options in the nczarr code have been changed to
NETCDF_ENABLE_XXX.

# Misc. Other changes
* Fix use of rand_s in libdispatch/ncrandom.c
* Fix some bugs in the mingw gitub action.
* Fix signature bug in libncpoco/cp_win32.c
* Make some NCZarr fixes to config.h.cmake.in
2024-05-11 16:23:40 -06:00
Ward Fisher
b0b5853bcc
Merge pull request #2907 from WardF/fix_curl_dep.wif
Remove superflous check for libcurl
2024-04-08 15:32:18 -06:00
Ward Fisher
2798948670 Remove check for libcurl unless it is necessary for required functionality. 2024-04-08 10:34:22 -06:00
Ward Fisher
9639ba445d
Merge pull request #2875 from seanm/clang-tidy-fixes
Misc clang-tidy fixes, and added a .clang-tidy config file
2024-04-05 14:45:22 -06:00
Ward Fisher
acec11d515 Use modern cmake nomenclature for curl. 2024-04-03 11:42:59 -06:00
Ward Fisher
38d3831319
Merge branch 'main' into clang-tidy-fixes 2024-04-02 15:30:47 -06:00
Kyle Shores
4d44e1a2dc another one 2024-03-18 16:30:20 -05:00
Kyle Shores
121df00422 fixing some that were missing? 2024-03-18 16:27:23 -05:00
Kyle Shores
eaff8289fc Replace ENABLE_SHARED_LIBRARY_VERSION with NETCDF_ENABLE_SHARED_LIBRARY_VERSION 2024-03-18 15:54:23 -05:00
Kyle Shores
dba34ac5c2 Replace ENABLE_PNETCDF with NETCDF_ENABLE_PNETCDF 2024-03-18 15:54:02 -05:00
Kyle Shores
44778e52bf Replace ENABLE_PLUGINS with NETCDF_ENABLE_PLUGINS 2024-03-18 15:53:59 -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
e934438e14 replacing ENABLE_ATEXIT_FINALIZE 2024-03-18 15:30:20 -05:00
Ward Fisher
443195973a
Merge branch 'main' into find_pnetcdf 2024-03-11 16:02:54 -06:00
Ward Fisher
bca37ebe0e Make a change in support of https://github.com/Unidata/netcdf-c/pull/2879 2024-03-07 17:02:26 -07:00
Sean McBride
029389efcb Auto fixed clang-tidy readability-redundant-declaration warnings 2024-03-01 20:46:58 -05:00
Ward Fisher
6738723b72 Addressing a handful of issues encountered in Visual Studio re: linking, setting compiler flags for VC, etc. 2024-02-28 16:29:23 -07:00
Kyle Shores
8551a2907e removing possibly redundant cmake for shared library 2024-02-23 09:11:04 -06:00
Peter Hill
907e5cc43f
CMake: Use target_link_libraries with HDF5::HDF5 target 2024-02-16 10:51:20 +00:00
Kyle Shores
a0931fe06a trying a different thing 2024-02-15 16:33:16 -06:00
Kyle Shores
f3ef19330f setting build interface include 2024-02-14 10:44:09 -06:00
Kyle Shores
12120235b2 making netcdf link publicly to hdf5 includd directoriess 2024-02-14 10:40:53 -06:00
Kyle Shores
0b78616ddb lowercase things 2024-02-09 16:27:18 -06:00
Kyle Shores
7248e18e1a trying to use target_sources for libraries built by netcdf 2024-02-07 15:55:19 -06:00
Kyle Shores
47d5c5b0f7 trying to target objects for the libraries? 2024-02-07 14:09:57 -06:00
Kyle Shores
89f0ba0a57 trying to link libraries correctly 2024-02-07 13:37:36 -06:00
Kyle Shores
f9e3247164 merging main, addressing some PR comments 2024-02-07 09:53:45 -06:00
Kyle Shores
5cd1f4e9b1 leaving HAVE_CONFIG_H as top level definition for now 2024-01-26 14:28:16 -06:00
Kyle Shores
ca182c0979 using target_sources 2024-01-26 13:29:38 -06:00
Peter Hill
4835e43f33
CMake: Consistent casing of PNETCDF target 2024-01-24 10:51:23 +00:00
Kyle Shores
887c479533 setting up packaging in its own directory, using netcdf as a target for compile options 2024-01-19 09:25:24 -06:00
Peter Hill
fd6421d5c9
CMake: Don't use include_directories for pnetcdf 2024-01-17 17:17:59 +00:00
Anthony Islas
fd982d3b59 Link against internally defined libraries rather than pulling object files 2024-01-08 22:53:12 +00:00
Mathieu Westphal
8f191fbc9d cmake: Fix Szip link using correct cmake var 2023-12-20 07:58:45 +01: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
80c746981d
Merge pull request #2758 from ZedThree/cmake-fix-linking-mpi
CMake: Ensure all libraries link against MPI if needed
2023-10-02 16:20:43 -06:00
Peter Hill
18c813b20b
CMake: Ensure all libraries link against MPI if needed 2023-10-02 10:31:24 +01: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
1eca1ad874 Revert an accidental change. 2023-08-24 10:17:29 -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
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
John Parent
f8a34e930b Linux: consistent use of blank link vis 2023-01-25 16:41:27 -05:00
John Parent
ce3bb54d55 If using MPI, should link against MPI target
Failing to do this results in unresolved symbols during link time.
2023-01-24 15:16:55 -05:00
Dženan Zukić
bb1e0c3dd2 Fix AWS SDK linking errors
The error messages were of the style:

LINK : fatal error LNK1181: cannot open input file 'aws-crt-cpp.lib'
2022-08-03 09:59:06 -04:00
Ward Fisher
6d00a7ee9f Merge branch 'install.dmh' of https://github.com/DennisHeimbigner/netcdf-c into tmp 2022-05-26 15:48:02 -06:00
Paul Harris
9f53e328f4 Fix libraries for CURL and HDF5
CURL_LIBRARY should have always been CURL_LIBRARIES

And always include HDF5_LIBRARIES in case HDF5_C_LIBRARIES is not
available.

There are plenty of other changes that could be made to upgrade to the
newer cmake ... such as linking to CURL::libcurl and HDF5::HDF5 instead.
2022-05-26 08:36:09 +08:00
Dennis Heimbigner
6ae3289701 I made a major update to this PR with the following changes:
## Overwriting
I think I solved the file overwrite problem by doing light name
mangling of the shared library names. With this change the probabilty
is very small that installing our filter wrappers in a directory will
overwrite code produced by others.

## Default Install Location
I have setup the --with-plugin-dir option default to install in
the following locations in order of preference

1. If HDF5_PLUGIN_PATH is defined (at build time remember), then the last directory in that path will be where the filter wrapper shared libraries will be installed.
2. Otherwise the default is "/usr/local/hdf5/lib/plugin" (on *nix*) or "%ALLUSERSPROFILE%\\hdf5\\lib\\plugin" for Windows or Mingw.

Currently, --with-plugin-dir is disabled by default.
I should note that even if I enable it by default, installing
netcdf-c will still not run "out of the box" because the hypothetical
naive user will not know which compressor libraries need to be
pre-installed before netcdf is installed. Nor will that user have any
way to find out what needs to be installed.
2022-05-19 22:00:40 -06:00
Ward Fisher
cd0f1690e8
Merge pull request #2245 from DennisHeimbigner/filterenhance.dmh 2022-03-21 16:45:27 -06:00
Dennis Heimbigner
3ffe7be446 Enhance/Fix filter support
re: Discussion https://github.com/Unidata/netcdf-c/discussions/2214

The primary change is to support so-called "standard filters".
A standard filter is one that is defined by the following
netcdf-c API:
````
int nc_def_var_XXX(int ncid, int varid, size_t nparams, unsigned* params);
int nc_inq_var_XXXX(int ncid, int varid, int* usefilterp, unsigned* params);
````
So for example, zstandard would be a standard filter by defining
the functions *nc_def_var_zstandard* and *nc_inq_var_zstandard*.

In order to define these functions, we need a new dispatch function:
````
int nc_inq_filter_avail(int ncid, unsigned filterid);
````
This function, combined with the existing filter API can be used
to implement arbitrary standard filters using a simple code pattern.
Note that I would have preferred that this function return a list
of all available filters, but HDF5 does not support that functionality.

So this PR implements the dispatch function and implements
the following standard functions:
    + bzip2
    + zstandard
    + blosc
Specific test cases are also provided for HDF5 and NCZarr.
Over time, other specific standard filters will be defined.

## Primary Changes
* Add nc_inq_filter_avail() to netcdf-c API.
* Add standard filter implementations to test use of *nc_inq_filter_avail*.
* Bump the dispatch table version number and add to all the relevant
   dispatch tables (libsrc, libsrcp, etc).
* Create a program to invoke nc_inq_filter_avail so that it is accessible
  to shell scripts.
* Cleanup szip support to properly support szip
  when HDF5 is disabled. This involves detecting
  libsz separately from testing if HDF5 supports szip.
* Integrate shuffle and fletcher32 into the existing
  filter API. This means that, for example, nc_def_var_fletcher32
  is now a wrapper around nc_def_var_filter.
* Extend the Codec defaulting to allow multiple default shared libraries.

## Misc. Changes
* Modify configure.ac/CMakeLists.txt to look for the relevant
  libraries implementing standard filters.
* Modify libnetcdf.settings to list available standard filters
  (including deflate and szip).
* Add CMake test modules to locate libbz2 and libzstd.
* Cleanup the HDF5 memory manager function use in the plugins.
* remove unused file include//ncfilter.h
* remove tests for the HDF5 memory operations e.g. H5allocate_memory.
* Add flag to ncdump to force use of _Filter instead of _Deflate
  or _Shuffle or _Fletcher32. Used for testing.
2022-03-14 12:39:37 -06:00