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

2.5.0: Fails to find HDF5 #633

Closed
yurivict opened this issue Nov 4, 2022 · 10 comments
Closed

2.5.0: Fails to find HDF5 #633

yurivict opened this issue Nov 4, 2022 · 10 comments

Comments

@yurivict
Copy link

yurivict commented Nov 4, 2022

Describe the bug
This line causes this failure:

-- Unable to determine HDF5 C flags from HDF5 wrapper.
CMake Error at /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find HDF5 (missing: HDF5_LIBRARIES) (found version "1.12.2")
Call Stack (most recent call first):
  /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/share/cmake/Modules/FindHDF5.cmake:1007 (find_package_handle_standard_args)
  CMake/HighFiveTargetDeps.cmake:13 (find_package)
  CMakeLists.txt:63 (include)

hdf5-1.12.2
clang-14
FreeBSD 13.1

@1uc
Copy link
Collaborator

1uc commented Nov 4, 2022

I've tried using HighFive as a dependency in a trivial CMake based project. On my particular system a find_package(HighFive) followed by the target_link_libraries(... PUBLIC HighFive) sets the appropriate compiler/linker flags. Therefore, I'm unable to reproduce the issue.

Could you please create a minimal reproducer? And maybe explain why the line you mention is at fault.

@knoepfel
Copy link

knoepfel commented Nov 8, 2022

Is see a similar error when trying to install highfive via Spack:

$ spack install highfive ~mpi ^hdf5 ~mpi
[+] /Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/pkgconf-1.8.0-ompiatqqad54y2hcr7orar566yw3xmly
[+] /Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/berkeley-db-18.1.40-nhunv5nlc43jxfcjhprjt3xr7b6lt3h7
[+] /Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/libiconv-1.16-t5lovvab3mucvhkhun7atgjashyj2yjb
[+] /Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/zlib-1.2.12-rdxpbj5k3nqwsvdmndim4n6mhjdabfui
[+] /Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/ncurses-6.2-lkqooz7odlmxte727dkn2a3277o7jnht
[+] /Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/diffutils-3.8-tap7w6nkh3feut36dyarazjzcpdt4tve
[+] /Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/readline-8.1-ad4c7fq6tqxju7kopgw3lhmx5o3qvoju
[+] /Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/bzip2-1.0.8-tg3gwk5jri2hwzlf4oh7wlfun5nsjv6f
[+] /Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/gdbm-1.19-ob5getbdflin636d3bzs6kjfq4uv5mms
[+] /Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/perl-5.34.1-v5gegj42iyc4sch2eoxmz7zphbffxpoy
[+] /Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/openssl-1.1.1o-r5v7slp4fqtcapkduoysbd2eb7wrtgsh
[+] /Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/cmake-3.23.1-orjfrfun53jz7p2mz2xwgs7xh7mcbjtz
[+] /Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/hdf5-1.12.2-sxwlkklfpxngvn2pe2ducoqkecp4snoi
==> Installing highfive-2.3.1-22llogtzgvnhtx6ydeziwwmcaqy3cn5l
==> No binary for highfive-2.3.1-22llogtzgvnhtx6ydeziwwmcaqy3cn5l found: installing from source
==> Using cached archive: /Users/kyleknoepfel/work/spack/var/spack/cache/_source-cache/archive/41/41728a1204bdfcdcef8cbc3ddffe5d744c5331434ce3dcef35614b831234fcd7.tar.gz
==> No patches needed for highfive
==> highfive: Executing phase: 'cmake'
==> Error: ProcessError: Command exited with status 1:
    'cmake' '-G' 'Unix Makefiles' '-DCMAKE_INSTALL_PREFIX:STRING=/Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/highfive-2.3.1-22llogtzgvnhtx6ydeziwwmcaqy3cn5l' '-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo' '-DBUILD_TESTING:BOOL=OFF' '-DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=OFF' '-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON' '-DCMAKE_FIND_FRAMEWORK:STRING=LAST' '-DCMAKE_FIND_APPBUNDLE:STRING=LAST' '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON' '-DCMAKE_INSTALL_RPATH:STRING=/Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/highfive-2.3.1-22llogtzgvnhtx6ydeziwwmcaqy3cn5l/lib;/Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/highfive-2.3.1-22llogtzgvnhtx6ydeziwwmcaqy3cn5l/lib64;/Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/hdf5-1.12.2-sxwlkklfpxngvn2pe2ducoqkecp4snoi/lib;/Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/zlib-1.2.12-rdxpbj5k3nqwsvdmndim4n6mhjdabfui/lib' '-DCMAKE_PREFIX_PATH:STRING=/Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/hdf5-1.12.2-sxwlkklfpxngvn2pe2ducoqkecp4snoi;/Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/cmake-3.23.1-orjfrfun53jz7p2mz2xwgs7xh7mcbjtz;/Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/zlib-1.2.12-rdxpbj5k3nqwsvdmndim4n6mhjdabfui' '-DUSE_BOOST:Bool=False' '-DHIGHFIVE_PARALLEL_HDF5:Bool=False' '-DHIGHFIVE_UNIT_TESTS:Bool=false' '-DHIGHFIVE_EXAMPLES:Bool=false' '/var/folders/0t/b8j2y3cs375g1sj7fc4z10b80000gq/T/kyleknoepfel/spack-stage/spack-stage-highfive-2.3.1-22llogtzgvnhtx6ydeziwwmcaqy3cn5l/spack-src'

