Skip to content
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

HDF5: Cross-compile #6551

Merged
merged 67 commits into from
May 24, 2023
Merged

Conversation

eschnett
Copy link
Contributor

@eschnett eschnett commented Apr 8, 2023

Build HDF5 by cross-compiling instead of by downloading Conda packages.

@eschnett eschnett marked this pull request as ready for review April 10, 2023 17:03
@eschnett
Copy link
Contributor Author

Now that this is working I'd be happy about feedback:

Questions:

  • Which HDF5 API should I use? (Does this matter?)
  • The current HDF5 packages depend on OpenSSL and libCURL. This one doesn't. Why? What am I missing?
  • How should I test this change?

@giordano
Copy link
Member

CC @mkitti

@mkitti
Copy link
Contributor

mkitti commented Apr 13, 2023

Oh neat. We're still filling in predetermined values though, right?

@mkitti
Copy link
Contributor

mkitti commented Apr 13, 2023

Now that this is working I'd be happy about feedback:

Questions:

  • Which HDF5 API should I use? (Does this matter?)

You should use the C API.

  • The current HDF5 packages depend on OpenSSL and libCURL. This one doesn't. Why? What am I missing?

This is due to the read-only S3 driver, ROS3. If you enable that you will pick up the dependency.

Also, we should enable SZIP.

  • How should I test this change?

@mkitti
Copy link
Contributor

mkitti commented Apr 13, 2023

Cc: @simonbyrne @musm

@mkitti
Copy link
Contributor

mkitti commented Apr 13, 2023

@simonbyrne are you interested in doing anything with MPI here?

@eschnett
Copy link
Contributor Author

@mkitti Yes, we're using predetermined values. The values mostly describe floating point layouts, in particular for long double.

For Linux I used Docker and QEMU to determine the values, for Apple they are documented, and for Windows they seem to be the same as for Linux.

HDF5 offers different APIs (called API_16, API_18, API_110 etc.). Does it matter which we choose? I think this API is mostly handled via #define in the header files.

I can add the S3 driver and SZIP.

I also want to enable the C++ and Fortran APIs so that other packages can be built against this HDF5 library. I'm also thinking of enabling MPI.

@simonbyrne
Copy link
Contributor

Woohoo! Thanks @eschnett!

The values mostly describe floating point layouts, in particular for long double.

For Linux I used Docker and QEMU to determine the values, for Apple they are documented, and for Windows they seem to be the same as for Linux.

I don't think that's right: long double on Windows is 64-bit (https://learn.microsoft.com/en-us/previous-versions/9cx8xs15(v=vs.140)?redirectedfrom=MSDN), whereas it is 80-bit on Linux x86_64 (amd64).

HDF5 offers different APIs (called API_16, API_18, API_110 etc.). Does it matter which we choose? I think this API is mostly handled via #define in the header files.

These are for backward compatibility (i.e. API_16 is the HDF5 1.6 API). I don't quite understand how they work (https://docs.hdfgroup.org/hdf5/v1_12/api-compat-macros.html), but we should probably just use the most recent API.

I'm also thinking of enabling MPI.

That would be very handy!

@simonbyrne
Copy link
Contributor

I don't think that's right: long double on Windows is 64-bit (https://learn.microsoft.com/en-us/previous-versions/9cx8xs15(v=vs.140)?redirectedfrom=MSDN), whereas it is 80-bit on Linux x86_64 (amd64).

Ah, that is for MSVC; we're using mingw so i guess it is 80-bit (this is all confusing)

H/HDF5/build_tarballs.jl Outdated Show resolved Hide resolved
@Alexander-Barth
Copy link
Contributor

Looks like NetCDF 4.9.2 supports HDF5 1.14: https://docs.unidata.ucar.edu/netcdf-c/current/RELEASE_NOTES.html

I just upgraded NetCDF_jll to version 4.9.2 (but leaving the HDF5 compat bound unchanged Dependency(PackageSpec(name="HDF5_jll"), compat="1.12.2").

#6702

I did not notice any issues running my package NCDatasets.jl with this NetCDF_jll.

https://github.com/Alexander-Barth/NCDatasets.jl/actions/runs/4830631528

There is an issue with NetCDF_jll and HDF5 1.12.1 I believe.

Yes, I think there was an issue on Windows if I remember correctly.

@giordano
Copy link
Member

giordano commented May 5, 2023

I did not notice any issues running my package NCDatasets.jl with this NetCDF_jll.

Can you try with https://github.com/eschnett/HDF5_jll.jl?

@giordano
Copy link
Member

giordano commented May 5, 2023

@eschnett
Copy link
Contributor Author

eschnett commented May 5, 2023

So I did this #6707, with a skip build. How do I do the other part, the "retro cap the registry"?

@mkitti
Copy link
Contributor

mkitti commented May 8, 2023

So I did this #6707, with a skip build. How do I do the other part, the "retro cap the registry"?

See what I did here for OpenSSL:
JuliaRegistries/General#78542

@DilumAluthge also has this tool: https://github.com/JuliaRegistries/RetroCap.jl

@mkitti
Copy link
Contributor

mkitti commented May 10, 2023

HDF5 1.14.1 is now out.

@eschnett
Copy link
Contributor Author

Of course it is... I'm busy with another project this week so there won't be progress, and the next steps are adding the compat bounds anyway.

@mkitti
Copy link
Contributor

mkitti commented May 10, 2023

I would not recommend shifting over to HDF5 1.14.1 in this pull request.

@eschnett
Copy link
Contributor Author

I agree.

@mkitti
Copy link
Contributor

mkitti commented May 24, 2023

General registry cap at JuliaRegistries/General#84160

@giordano
Copy link
Member

So now we should be good to go?

@giordano giordano linked an issue May 24, 2023 that may be closed by this pull request
@mkitti
Copy link
Contributor

mkitti commented May 24, 2023

As a HDF5.jl maintainer, this is good to go.

@giordano giordano enabled auto-merge (squash) May 24, 2023 22:59
@giordano giordano added the HDF5 5️⃣ Builders and issues related to HDF5 label May 24, 2023
@giordano giordano merged commit bf78a45 into JuliaPackaging:master May 24, 2023
@eschnett eschnett deleted the eschnett/hdf5-cross branch May 26, 2023 19:37
@musm
Copy link
Contributor

musm commented Jul 12, 2023

@eschnett I wanted to bring to attention the latest changes in HDF5 (e.g., HDFGroup/hdf5#3104)
which should help simplify the HDF5 cross-compilation support.

@mkitti
Copy link
Contributor

mkitti commented Jul 12, 2023

Oh we're quite aware of that pull request. It may even be a direct consequence of this pull request since I told them what we were doing a few weeks before they committed to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HDF5 5️⃣ Builders and issues related to HDF5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PPC support for HDF5_jll
7 participants