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

subsquent cmake configures fail, but clearing the cmake cache allows cmake to run (HDF5) #583

Open
ipatch opened this issue Oct 18, 2024 · 2 comments
Assignees

Comments

@ipatch
Copy link
Collaborator

ipatch commented Oct 18, 2024

using my current hdf5 patch to allow cmake to find a hdf5 installation from homebrew, the initial cmake command will complete, but if the cmake command is rerun in the same directory, the subsequent run will fail with the below error output,

CMake Warning at /Users/chris/homebrew/opt/vtk/lib/cmake/vtk-9.3/patches/99/FindHDF5.cmake:735 (message):
  HDF5 Version found for language C, 1.14.4.3 is different than previously
  found version 1.14.4
Call Stack (most recent call first):
  /Users/chris/homebrew/opt/vtk/lib/cmake/vtk-9.3/VTK-vtk-module-find-packages.cmake:444 (find_package)
  /Users/chris/homebrew/opt/vtk/lib/cmake/vtk-9.3/vtk-config.cmake:166 (include)
  cMake/FreeCAD_Helpers/SetupSalomeSMESH.cmake:59 (find_package)
  CMakeLists.txt:71 (SetupSalomeSMESH)


CMake Error at /Users/chris/homebrew/Cellar/cmake/3.30.5/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_HL_LIBRARIES) (found
  version "1.14.4")
Call Stack (most recent call first):
  /Users/chris/homebrew/Cellar/cmake/3.30.5/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  /Users/chris/homebrew/opt/vtk/lib/cmake/vtk-9.3/patches/99/FindHDF5.cmake:1006 (find_package_handle_standard_args)
  /Users/chris/homebrew/opt/vtk/lib/cmake/vtk-9.3/VTK-vtk-module-find-packages.cmake:444 (find_package)
  /Users/chris/homebrew/opt/vtk/lib/cmake/vtk-9.3/vtk-config.cmake:166 (include)
  cMake/FreeCAD_Helpers/SetupSalomeSMESH.cmake:59 (find_package)
  CMakeLists.txt:71 (SetupSalomeSMESH)


-- Configuring incomplete, errors occurred!
-- Cache values
@ipatch ipatch self-assigned this Oct 18, 2024
@ipatch
Copy link
Collaborator Author

ipatch commented Oct 19, 2024

it seems updating the cmake logic in the patch to look like the below allows the cmake run to continue without encountering the above error,

if(HOMEBREW_PREFIX)
                  unset(HDF5_FOUND CACHE)
                  # set(HDF5_ROOT "${HOMEBREW_PREFIX}/opt/hdf5" CACHE PATH "path to HDF5 installation")
                  # set(HDF5_DIR "/Users/chris/homebrew/opt/hdf5/lib/cmake/hdf5" CACHE PATH "")
                  # set(HDF5_HL_LIBRARIES "/Users/chris/homebrew/opt/hdf5/lib/libhdf5_hl.dylib")
                  # find_package(HDF5 COMPONENTS C HL REQUIRED)
                  find_package(HDF5 REQUIRED COMPONENTS C CXX HL)
                  message("--------------------------------------------")
                  message("ipatch, manually set hdf5_root, cmake build of hdf5 breaks h5cc")
                  message(VERBOSE "HDF5_LIBRARIES                          : ${HDF5_LIBRARIES}")
                  message(VERBOSE "HDF5_C_HL_LIBRARIES                     : ${HDF5_C_HL_LIBRARIES}")
                  message(VERBOSE "HDF5_HL_LIBRARIES                       : ${HDF5_HL_LIBRARIES}")
                  message(VERBOSE "HDF5_C_LIBRARIES                        : ${HDF5_C_LIBRARIES}")
                  message("--------------------------------------------")
                else()

obviously an updated patch will be required.

some useful links below,

Homebrew/homebrew-core#159691

https://gitweb.gentoo.org/repo/gentoo.git/tree/sci-libs/hdf5/hdf5-1.14.4_p3-r1.ebuild

@ipatch ipatch changed the title subsquent cmake configures fail, but clearing the cmake cache allows cmake to run subsquent cmake configures fail, but clearing the cmake cache allows cmake to run (HDF5) Nov 6, 2024
@ipatch
Copy link
Collaborator Author

ipatch commented Nov 18, 2024

the below patch file should fix the above mentioned error in this issue. all that is left is to integrate the patch file in the various freecad formulas in this repo.

https://github.com/FreeCAD/homebrew-freecad/blob/52f707a3506cf8233129ed9e6e750f4288f32945/patches/freecad%400.21.2_py310-hdf5-cmake-fix.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant