CMake Error at /Applications/CMake.app/Contents/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find HDF5: (Required is at least version "1.8") (found
HDF5_hdf5_LIBRARY-NOTFOUND)
Call Stack (most recent call first):
/Applications/CMake.app/Contents/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:598 (_FPHSA_FAILURE_MESSAGE)
/Applications/CMake.app/Contents/share/cmake-3.25/Modules/FindHDF5.cmake:1007 (find_package_handle_standard_args)
cmake/Modules/G4OptionalComponents.cmake:351 (find_package)
cmake/Modules/G4CMakeMain.cmake:59 (include)
CMakeLists.txt:50 (include)
So I don’t know what I’m doing incorrectly, the hdf5 folder I am pointing to has the HDF5config.cmake file so I thought it would be correct.
Hope someone can help me, thanks in advance, Diego!
Thanks for the detail! How did you download/install HDF5? Though there is an HDF5Config.cmake present here, it doesn’t look related to any build/install - e.g. there’re no bin/lib/include directories or scripts I’d expect to see if HDF5 had been built here.
Quick Instructions
The quick instructions for building HDF5 with CMake are:
Download the CMake source code (CMake-hdf5-N.N.N.tar.gz or CMake-hdf5.N.N.N.zip).
Uncompress it.
From the command line, go in to the top CMake-hdf5-N.N.N directory and execute the build script (build*) for your platform.
If you encounter any issues, then see the instructions below.
You are right there is no bin/lib/include directories. I also tried installing HDF5 using a version that allows executing a .configure and that’s all, but Geant4 wouldn’t compile either.
though it’s not mentioned those probably need to be unpacked/installed somewhere and that location will be where Geant4 needs to be pointed to find HDF5.
-- The C compiler identification is AppleClang 14.0.3.14030022
-- The CXX compiler identification is AppleClang 14.0.3.14030022
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Checking C++ feature CXXSTDLIB_FILESYSTEM_NATIVE - Success
-- Performing Test HAVE_TLS
-- Performing Test HAVE_TLS - Success
-- Found EXPAT: /Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/lib/libexpat.tbd (found version "2.5.0")
CMake Error at /Applications/CMake.app/Contents/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find HDF5: (Required is at least version "1.8") (found
HDF5_hdf5_LIBRARY-NOTFOUND)
Call Stack (most recent call first):
/Applications/CMake.app/Contents/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:598 (_FPHSA_FAILURE_MESSAGE)
/Applications/CMake.app/Contents/share/cmake-3.25/Modules/FindHDF5.cmake:1007 (find_package_handle_standard_args)
cmake/Modules/G4OptionalComponents.cmake:351 (find_package)
cmake/Modules/G4CMakeMain.cmake:59 (include)
CMakeLists.txt:50 (include)
I tried giving Geant4 the path to the “hole” installation folder and to lib too, and it does not work.
I think the appropriate path to use for HDF5 is /Users/diiego/software/hdf5_fromsource/CMake-hdf5-1.12.2/HDF5-1.12.2-Darwin/HDF_Group/HDF5/1.12.2/ as the cmake isn’t needed with CMAKE_PREFIX_PATH.
Also, whilst I’m not sure exactly how CMake treats two or more repitions of -DCMAKE_PREFIX_PATH, it’s probably better to combine these as a semi-colong separated list, e.g.