JuliaPackaging / Yggdrasil

Collection of builder repositories for BinaryBuilder.jl
https://binarybuilder.org
Other
308 stars 551 forks source link

Fortran bindings for HDF5? #4760

Open eschnett opened 2 years ago

eschnett commented 2 years ago

I have a package that needs the Fortran bindings for HDF5. Is there a way to enable them?

I have heard that HDF5 does not cross-compile. I know how to set up Docker with qemu to build natively for various architectures. Could this be a way to build HDF5 on each architecture? Is there a Docker image for BinaryBuilder that can be used natively (not for cross-compiling) on non-x86 architectures?

giordano commented 2 years ago

Duplicate of https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/10?

lucifer1004 commented 2 years ago

I do not think this issue is a duplicate. I got stuck when I wanted to BinaryBuild a Fortran application which relies on HDF5 but HDF5_jll did not offer the Fortran library it needs.

The error message was

Could NOT find HDF5 (missing: HDF5_LIBRARIES Fortran) (found version
  "1.12.1")

showing that the HDF5 library did exist but did not offer Fortran support.

giordano commented 2 years ago

I mean, the duplicate is that unless upstream hdf5 allows for proper cross-compilation, the only alternative is to be able to run code for the target platform, which is the point of https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/10

lucifer1004 commented 2 years ago

For a temporary workaround, do you think it is OK to build a standalone HDF5 for my application instead of using HDF5_jll?

lucifer1004 commented 2 years ago

By the way, after looking at the build_tarballs.jl of HDF5_jll, I think by removing https://github.com/JuliaPackaging/Yggdrasil/blob/7e759a039df729f627b165566e697837fcc88f41/H/HDF5/build_tarballs.jl#L44 this issue could be solved.

giordano commented 2 years ago

Sure, you can do whatever you want with your applications, no one forces anyone to use jlls 🙂 they're just a convenient way to provide users with hassle-free pre-built binaries well integrated with the whole ecosystem

giordano commented 2 years ago

this issue could be solved.

I don't think it's nearly that easy. As far as I can see, they link only to libgfortran5, which for example for Linux would be the wrong ABI, as Julia there comes with libgfortran4