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

Cmake: Remove custom Find<Package>.cmake modules #1585

Merged
merged 2 commits into from
Feb 17, 2024

Conversation

LecrisUT
Copy link
Contributor

Spglib and Eigen3 both provide native <Package>Config.cmake files. These should be used instead, particularly because the names do not match and the manual finds do not include dependencies, defines and other options shipped by <Package>Config.cmake.

Alternatively I also recommend for required packages to change find_package with FetchContent(FIND_PACKAGE_ARGS), and if some backwards compatibility is required, design the Find<Package>.cmake as follows: https://gitlab.com/octopus-code/octopus/-/blob/main/cmake/FindMETIS.cmake?ref_type=heads, where it tries in order: find_package(CONFIG) -> pkg-config -> manual import

Copy link

welcome bot commented Jan 25, 2024

Thanks for opening this pull request! Please check out our contributing guidelines and check for the automated tests.

Signed-off-by: Cristian Le <[email protected]>
Signed-off-by: Cristian Le <[email protected]>
@ghutchis
Copy link
Member

In principal, this is great, but it's not passing CI builds, e.g. on Ubuntu:

2024-01-26T00:05:01.9175988Z CMake Error at avogadro/core/CMakeLists.txt:111 (find_package):
2024-01-26T00:05:01.9177070Z   By not providing "FindSpglib.cmake" in CMAKE_MODULE_PATH this project has
2024-01-26T00:05:01.9178287Z   asked CMake to find a package configuration file provided by "Spglib", but
2024-01-26T00:05:01.9179179Z   CMake did not find one.
2024-01-26T00:05:01.9179520Z 
2024-01-26T00:05:01.9179823Z   Could not find a package configuration file provided by "Spglib" with any
2024-01-26T00:05:01.9180331Z   of the following names:
2024-01-26T00:05:01.9180524Z 
2024-01-26T00:05:01.9180631Z     SpglibConfig.cmake
2024-01-26T00:05:01.9180974Z     spglib-config.cmake
2024-01-26T00:05:01.9181154Z 
2024-01-26T00:05:01.9181407Z   Add the installation prefix of "Spglib" to CMAKE_PREFIX_PATH or set
2024-01-26T00:05:01.9182034Z   "Spglib_DIR" to a directory containing one of the above files.  If "Spglib"
2024-01-26T00:05:01.9182653Z   provides a separate development package or SDK, be sure it has been
2024-01-26T00:05:01.9183102Z   installed.
2024-01-26T00:05:01.9183241Z 
2024-01-26T00:05:01.9183246Z 

@LecrisUT
Copy link
Contributor Author

The issue is that the openchemistry libraries are using spglib <2.10 where the proper packaging is introduced. These patches are already introduced in Fedora to properly support upstream packaging, and the tests there pass: https://copr.fedorainfracloud.org/coprs/lecris/dependencies/build/6950789/

Copy link
Contributor

Here are the build results
Avogadro2.AppImage
macOS.dmg
Artifacts will only be retained for 90 days.

@ghutchis ghutchis linked an issue Feb 12, 2024 that may be closed by this pull request
@ghutchis
Copy link
Member

Okay, I've updated openchemistry to spglib 2.10 so I'll re-run the builds.

Copy link
Contributor

Here are the build results
Avogadro2.AppImage
macOS.dmg
Artifacts will only be retained for 90 days.

Copy link
Contributor

Here are the build results
Avogadro2.AppImage
macOS.dmg
Win64.exe
Artifacts will only be retained for 90 days.

@ghutchis
Copy link
Member

Great - looks like the work you did on more recent spglib solved the Windows build issue.

Thanks!

@ghutchis ghutchis added the build label Feb 17, 2024
@ghutchis ghutchis merged commit b452fbc into OpenChemistry:master Feb 17, 2024
22 checks passed
Copy link

welcome bot commented Feb 17, 2024

Congrats on merging your first pull request! 🎉 Thanks for making Avogadro better for everyone!

Copy link
Contributor

Here are the build results
Avogadro2.AppImage
macOS.dmg
Win64.exe
Artifacts will only be retained for 90 days.

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

Successfully merging this pull request may close these issues.

Imported target "spglib::spglib" includes non-existent path
2 participants