Skip to content

Conversation

@mtaillefumier
Copy link
Contributor

@mtaillefumier mtaillefumier commented Oct 16, 2023

@haampie and I have been working on this set of patches that fix various issues when cp2k is build with cmake and used as dependency in gromacs.

  • libcp2k.pc has now all the right information
  • fix various typo in cp2kConfig.cmake (when we use find_package(cp2k))
  • fix the C and C++ std as well. It should one issue in the spack recipe
  • fix the c++ standard in the toolchain.
  • move the findPackage.cmake to a dedicated directory.
  • fix installation directories for modules.
    this PR includes PR Fix a few CMake issues #3041

Co-authored-by: Harmen Stoppels me@harmenstoppels.nl

@mtaillefumier
Copy link
Contributor Author

i removed the option to build dbcsr with cp2k algether. The cmake build will fail for sure.

@haampie
Copy link
Contributor

haampie commented Oct 17, 2023

Thanks, that seems to work well

@mtaillefumier
Copy link
Contributor Author

mtaillefumier commented Oct 17, 2023

except that their CI uses a functionality I just deleted.... we have to switch to spack...

@oschuett
Copy link
Member

We're actually almost ready to build DBCSR via the toolchain (#351). All that's left is to hook up this script to here and here.

@RMeli
Copy link
Member

RMeli commented Oct 17, 2023

@mtaillefumier, since you are already touching CMake, would you mind adding the following?

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7126fa42a..a2664e2b5 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1585,6 +1585,7 @@ target_compile_definitions(
          $<$<CONFIG:COVERAGE>:__NO_ABORT>
          $<$<CONFIG:DEBUG>:__HAS_IEEE_EXCEPTIONS>
          $<$<CONFIG:DEBUG>:__CHECK_DIAG>
+         $<$<BOOL:${CP2K_USE_MPI_F08}>:__MPI_F08>
          $<$<BOOL:${CP2K_USE_PEXSI}>:__PEXSI>
          $<$<BOOL:${CP2K_USE_PLUMED2}>:__PLUMED2>
          $<$<BOOL:${CP2K_USE_QUIP}>:__QUIP>

Otherwise CP2K doesn't compile with the latest version of MPICH (which requires -DCP2K_USE_MPI_F08=ON.

Related to cp2k/dbcsr#661.

@mtaillefumier
Copy link
Contributor Author

We're actually almost ready to build DBCSR via the toolchain (#351). All that's left is to hook up this script to here and here.

thanks I will take care of it then.

@mtaillefumier
Copy link
Contributor Author

$<$<BOOL:${CP2K_USE_MPI_F08}>:__MPI_F08>

it is already there. But it is -DCP2K_ENABLE_MPI_F08 not -DCP2K_USE_MPI_F08

@mtaillefumier
Copy link
Contributor Author

the toolchain is giving me some resistance. I would propose to ignore the toolchain for the time being and merge this PR after I fix the compilation issue.


 341 |          CALL mp_group%set_handle(eri%mp_group%get_handle())
      |                                                          1
Error: 'get_handle' at (1) is not an inquiry reference to an intrinsic type component 'mp_group'

any idea why it fails now ?

@oschuett
Copy link
Member

any idea why it fails now ?

It's probably a botched merge with d5cf19b. Try to rebase your branch onto the latest master.

@mtaillefumier
Copy link
Contributor Author

any idea why it fails now ?

It's probably a botched merge with d5cf19b. Try to rebase your branch onto the latest master.

Thanks. I just rebased to master. Let's give it a try. I am also trying to fix the compilation warnings with fromtran flags been passed to gcc. I can not reproduce it locally though

@mtaillefumier
Copy link
Contributor Author

I am also passing the compilation flags the proper way instead of tinkering with CMAKE_FORTRAN_FLAGS.... Sorry if it is taking so long.

Mathieu Taillefumier and others added 10 commits October 18, 2023 14:23
- remove the possibility to build dbcsr and cp2k with the cmake build system
- fix various typos in the cp2kConfig.cmake.in file
- move all FindPackages.cmake in modules directory.
- fix FindPackage.cmake installation in cp2kConfig.cmake

- make pretty, cp2k.pc -> libcp2k.pc

- fix findLapack and findBlas error when cp2kconfig.cmake is called
Co-authored-by: Rocco Meli <r.meli@bluemail.ch>
@mtaillefumier
Copy link
Contributor Author

I found the root of the problem. DBCSR should be 2.6.0 not 2.5.0

@oschuett oschuett merged commit 25e21fa into cp2k:master Oct 19, 2023
@mtaillefumier
Copy link
Contributor Author

thanks

@mtaillefumier mtaillefumier deleted the harmen_patch branch October 19, 2023 12:36
@RMeli RMeli mentioned this pull request Oct 20, 2023
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

Successfully merging this pull request may close these issues.

4 participants