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

[build] Error exposing HDF5 to user codes with cmake 3.12 #564

Open
mwallerb opened this issue Sep 24, 2018 · 5 comments
Open

[build] Error exposing HDF5 to user codes with cmake 3.12 #564

mwallerb opened this issue Sep 24, 2018 · 5 comments

Comments

@mwallerb
Copy link
Collaborator

It's the next round of CMake's favourite game: Let's Break User Space!(TM)

CMake 3.12 made some changes that stops ALPSCore from exposing its HDF5 dependency to user codes. Compiling a user codes results in the following error message:

CMake Error at CMakeLists.txt:17 (add_executable):
  Target "var1-bin" links to target "hdf5::hdf5-shared" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?

As a workaround, one has to explicitly declare the HDF5 dependency before ALPSCore dependency:

find_package(HDF5 REQUIRED)
find_package(ALPSCore REQUIRED)
@egull
Copy link
Collaborator

egull commented Sep 24, 2018

Crap. @galexv please have a look and prioritize this!

@galexv
Copy link
Collaborator

galexv commented Sep 24, 2018

@mwallerb Cannot reproduce it with CMake 3.12.2 and HDF5 1.8.16 under Ubuntu 16.04.
Could you please give more info: OS, version, HDF5 version... (and possibly send me CMakeCache.txt of both ALPSCore and the client code)?

@mwallerb
Copy link
Collaborator Author

Arch Linux
CMake 3.12.2
HDF5 1.10.3

Cache files per mail...

@galexv
Copy link
Collaborator

galexv commented Sep 24, 2018

Thanks @mwallerb. I have reproduced the issue.
It arises when CMake uses hdf5-config.cmake which is supplied with HDF5-1.10 when it is installed via CMake. Properly handling it needs some changes to ALPSCore cmake scripts, but a quick workaround will be pushed shortly.

galexv added a commit that referenced this issue Sep 24, 2018
This is a temporary workaround for issue #564.
galexv added a commit that referenced this issue Sep 25, 2018
This is a temporary workaround for issue #564.
@galexv
Copy link
Collaborator

galexv commented Sep 25, 2018

(I am not closing yet: we should still handle targets imported from external libraries properly)

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

No branches or pull requests

3 participants