-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changes to detect HDF5 Hl, build with CRT and detect ZLIB in HDF5 #848
Comments
I am a bit confused. There appears to be a check to ensure that HDF5 |
Hi Dennis what you have now is
H5Pset_deflate is a function in the HDF5 source code that is always defined what you want is this
H5Z_DEFLATE is actually a structure, not a function it is defined in the file H5Zdeflate.c, and only defined if this happens
meaning if HDF5 is really using the ZLIB filter so, what was happening was that netcdf was always assuming that ZLIB was present these are the comments I added to my pull request in the CMakeLists.txt script of netcdf-c
as you can see, there is more to the story for the MSVC case. |
also... the return value of the macro, HAVE_H5PSET_DEFLATE, is not actually being used anywhere
the following lines show whats is made for the SZIP case
|
Got it, thanks! |
probably a good idea to change the names to "NEED_ZLIB" or "HAVE_ZLIB" instead of "HAVE_H5PSET_DEFLATE" and "USE_SZIP" ("use_szip" is misleading, it can mean that is an option to use or not, while "need" means you need the library to link and "have" means that the library has those symbols this is what I have in the NCO detection of ZLIB https://github.com/nco/nco/blob/master/CMakeLists.txt
|
regarding the Windows static CRT issue also in the pull request. if you try the netcdf option to use CRT
you'll get this error
the macro "specify_static_crt_flag" needs to be defined before its call at line 333 If it was me I would just get rid of the macro and keep it simple like this, again what we did for NCO
|
finally, the last thing is a request if you could please add this option to netcdf
by adding this line in the script
the issue is, if we don't do a "make install" then the HDF5 High Level header (hdf5_hl.h) and the HDF5 header (hdf5.h) reside in different places and then the compiler complains it cannot find the HDF5 HL header I know if we do a "make install" (which actually for this case just copies the headers to a single place) this would not happen, but we are trying to keep things as simple as possible (no copying files around) to use this in a automated build script you can keep the option an undocumented "super-developer" option ... I use this to build netcdf in the NCO build script that clones and builds all the NCO dependencies https://github.com/nco/nco/blob/master/cmake/bld.bat
as you can see, it includes
|
thanks for the merge more info on this
this is explained here https://github.com/nco/nco/blob/master/cmake/README.md see section Changes needed for ZLIB and SZIP detection in NCOwhat this means is that the CMake generated Visual Studio projects must be MANUALLY edited and then the HDF5 library relinked from within Visual Studio for example edit hdf5-static.vcxproj and add full path of ZLIB and SZIP libraries as dependencies
having to manually edit the HDF5 /netCDF generated projects is a not a good option for an automated script; at the moment I don't have a solution to have CMake do this automatically Note that for Linux this problem does not happen |
You can use the
or
Of course, I've just noticed a problem with the syntax in CMakeLists.txt; I've just pushed a fix for this and it will be in the upcoming release. |
I made a pull request to netcdf-c with the following:
changes to detect HDF5 HL, build with CRT and detect ZLIB in HDF5
this was explained in more detail in the mailing list
@czender
at the moment I made a temporary fork in the NCO org that will be deleted once this is merged
https://github.com/nco/netcdf-c
these changes allow to build netcdf-c in Windows without any manual changes to the file CMakeLists.txt of netcdf-c
script is in
/nco/cmake/bld.bat
run with
bld.bat
I made the changes to a branch called "prep-v4.6.0" because for some some reason I could not build the master branch
The text was updated successfully, but these errors were encountered: