Enable DFTD4 with CMake CI build (Spack)

This commit is contained in:
Rocco Meli 2025-01-28 14:55:04 +01:00 committed by GitHub
parent 52fc3dc60e
commit 6bc67c85af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 17 additions and 10 deletions

View file

@ -690,6 +690,13 @@ endif()
if(CP2K_USE_DFTD4)
find_package(dftd4 REQUIRED)
get_target_property(CP2K_DFTD4_LINK_LIBRARIES dftd4::dftd4
INTERFACE_LINK_LIBRARIES)
get_target_property(CP2K_DFTD4_LIB_LINK_LIBRARIES dftd4::dftd4-lib
INTERFACE_LINK_LIBRARIES)
get_target_property(CP2K_DFTD4_INCLUDE_DIR dftd4::dftd4-lib
INTERFACE_INCLUDE_DIRECTORIES)
endif()
# SIRIUS
@ -847,9 +854,10 @@ endif()
if(CP2K_USE_DFTD4)
message(
" - DFTD4 :\n" " - include modules : ${DFTD4_DFTD4};${DFTD4_MCTC}\n"
" - include directories : ${DFTD4_INCLUDE_DIR}\n"
" - libraries : ${DFTD4_LIBDIR}\n\n")
" - DFTD4 :\n"
" - include directories : ${CP2K_DFTD4_INCLUDE_DIR}\n"
" - libraries : ${CP2K_DFTD4_LINK_LIBRARIES};${CP2K_DFTD4_LIB_LINK_LIBRARIES}\n\n"
)
endif()
if(CP2K_USE_SIRIUS)

View file

@ -1600,9 +1600,6 @@ endif()
add_library(cp2k_link_libs INTERFACE)
include_directories(${DFTD4_DFTD4})
include_directories(${DFTD4_MCTC})
# the order is important so keep it that way
target_link_libraries(
cp2k_link_libs

View file

@ -42,7 +42,7 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
# Install a recent developer version of Spack.
WORKDIR /opt/spack
ARG SPACK_VERSION=847f560a6eff23f2177f3e8a2c143d309bb06acf
ARG SPACK_VERSION=56495a8cd81640302a9d3a22249ce42bc4698a38
RUN git init --quiet && \
git remote add origin https://github.com/spack/spack.git && \
git fetch --quiet --depth 1 origin ${SPACK_VERSION} --no-tags && \
@ -54,7 +54,7 @@ RUN spack compiler find
RUN spack external find --all --not-buildable
# Enable Spack build cache
ARG SPACK_BUILD_CACHE=develop-2025-01-12
ARG SPACK_BUILD_CACHE=develop-2025-01-26
RUN spack mirror add ${SPACK_BUILD_CACHE} https://binaries.spack.io/${SPACK_BUILD_CACHE} && \
spack mirror add develop https://binaries.spack.io/develop && \
spack buildcache keys --install --trust --force && \

View file

@ -849,7 +849,7 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
# Install a recent developer version of Spack.
WORKDIR /opt/spack
ARG SPACK_VERSION=847f560a6eff23f2177f3e8a2c143d309bb06acf
ARG SPACK_VERSION=56495a8cd81640302a9d3a22249ce42bc4698a38
RUN git init --quiet && \
git remote add origin https://github.com/spack/spack.git && \
git fetch --quiet --depth 1 origin ${{SPACK_VERSION}} --no-tags && \
@ -861,7 +861,7 @@ RUN spack compiler find
RUN spack external find --all --not-buildable
# Enable Spack build cache
ARG SPACK_BUILD_CACHE=develop-2025-01-12
ARG SPACK_BUILD_CACHE=develop-2025-01-26
RUN spack mirror add ${{SPACK_BUILD_CACHE}} https://binaries.spack.io/${{SPACK_BUILD_CACHE}} && \
spack mirror add develop https://binaries.spack.io/develop && \
spack buildcache keys --install --trust --force && \

View file

@ -84,6 +84,7 @@ if [[ "${PROFILE}" == "spack" ]] && [[ "${VERSION}" == "psmp" ]]; then
-DCP2K_USE_SIRIUS=ON \
-DCP2K_USE_LIBTORCH=OFF \
-DCP2K_USE_DLAF=ON \
-DCP2K_USE_DFTD4=ON \
.. |& tee ./cmake.log
CMAKE_EXIT_CODE=$?

View file

@ -18,6 +18,7 @@ spack:
- "sirius @7.6.1 +fortran +pugixml ~apps"
- "libvori@220621"
- "spla@1.6.1 +fortran"
- "dftd4@3.6.0 build_system=cmake"
# Unfortunately, ScaLAPACK 2.2.1 has not yet been packaged by Spack.
# https://github.com/Reference-ScaLAPACK/scalapack/tree/v2.2.1
# which contains https://github.com/Reference-ScaLAPACK/scalapack/pull/26