Commit Graph

228 Commits

Author SHA1 Message Date
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
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
xantares
1eb6b28820 cmake: list zip libs before szip
as szip libs references libz as optimized, the REMOVE_DUPLICATES strips zlib out of TLL_LIBS but not its optimized keyword resulting in an invalid list
just list zip before fixes the issue (or removing the REMOVE_DUPLICATES of TLL_LIBS)
2022-02-19 12:37:24 +01:00
Ward Fisher
2e34d6085f Correct the accidental removal of NOUNDEFINED, as reported in https://github.com/Unidata/netcdf-c/issues/2196 2022-01-28 16:46:23 -07:00
Ward Fisher
4d13f8ef7e Merge branch 'stratus.dmh' of https://github.com/DennisHeimbigner/netcdf-c into gh2152.wif 2022-01-25 11:20:20 -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
c01cf995c0 Fix use of S3 with a non-aws appliances
re: https://github.com/Unidata/netcdf-c/issues/2151

The of a non-aws appliance broke during the switch to testing
against Amazon S3.
So make necessary changes to get non-aws appliances work correctly.
2021-11-25 18:26:03 -07:00
Dennis Heimbigner
53464e8963 Allow optional use of libxml2
re: https://github.com/Unidata/netcdf-c/issues/2119

H/T to [Egbert Eich](https://github.com/e4t) and [Bas Couwenberg](https://github.com/sebastic) for this PR.

It is undesirable to make netcdf be dependent on the availability
of libxml2, but it is desirable to allow its use if available.

In order to do this, a wrapper API (include/ncxml.h) was constructed
that supports either ezxml or libxml2 as the implementation.
Additionally, the xml support code was moved to a new directory
netcdf-c/libncxml.

Primary changes:
* Create a new sub-directory named netcdf-c/libncxml to hold all the xml implementation code.
* Move ezxml.c and ezxml.h to libncxml
* Create a wrapper API -- include/ncxml.h
* Create an implementation, ncxml_ezxml.c to support use of ezxml.
* Create an implementation, ncxml_xml2.c to support use of libxml2.
* Add a check for libxml2 in configure.ac and CMakeLists.txt
* Modify libdap to use the wrapper API instead of ezxml directly.

Misc. Other Changes:
* Change include/netcdf_json.h from built source to be part of the distribution.
2021-11-01 22:37:05 -06:00
Dennis Heimbigner
f6e25b695e Fix additional S3 support issues
re: https://github.com/Unidata/netcdf-c/issues/2117
re: https://github.com/Unidata/netcdf-c/issues/2119

* Modify libsrc to allow byte-range reading of netcdf-3 files in private S3 buckets; this required using the aws sdk. Also add a test case.
* The aws sdk can sometimes cause problems if the Awd::ShutdownAPI function is not called. So at optional atexit() support to ensure it is called. This is disabled for Windows.
* Add documentation to nczarr.md on how to build and use the aws sdk under windows. Currently it builds, but testing fails.
* Switch testing from stratus to the Unidata bucket on S3.
* Improve support for the s3: url protocol.
* Add a s3 specific utility code file: ds3util.c
* Modify NC_infermodel to attempt to read the magic number of byte-ranged files in S3.

## Misc.

* Move and rename the core S3 SDK wrapper code (libnczarr/zs3sdk.cpp) to libdispatch since it now used in libsrc as well as libnczarr.
* Add calls to nc_finalize in the utilities in case atexit is disabled.
* Add header only json parser to the distribution rather than as a built source.
2021-10-29 20:06:37 -06:00