1 error found in build log:
     10    -- Detecting CXX compiler ABI info
     11    -- Detecting CXX compiler ABI info - done
     12    -- Check for working CXX compiler: /Users/kyleknoepfel/work/spack/lib/spack/env/clang/clang++ - skipped
     13    -- Detecting CXX compile features
     14    -- Detecting CXX compile features - done
     15    -- Unable to determine HDF5 C flags from HDF5 wrapper.
  >> 16    CMake Error at /Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/cmake-3.23.1-orjfrfun53jz7p2mz2xwgs7xh7mcbjtz/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
     17      Could NOT find HDF5 (missing: HDF5_LIBRARIES) (found version "1.12.2")
     18    Call Stack (most recent call first):
     19      /Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/cmake-3.23.1-orjfrfun53jz7p2mz2xwgs7xh7mcbjtz/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
     20      /Users/kyleknoepfel/work/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/cmake-3.23.1-orjfrfun53jz7p2mz2xwgs7xh7mcbjtz/share/cmake-3.23/Modules/FindHDF5.cmake:1007 (find_package_handle_standard_args)
     21      CMake/HighFiveTargetDeps.cmake:13 (find_package)
     22      CMakeLists.txt:63 (include)

See build log for details:
  /var/folders/0t/b8j2y3cs375g1sj7fc4z10b80000gq/T/kyleknoepfel/spack-stage/spack-stage-highfive-2.3.1-22llogtzgvnhtx6ydeziwwmcaqy3cn5l/spack-build-out.txt

Notice the version here is with highfive 2.3.1.

@1uc
Copy link
Collaborator

1uc commented Nov 9, 2022

Thank you, this is reproducible. Also makes it clear why the mentioned line would be the issue:

$ ls $(spack location --install-dir hdf5)/cmake
hdf5-config.cmake  hdf5-config-version.cmake  hdf5-targets.cmake  hdf5-targets-relwithdebinfo.cmake

@matz-e
Copy link
Member

matz-e commented Nov 9, 2022

I think we're triggering this oddity of CMake: https://gitlab.kitware.com/cmake/cmake/-/issues/23667

But I think it should be safe by now to remove the offending line.

@1uc
Copy link
Collaborator

1uc commented Nov 9, 2022

I don't think so, because we get the error also when requesting cmake@3.22.0:

1 error found in build log:
     10    -- Detecting CXX compiler ABI info
     11    -- Detecting CXX compiler ABI info - done
     12    -- Check for working CXX compiler: /home/.../upstream-spack/lib/spack/env/gcc/g++ - skipped
     13    -- Detecting CXX compile features
     14    -- Detecting CXX compile features - done
     15    -- Unable to determine HDF5 C flags from HDF5 wrapper.
  >> 16    CMake Error at /home/.../upstream-spack/opt/spack/linux-archrolling-zen3/gcc-12.2.0/cmake-3.22.0-yqenr66upo42txp4txvf26ktomkmdw2t/share/cmake-3.22
           /Modules/FindPackageHandleStandardArgs.cmake:230 (message):
     17      Could NOT find HDF5 (missing: HDF5_LIBRARIES) (found version "1.12.2")

@matz-e
Copy link
Member

matz-e commented Nov 9, 2022

Fair enough. In that case the linked issue still points at unreliable behavior :)

@1uc
Copy link
Collaborator

1uc commented Nov 10, 2022

The ~mpi seem relevant.

@matz-e
Copy link
Member

matz-e commented Nov 22, 2022

OK, was just able to reproduce this earlier with @heerener.

Basically, HDF5 1.12.1 works, but 1.12.2 fails with a variety of CMake versions. We were able to get HighFive to build by patching

find_package(HDF5 REQUIRED)

to

find_package(HDF5 REQUIRED CONFIG)

skipping the CMake Find* modules and directly using the CMake config provided by HDF5. Offending line is here. I'm not sure if first importing HDF5 with that setting and HighFive afterwards would be a good work-around.

@alkino
Copy link
Member

alkino commented Nov 23, 2022

Should be fixed with v2.6.2

@yurivict
Copy link
Author

It is fixed indeed.
Thank you.

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

5 participants