hipSYCL builds produce invalid CMake config files
Summary
The exported CMake package has hipSYCL::hipSYCL-rt
in the INTERFACE_LINK_LIBRARIES
in libgromacs.cmake
, but gromacs-config.cmake
does not have a corresponding find_dependency(hipSYCL REQUIRED)
.
This means that find_package(gromacs); target_link_libraries(mysoftware Gromacs::libgromacs)
does not work.
The nature of this bug depends on whether the installed headers and libgromacs actually convey a dependency on hipSYCL to client software.
Exact steps to reproduce
A GPU build of gromacs 2023 on Dardel (PDC) uses hipSYCL.
After installation, a client build system that tries to find_package(gromacs)
gets something like the following.
-- Configuring done
CMake Error at /<prefix>/share/cmake/gromacs/libgromacs.cmake:83 (set_target_properties):
The link interface of target "Gromacs::libgromacs" contains:
hipSYCL::hipSYCL-rt
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
Call Stack (most recent call first):
/<prefix>/share/cmake/gromacs/gromacs-config.cmake:56 (include)
CMakeLists.txt:103 (find_package)
For developers: Why is this important?
Users of gromacs client software are users of gromacs. Developers of gromacs client software are gromacs contributors. There's something inconsistent with our CMake scripting, and our build system infrastructure will be stronger if we fix it.
Possible fixes
Either
- downgrade the scope of the dependency:
target_link_libraries(libgromacs PRIVATE hipSYCL::hipSYCL-rt)
, or - update the export generators for the CMake CONFIG package.
@eirrgang can contribute a fix once it is clear whether the interface dependency is real or accidental.