Problem 2426 - 10.7 does not compile with HDF5 support
Summary: 10.7 does not compile with HDF5 support
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: cmake (show other problems)
Version: 10.7
Hardware: Apple Mac OS X
: P4 major
Assignee: Ben Morgan
URL:
Depends on:
Blocks:
 
Reported: 2021-09-21 09:40 CEST by jasondet
Modified: 2021-09-25 11:15 CEST (History)
0 users

See Also:


Attachments
Patch to fix issues with HDF5 variables/targets (2.78 KB, patch)
2021-09-24 14:05 CEST, Ben Morgan
Details | Diff

Note You need to log in before you can comment on or make changes to this problem.
Description jasondet 2021-09-21 09:40:25 CEST
I'm trying to build 10.7.p02 with HDF5 support on a Mac running Big Sur (11.5.2); hdf5 is v1.12.1 installed via homebrew. I pass "-DGEANT4_USE_HDF5=ON" to cmake and it appears to find hdf5, the cmake output includes the following lines that mention HDF5:

-- HDF5 C compiler wrapper is unable to compile a minimal HDF5 program.
-- Found HDF5: /usr/local/lib/libhdf5.dylib (found suitable version "1.12.1", minimum required is "1.8")  
...
GEANT4_USE_HDF5: Building Geant4 analysis library with HDF5 support

The first line looks worrying, but cmake at least finds HDF5. However when I then try to "make" the build halts at:

[ 27%] Built target G4digits_hits
source/CMakeFiles/G4analysis.dir/build.make:1232: *** target pattern contains no `%'.  Stop.

Line 1232 of source/CMakeFiles/G4analysis.dir/build.make reads:

BuildProducts/lib/libG4analysis.dylib: Geant4::HDF5-NOTFOUND

This conflicts with cmake claiming it found HDF5 just fine. It looks like something in cmake is broken.
Comment 1 Ben Morgan 2021-09-24 14:05:25 CEST
Created attachment 731 [details]
Patch to fix issues with HDF5 variables/targets

Applying this to the 10.7.2 source tree should fix the problem. Note that I was unable to reproduce on a Catalina system with Homebrew-ed HDF5 1.12.1 and CMake 3.21.2, but we have seen the issue on Linux. This is already fixed on the master and patches branches, so will be in release 11.0.0 and 10.7.3 this December.
Comment 2 jasondet 2021-09-25 11:15:18 CEST
Thank you -- with the patch, Geant4 now compiles for me.