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 can't find spglib on Ubuntu/Debian #3414

Open
oschuett opened this issue May 15, 2024 · 4 comments
Open

CMake can't find spglib on Ubuntu/Debian #3414

oschuett opened this issue May 15, 2024 · 4 comments

Comments

@oschuett
Copy link
Member

When building with -DCP2K_USE_SPGLIB=ON on Ubuntu 2024.04, I get the following error message:

CMake Error at CMakeLists.txt:686 (find_package):
  Could not find a package configuration file provided by "Spglib" with any
  of the following names:

    SpglibConfig.cmake
    spglib-config.cmake

  Add the installation prefix of "Spglib" to CMAKE_PREFIX_PATH or set
  "Spglib_DIR" to a directory containing one of the above files.  If "Spglib"
  provides a separate development package or SDK, be sure it has been
  installed.

It turns out that the libspglib-f08-dev package ships cmake files with somewhat different names:

/usr/lib/x86_64-linux-gnu/cmake/Spglib/SpglibTargets_fortran-none.cmake
/usr/lib/x86_64-linux-gnu/cmake/Spglib/SpglibTargets_fortran.cmake

@mtaillefumier what do you think?

@mtaillefumier
Copy link
Contributor

We should not do anything at all except be sure that Spglib::fortran is added to the cp2k libraries dependencies.

https://github.com/cp2k/cp2k/blob/c5411e048c1d97964d822cc470060c619c47960d/src/CMakeLists.txt#L1560C5-L1560C49

we need to add Spglib::fortran to this line. I can do it if you want.

@mtaillefumier
Copy link
Contributor

Basically, cmake will take care of this all by itself unless the devs decided otherwise. it might be a module to be searched with find_package(Spglib required fortran)

@mtaillefumier
Copy link
Contributor

The error is really ubuntu specific actually. /usr/lib/x86_64-linux-gnu/cmake should be added to CMAKE_PREFIX_PATH

@oschuett
Copy link
Member Author

we need to add Spglib::fortran to this line. I can do it if you want.

Yes, it would be great if you could help out with these find_package issues. Then I'll focus on migrating the remaining CI scripts.

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

2 participants