mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-28 14:15:19 -04:00
[cmake] More modern ways to use cmake (partially)
This commit is contained in:
parent
e4f5572f67
commit
fc165b5e60
37 changed files with 917 additions and 380 deletions
317
CMakeLists.txt
317
CMakeLists.txt
|
|
@ -28,6 +28,10 @@ include(CustomTargets)
|
|||
|
||||
cmake_policy(SET CMP0048 NEW)
|
||||
|
||||
if(POLICY CMP0144)
|
||||
cmake_policy(SET CMP0144 NEW)
|
||||
endif()
|
||||
|
||||
set(VERSION_MAJOR 23)
|
||||
# anything above 12 is to indicate that it is devel-branch. The git hash commit
|
||||
# is the only important information to give. It is retrieved few lines below.
|
||||
|
|
@ -434,8 +438,9 @@ else()
|
|||
OR CP2K_USE_QUIP)
|
||||
message(
|
||||
WARNING
|
||||
"SIRIUS, COSMA, SPLA, ELPA, METIS, PLUMED, PEXSI and QUIP require MPI support. Either change -DCP2K_USE_MPI to ON or turn the following dependencies off"
|
||||
)
|
||||
"SIRIUS, COSMA, SPLA, ELPA, METIS, PLUMED, PEXSI and QUIP require MPI support.\n"
|
||||
"Either set -DCP2K_USE_MPI to ON or turn the following dependencies off\n\n"
|
||||
"List of dependencies with mpi support\n")
|
||||
foreach(
|
||||
__libs
|
||||
sirius
|
||||
|
|
@ -460,7 +465,7 @@ find_package(Lapack REQUIRED) # also calls find_package(BLAS)
|
|||
# SMM (Small Matrix-Matrix multiplication)
|
||||
if(CP2K_USE_LIBXSMM)
|
||||
find_package(LibXSMM REQUIRED)
|
||||
message(STATUS "-- Using libxsmm for Small Matrix Multiplication")
|
||||
message(STATUS "Using libxsmm for Small Matrix Multiplication")
|
||||
endif()
|
||||
|
||||
# in practice it is always for any decent configuration. But I add a flags to
|
||||
|
|
@ -513,9 +518,9 @@ if(CP2K_USE_ACCEL MATCHES "CUDA")
|
|||
|
||||
set(CMAKE_CUDA_ARCHITECTURES ${CP2K_GPU_ARCH_NUMBER_${CP2K_WITH_GPU}})
|
||||
|
||||
message(STATUS "GPU target architecture: " ${CP2K_WITH_GPU})
|
||||
message(STATUS "GPU architecture number: " ${CMAKE_CUDA_ARCHITECTURES})
|
||||
message(STATUS "GPU profiling enabled: " ${CP2K_WITH_CUDA_PROFILING})
|
||||
message(STATUS "GPU target architecture: ${CP2K_WITH_GPU}\n"
|
||||
"GPU architecture number: ${CMAKE_CUDA_ARCHITECTURES}\n"
|
||||
"GPU profiling enabled: ${CP2K_WITH_CUDA_PROFILING}\n")
|
||||
|
||||
if(WITH_CUDA_PROFILING)
|
||||
find_library(
|
||||
|
|
@ -553,21 +558,24 @@ elseif(CP2K_USE_ACCEL MATCHES "HIP")
|
|||
set(CP2K_USE_HIP ON)
|
||||
endif()
|
||||
|
||||
# PACKAGE DISCOVERY (compiler configuration can impact package discovery)
|
||||
find_package(OpenMP REQUIRED COMPONENTS Fortran C CXX)
|
||||
|
||||
# CP2K options are prefixed with CP2K_ (namespacing) while dbcsr does not.
|
||||
|
||||
set(USE_ACCEL "")
|
||||
set(BLAS_LIBRARIES "")
|
||||
set(LAPACK_LIBRARIES "")
|
||||
set(USE_MPI ${CP2K_USE_MPI})
|
||||
set(WITH_EXAMPLES OFF)
|
||||
set(BUILD_TESTING OFF)
|
||||
set(WITH_C_API OFF)
|
||||
set(USE_SMM "")
|
||||
set(USE_OPENMP ON)
|
||||
|
||||
if(NOT CP2K_BUILD_DBCSR)
|
||||
find_package(DBCSR 2.4 REQUIRED)
|
||||
else()
|
||||
# replace this with the block command when we update to cmake 3.25
|
||||
|
||||
set(USE_ACCEL "")
|
||||
set(BLAS_LIBRARIES "")
|
||||
set(LAPACK_LIBRARIES "")
|
||||
set(USE_MPI ${CP2K_USE_MPI})
|
||||
set(WITH_EXAMPLES OFF)
|
||||
set(BUILD_TESTING OFF)
|
||||
set(WITH_C_API OFF)
|
||||
set(USE_SMM "")
|
||||
set(USE_OPENMP ON)
|
||||
check_git_submodule(dbcsr "${CMAKE_SOURCE_DIR}/exts/dbcsr")
|
||||
if(DBCSR_USE_ACCEL AND CP2K_USE_ACCEL MATCHES "CUDA|HIP")
|
||||
if(CP2K_USE_ACCEL MATCHES "CUDA")
|
||||
|
|
@ -592,11 +600,6 @@ else()
|
|||
endif()
|
||||
endif()
|
||||
|
||||
# =================================================================================================
|
||||
# PACKAGE DISCOVERY (compiler configuration can impact package discovery)
|
||||
|
||||
find_package(OpenMP REQUIRED COMPONENTS Fortran C CXX)
|
||||
|
||||
# ==================================
|
||||
if(CP2K_USE_ELPA)
|
||||
find_package(Elpa REQUIRED)
|
||||
|
|
@ -633,17 +636,17 @@ if(CP2K_USE_FFTW3)
|
|||
endif()
|
||||
|
||||
if((CP2K_ENABLE_FFTW3_THREADS_SUPPORT) AND (NOT TARGET
|
||||
CP2K::FFTW3::fftw3_threads))
|
||||
cp2k::FFTW3::fftw3_threads))
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"fftw3 was compiled without multithreading support (--enable-threads option in fftw build system)."
|
||||
"fftw3 was compiled without multithreading support (--enable-threads option in the fftw build system)."
|
||||
)
|
||||
endif()
|
||||
|
||||
if((CP2K_ENABLE_FFTW3_OPENMP_SUPPORT) AND (NOT TARGET CP2K::FFTW3::fftw3_omp))
|
||||
if((CP2K_ENABLE_FFTW3_OPENMP_SUPPORT) AND (NOT TARGET cp2k::FFTW3::fftw3_omp))
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"fftw3 was compiled without openmp support (--enable-openmp option in fftw build system)."
|
||||
"fftw3 was compiled without openmp support (--enable-openmp option in the fftw build system)."
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
|
@ -755,278 +758,234 @@ get_target_property(CP2K_LIBS cp2k_link_libs INTERFACE_LINK_LIBRARIES)
|
|||
configure_file(cmake/cp2k.pc.in cp2k.pc @ONLY)
|
||||
|
||||
message(
|
||||
STATUS "--------------------------------------------------------------------")
|
||||
message(
|
||||
STATUS "- -")
|
||||
message(
|
||||
STATUS "- Summary of enabled dependencies -")
|
||||
message(
|
||||
STATUS "- -")
|
||||
message(
|
||||
STATUS "--------------------------------------------------------------------")
|
||||
""
|
||||
"--------------------------------------------------------------------\n"
|
||||
"- -\n"
|
||||
"- Summary of enabled dependencies -\n"
|
||||
"- -\n"
|
||||
"--------------------------------------------------------------------\n\n")
|
||||
|
||||
message(STATUS " ")
|
||||
message(STATUS "- BLAS AND LAPACK")
|
||||
message(STATUS " ")
|
||||
|
||||
message(STATUS " - vendor : " ${CP2K_BLAS_VENDOR})
|
||||
message(STATUS " - include directories : " ${CP2K_BLAS_INCLUDE_DIRS}
|
||||
${LAPACK_INCLUDE_DIR})
|
||||
message(STATUS " - libraries : " ${CP2K_BLAS_LINK_LIBRARIES} " "
|
||||
${CP2K_LAPACK_LINK_LIBRARIES})
|
||||
message(
|
||||
" - BLAS AND LAPACK\n\n"
|
||||
" - vendor : ${CP2K_BLAS_VENDOR}\n"
|
||||
" - include directories : ${CP2K_BLAS_INCLUDE_DIR} ${LAPACK_INCLUDE_DIR}\n"
|
||||
" - libraries : ${CP2K_BLAS_LINK_LIBRARIES} ${CP2K_LAPACK_LINK_LIBRARIES}\n\n"
|
||||
)
|
||||
|
||||
if(CP2K_USE_MPI)
|
||||
message(STATUS " ")
|
||||
message(STATUS "- MPI")
|
||||
message(STATUS " - include directories : " ${MPI_INCLUDE_DIRS})
|
||||
message(STATUS " - libraries : " ${MPI_LIBRARIES})
|
||||
message(" - MPI\n" " - include directories : ${MPI_INCLUDE_DIRS}\n"
|
||||
" - libraries : ${MPI_LIBRARIES}\n\n")
|
||||
|
||||
if(CP2K_USE_MPI_F08)
|
||||
message(STATUS " - MPI_08 : ON")
|
||||
message(" - MPI_08 : ON\n")
|
||||
endif()
|
||||
|
||||
if(MPI_Fortran_HAVE_F08_MODULE AND NOT CP2K_USE_MPI_F08)
|
||||
message(
|
||||
STATUS
|
||||
" - MPI_08 is supposed by MPI but turned off by default. To use it add -DCP2K_USE_MPI_F08=ON to cmake"
|
||||
)
|
||||
" - MPI_08 is supposed by MPI but turned off by default.\n"
|
||||
" To use it add -DCP2K_USE_MPI_F08=ON to the cmake command line\n\n")
|
||||
endif()
|
||||
|
||||
message(STATUS " ")
|
||||
message(STATUS "- SCALAPACK:")
|
||||
message(STATUS " - libraries : " ${CP2K_SCALAPACK_LINK_LIBRARIES})
|
||||
endif()
|
||||
|
||||
message(STATUS " - Hardware Acceleration:")
|
||||
message(STATUS " ")
|
||||
if(CP2K_USE_ACCEL MATCHES "CUDA")
|
||||
message(STATUS " ")
|
||||
message(STATUS "- CUDA:")
|
||||
message(STATUS " - GPU target architecture : " ${CP2K_WITH_GPU})
|
||||
message(STATUS " - GPU architecture number : " ${CP2K_ACC_ARCH_NUMBER})
|
||||
message(STATUS " - GPU profiling enabled : "
|
||||
${CP2K_WITH_CUDA_PROFILING})
|
||||
endif()
|
||||
|
||||
if(CP2K_USE_ACCEL MATCHES "HIP")
|
||||
message(STATUS " ")
|
||||
message(STATUS "- HIP:")
|
||||
message(STATUS " - GPU target architecture : " ${CP2K_WITH_GPU})
|
||||
message(STATUS " - GPU architecture number : " ${CP2K_ACC_ARCH_NUMBER})
|
||||
message(" - SCALAPACK:\n"
|
||||
" - libraries : ${CP2K_SCALAPACK_LINK_LIBRARIES}\n\n")
|
||||
endif()
|
||||
|
||||
if((CP2K_USE_ACCEL MATCHES "CUDA") OR (CP2K_USE_ACCEL MATCHES "HIP"))
|
||||
message(STATUS " ")
|
||||
|
||||
message(" - Hardware Acceleration:\n")
|
||||
if(CP2K_USE_ACCEL MATCHES "CUDA")
|
||||
message(
|
||||
" - CUDA:\n" " - GPU target architecture : ${CP2K_WITH_GPU}\n"
|
||||
" - GPU architecture number : ${CP2K_ACC_ARCH_NUMBER}"
|
||||
" - GPU profiling enabled : ${CP2K_WITH_CUDA_PROFILING}\n\n")
|
||||
endif()
|
||||
|
||||
if(CP2K_USE_ACCEL MATCHES "HIP")
|
||||
message(" - HIP:\n" " - GPU target architecture : ${CP2K_WITH_GPU}\n"
|
||||
" - GPU architecture number : ${CP2K_ACC_ARCH_NUMBER}\n\n")
|
||||
endif()
|
||||
|
||||
message(
|
||||
STATUS
|
||||
" Note : Enabling hardware acceleration enable acceleration of the grid, pw, and dbm modules by default"
|
||||
)
|
||||
message(STATUS " - GRID module : " ${CP2K_USE_GRID_GPU})
|
||||
message(STATUS " - PW module : " ${CP2K_USE_PW_GPU})
|
||||
message(STATUS " - DBM module : " ${CP2K_USE_DBM_GPU})
|
||||
"Note : Enabling hardware acceleration enable acceleration of the grid, pw, and dbm modules by default\n"
|
||||
" - GRID module : ${CP2K_USE_GRID_GPU}\n"
|
||||
" - PW module : ${CP2K_USE_PW_GPU}\n"
|
||||
" - DBM module : ${CP2K_USE_DBM_GPU}\n\n")
|
||||
endif()
|
||||
|
||||
if(CP2K_USE_LIBXC)
|
||||
message(STATUS " ")
|
||||
message(
|
||||
STATUS
|
||||
"- LIBXC (note to package managers : libxc can be build with cmake as well)"
|
||||
)
|
||||
message(STATUS " - include directories : " ${CP2K_LIBXC_INCLUDE_DIRS})
|
||||
message(STATUS " - libraries : " ${CP2K_LIBXC_LINK_LIBRARIES})
|
||||
" - LIBXC (note to package managers : libxc can be build with cmake as well)"
|
||||
" - include directories : ${CP2K_LIBXC_INCLUDE_DIRS}\n"
|
||||
" - libraries : ${CP2K_LIBXC_LINK_LIBRARIES}\n\n")
|
||||
endif()
|
||||
|
||||
if(CP2K_USE_LIBTORCH)
|
||||
message(STATUS " ")
|
||||
message(STATUS "- LIBTORCH")
|
||||
message(STATUS " - libraries : " ${CP2K_LIBTORCH_LIBRARIES})
|
||||
message(" - LIBTORCH\n" " - libraries : ${CP2K_LIBTORCH_LIBRARIES}\n\n")
|
||||
endif()
|
||||
|
||||
if(CP2K_USE_FFTW3)
|
||||
message(STATUS " ")
|
||||
message(STATUS "- FFTW3")
|
||||
message(STATUS " - include directories : " ${CP2K_FFTW3_INCLUDE_DIRS})
|
||||
message(STATUS " - libraries : " ${CP2K_FFTW3_LINK_LIBRARIES})
|
||||
message(" - FFTW3\n"
|
||||
" - include directories : ${CP2K_FFTW3_INCLUDE_DIRS}\n"
|
||||
" - libraries : ${CP2K_FFTW3_LINK_LIBRARIES}\n\n")
|
||||
endif()
|
||||
|
||||
if(CP2K_USE_LIBXSMM)
|
||||
message(STATUS " ")
|
||||
message(STATUS "- libxsmm")
|
||||
message(STATUS " - include directories : " ${CP2K_LIBXSMM_INCLUDE_DIRS})
|
||||
message(
|
||||
STATUS
|
||||
" - libraries : ${CP2K_LIBXSMMEXT_LINK_LIBRARIES};${CP2K_LIBXSMMF_LINK_LIBRARIES}"
|
||||
" - libxsmm\n"
|
||||
" - include directories : ${CP2K_LIBXSMM_INCLUDE_DIRS}\n"
|
||||
" - libraries : ${CP2K_LIBXSMMEXT_LINK_LIBRARIES};${CP2K_LIBXSMMF_LINK_LIBRARIES}\n\n"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(CP2K_USE_SPLA)
|
||||
message(STATUS " ")
|
||||
message(STATUS "- SPLA :")
|
||||
message(STATUS " - include directories : " ${SPLA_INCLUDE_DIRS})
|
||||
message(STATUS " - lbraries : " "${SPLA_LIBRARIES}")
|
||||
message(" - SPLA\n" " - include directories : ${SPLA_INCLUDE_DIRS}\n"
|
||||
" - lbraries : ${SPLA_LIBRARIES}\n\n")
|
||||
endif()
|
||||
|
||||
if(CP2K_USE_SIRIUS)
|
||||
message(STATUS " ")
|
||||
message(STATUS "- SIRIUS :")
|
||||
message(STATUS " - include directories : " ${SIRIUS_INCLUDE_DIRS})
|
||||
message(STATUS " - libraries : " ${SIRIUS_LIBRARIES})
|
||||
message(
|
||||
" - SIRIUS :\n"
|
||||
" - include directories : ${SIRIUS_INCLUDE_DIRS}\n"
|
||||
" - libraries : ${SIRIUS_LIBRARIES}\n"
|
||||
" - dependencies :\n"
|
||||
" - spla\n"
|
||||
" - SpFFT\n"
|
||||
" - SPGLIB\n"
|
||||
" - LibXC\n"
|
||||
" - fftw3\n"
|
||||
" - hdf5\n"
|
||||
" - GSL\n\n")
|
||||
|
||||
message(STATUS " - dependencies : ")
|
||||
message(STATUS " - spla")
|
||||
message(STATUS " - SpFFT")
|
||||
message(STATUS " - SPGLIB")
|
||||
message(STATUS " - LibXC")
|
||||
message(STATUS " - fftw3")
|
||||
message(STATUS " - hdf5")
|
||||
message(STATUS " - GSL")
|
||||
if(CP2K_USE_VDWXC)
|
||||
message(STATUS " - VDWXC")
|
||||
message(" - VDWXC\n")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CP2K_USE_COSMA)
|
||||
message(STATUS " ")
|
||||
message(STATUS "- COSMA")
|
||||
message(STATUS " - include directories : " ${COSMA_INCLUDE_DIRS})
|
||||
message(STATUS " - libraries : " ${COSMA_LIBRARIES})
|
||||
message(" - COSMA\n" " - include directories : ${COSMA_INCLUDE_DIRS}\n"
|
||||
" - libraries : ${COSMA_LIBRARIES}\n\n")
|
||||
endif()
|
||||
|
||||
if(CP2K_USE_QUIP)
|
||||
message(STATUS " ")
|
||||
message(STATUS "- QUIP")
|
||||
message(STATUS " - include directories : " ${CP2K_LIBQUIP_INCLUDE_DIRS})
|
||||
message(STATUS " - libraries : " ${CP2K_LIBQUIP_LINK_LIBRARIES})
|
||||
message(" - QUIP\n"
|
||||
" - include directories : ${CP2K_LIBQUIP_INCLUDE_DIRS}\n"
|
||||
" - libraries : ${CP2K_LIBQUIP_LINK_LIBRARIES}\n\n")
|
||||
endif()
|
||||
|
||||
if(CP2K_USE_PEXSI)
|
||||
message(STATUS " ")
|
||||
message(STATUS "- PEXSI")
|
||||
message(" - PEXSI\n\n")
|
||||
endif()
|
||||
|
||||
if(CP2K_USE_LIBINT2)
|
||||
message(STATUS " ")
|
||||
message(STATUS "- libint2")
|
||||
message(STATUS " - include directories : " ${CP2K_LIBINT2_INCLUDE_DIRS})
|
||||
message(STATUS " - libraries : " ${CP2K_LIBINT2_LINK_LIBRARIES})
|
||||
message(" - libint2\n"
|
||||
" - include directories : ${CP2K_LIBINT2_INCLUDE_DIRS}\n"
|
||||
" - libraries : ${CP2K_LIBINT2_LINK_LIBRARIES}\n\n")
|
||||
endif()
|
||||
|
||||
if(CP2K_USE_VORI)
|
||||
message(STATUS " ")
|
||||
message(STATUS "- libvori")
|
||||
message(STATUS " - include directories : " ${CP2K_LIBVORI_INCLUDE_DIRS})
|
||||
message(STATUS " - libraries : " ${CP2K_LIBVORI_LINK_LIBRARIES})
|
||||
message(" - libvori\n"
|
||||
" - include directories : ${CP2K_LIBVORI_INCLUDE_DIRS}\n"
|
||||
" - libraries : ${CP2K_LIBVORI_LINK_LIBRARIES}\n\n")
|
||||
endif()
|
||||
|
||||
if(CP2K_USE_SPGLIB)
|
||||
message(STATUS " ")
|
||||
message(STATUS "- spglib")
|
||||
message(STATUS " - include directories : " ${CP2K_LIBSPG_INCLUDE_DIRS})
|
||||
message(STATUS " - libraries : " ${CP2K_LIBSPG_LINK_LIBRARIES})
|
||||
message(" - spglib\n"
|
||||
" - include directories : ${CP2K_LIBSPG_INCLUDE_DIRS}\n"
|
||||
" - libraries : ${CP2K_LIBSPG_LINK_LIBRARIES}\n\n")
|
||||
endif()
|
||||
|
||||
if(CP2K_USE_ELPA)
|
||||
message(STATUS "- ELPA")
|
||||
message(STATUS " - include directories : " ${CP2K_ELPA_INCLUDE_DIRS})
|
||||
message(STATUS " - libraries : " ${CP2K_ELPA_LINK_LIBRARIES})
|
||||
message(" - ELPA\n" " - include directories : ${CP2K_ELPA_INCLUDE_DIRS}\n"
|
||||
" - libraries : ${CP2K_ELPA_LINK_LIBRARIES})\n\n")
|
||||
endif()
|
||||
|
||||
if(CP2K_USE_SUPERLU)
|
||||
message(STATUS " ")
|
||||
message(STATUS "- superlu")
|
||||
message(STATUS " - include directories : " ${CP2K_SUPERLU_INCLUDE_DIRS})
|
||||
message(STATUS " - libraries : " ${CP2K_SUPERLU_LINK_LIBRARIES})
|
||||
message(" - superlu\n"
|
||||
" - include directories : ${CP2K_SUPERLU_INCLUDE_DIRS}\n"
|
||||
" - libraries : ${CP2K_SUPERLU_LINK_LIBRARIES}\n\n")
|
||||
endif()
|
||||
|
||||
message(STATUS " ")
|
||||
message(
|
||||
STATUS "--------------------------------------------------------------------")
|
||||
message(
|
||||
STATUS "- -")
|
||||
message(
|
||||
STATUS "- List of dependencies not included in this build -")
|
||||
message(
|
||||
STATUS "- -")
|
||||
message(
|
||||
STATUS "--------------------------------------------------------------------")
|
||||
|
||||
message(STATUS " List of dependencies not included in this build :")
|
||||
"--------------------------------------------------------------------\n"
|
||||
"- -\n"
|
||||
"- List of dependencies not included in this build -\n"
|
||||
"- -\n"
|
||||
"--------------------------------------------------------------------\n")
|
||||
|
||||
if(NOT CP2K_USE_MPI)
|
||||
message(STATUS " - MPI")
|
||||
message(" - MPI")
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_USE_SIRIUS)
|
||||
message(STATUS " - SIRIUS")
|
||||
message(" - SIRIUS")
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_USE_SPGLIB)
|
||||
message(STATUS " - SPGLIB")
|
||||
message(" - SPGLIB")
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_USE_COSMA)
|
||||
message(STATUS " - COSMA")
|
||||
message(" - COSMA")
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_USE_SPLA)
|
||||
message(STATUS " - SPLA")
|
||||
message(" - SPLA")
|
||||
endif()
|
||||
|
||||
if(${CP2K_USE_ACCEL} MATCHES "NONE")
|
||||
message(STATUS " - GPU acceleration is disabled")
|
||||
message(" - GPU acceleration is disabled")
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_USE_ELPA)
|
||||
message(STATUS " - ELPA")
|
||||
message(" - ELPA")
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_USE_PLUMMED)
|
||||
message(STATUS " - PLUMED")
|
||||
message(" - PLUMED")
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_USE_QUIP)
|
||||
message(STATUS " - QUIP")
|
||||
message(" - QUIP")
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_USE_LIBXSMM)
|
||||
message(STATUS " - LIBXSMM")
|
||||
message(" - LIBXSMM")
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_USE_LIBINT2)
|
||||
message(STATUS " - LIBINT2")
|
||||
message(" - LIBINT2")
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_USE_LIBXC)
|
||||
message(STATUS " - LIBXC")
|
||||
message(" - LIBXC")
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_USE_VORI)
|
||||
message(STATUS " - LIBVORI")
|
||||
message(" - LIBVORI")
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_USE_FFTW3)
|
||||
message(STATUS " - FFTW3")
|
||||
message(" - FFTW3")
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_USE_PEXSI)
|
||||
message(STATUS " - PEXSI")
|
||||
message(" - PEXSI")
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_USE_SUPERLU)
|
||||
message(STATUS " - SUPERLU")
|
||||
message(" - SUPERLU")
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_USE_LIBTORCH)
|
||||
message(STATUS " - libtorch")
|
||||
message(" - libtorch")
|
||||
endif()
|
||||
|
||||
if(CP2K_ENABLE_REGTESTS)
|
||||
if(CP2K_ENABLE_REGTESTS OR cp2k_TESTS)
|
||||
message(
|
||||
STATUS
|
||||
"\n\n"
|
||||
"To run the regtests you need to run the following commands\n"
|
||||
"\n\n cd ..\n"
|
||||
"tools/regtesting/do_regtest.py -cp2kdir . -nobuild -version ${__cp2k_cmake_exts} -arch ${__cp2k_cmake_name}\n\n"
|
||||
"\n\n"
|
||||
"To run the regtests you need to run the following commands\n"
|
||||
"\n\n cd ..\n"
|
||||
"tests/do_regtest.py -cp2kdir . -nobuild -version ${__cp2k_cmake_exts} -arch ${__cp2k_cmake_name}\n\n"
|
||||
)
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -54,29 +54,29 @@ find_package_handle_standard_args(
|
|||
|
||||
# add target to link against
|
||||
if(NOT TARGET Armpl::armpl)
|
||||
add_library(CP2K::BLAS::Armpl::armpl INTERFACE IMPORTED)
|
||||
add_library(cp2k::BLAS::Armpl::armpl INTERFACE IMPORTED)
|
||||
# now define an alias to the target library
|
||||
add_library(CP2K::BLAS::Armpl::blas ALIAS CP2K::BLAS::Armpl::armpl)
|
||||
add_library(cp2k::BLAS::Armpl::blas ALIAS cp2k::BLAS::Armpl::armpl)
|
||||
endif()
|
||||
|
||||
# we need to iniitialize the targets of each individual libraries only once.
|
||||
foreach(_var armpl_ilp64 armpl_lp64 armpl_ilp64_mp armpl_lp64_mp)
|
||||
if(NOT TARGET CP2K::BLAS::Armpl::${_var})
|
||||
if(NOT TARGET cp2k::BLAS::Armpl::${_var})
|
||||
string(TOUPPER "${_var}" _var_up)
|
||||
add_library(CP2K::BLAS::Armpl::${_var} INTERFACE IMPORTED)
|
||||
add_library(cp2k::BLAS::Armpl::${_var} INTERFACE IMPORTED)
|
||||
set_property(
|
||||
TARGET CP2K::BLAS::Armpl::${_var} PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
TARGET cp2k::BLAS::Armpl::${_var} PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
${CP2K_ARMPL_INCLUDE_DIRS})
|
||||
set_property(
|
||||
TARGET CP2K::BLAS::Armpl::${_var}
|
||||
TARGET cp2k::BLAS::Armpl::${_var}
|
||||
PROPERTY INTERFACE_LINK_LIBRARIES "${CP2K_${_var_up}_LINK_LIBRARIES}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set_property(TARGET CP2K::BLAS::Armpl::armpl
|
||||
set_property(TARGET cp2k::BLAS::Armpl::armpl
|
||||
PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CP2K_ARMPL_INCLUDE_DIRS})
|
||||
set_property(
|
||||
TARGET CP2K::BLAS::Armpl::armpl
|
||||
TARGET cp2k::BLAS::Armpl::armpl
|
||||
PROPERTY INTERFACE_LINK_LIBRARIES
|
||||
"${CP2K_${CP2K_BLAS_armpl_LIB}_LINK_LIBRARIES}")
|
||||
|
||||
|
|
|
|||
|
|
@ -22,13 +22,13 @@ find_package_handle_standard_args(Atlas REQUIRED_VARS CP2K_ATLAS_INCLUDE_DIRS
|
|||
|
||||
# add target to link against
|
||||
if(CP2K_ATLAS_FOUND AND NOT TARGET CP2K_ATLAS::atlas)
|
||||
if(NOT TARGET CP2K::BLAS::ATLAS::atlas)
|
||||
add_library(CP2K::BLAS::ATLAS::atlas INTERFACE IMPORTED)
|
||||
if(NOT TARGET cp2k::BLAS::ATLAS::atlas)
|
||||
add_library(cp2k::BLAS::ATLAS::atlas INTERFACE IMPORTED)
|
||||
endif()
|
||||
set_property(TARGET CP2K::BLAS::ATLAS::atlas
|
||||
set_property(TARGET cp2k::BLAS::ATLAS::atlas
|
||||
PROPERTY INTERFACE_LINK_LIBRARIES ${CP2K_ATLAS_LINK_LIBRARIES})
|
||||
set_property(
|
||||
TARGET CP2K::BLAS::ATLAS::atlas PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
TARGET cp2k::BLAS::ATLAS::atlas PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
${CP2K_ATLAS_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -74,12 +74,12 @@ set(CP2K_BLAS_FOUND FALSE)
|
|||
|
||||
if(NOT CP2K_BLAS_VENDOR MATCHES "auto|CUSTOM")
|
||||
find_package(${CP2K_BLAS_VENDOR} REQUIRED)
|
||||
if(TARGET CP2K::BLAS::${CP2K_BLAS_VENDOR}::blas)
|
||||
if(TARGET cp2k::BLAS::${CP2K_BLAS_VENDOR}::blas)
|
||||
get_target_property(
|
||||
CP2K_BLAS_INCLUDE_DIRS CP2K::BLAS::${CP2K_BLAS_VENDOR}::blas
|
||||
CP2K_BLAS_INCLUDE_DIRS cp2k::BLAS::${CP2K_BLAS_VENDOR}::blas
|
||||
INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(
|
||||
CP2K_BLAS_LINK_LIBRARIES CP2K::BLAS::${CP2K_BLAS_VENDOR}::blas
|
||||
CP2K_BLAS_LINK_LIBRARIES cp2k::BLAS::${CP2K_BLAS_VENDOR}::blas
|
||||
INTERFACE_LINK_LIBRARIES)
|
||||
set(CP2K_BLAS_FOUND TRUE)
|
||||
endif()
|
||||
|
|
@ -100,10 +100,10 @@ else()
|
|||
foreach(_libs ${__BLAS_VENDOR_LIST})
|
||||
# I exclude the first item of the list
|
||||
find_package(${_libs})
|
||||
if(TARGET CP2K::BLAS::${_libs}::blas)
|
||||
get_target_property(CP2K_BLAS_INCLUDE_DIRS CP2K::BLAS::${_libs}::blas
|
||||
if(TARGET cp2k::BLAS::${_libs}::blas)
|
||||
get_target_property(CP2K_BLAS_INCLUDE_DIRS cp2k::BLAS::${_libs}::blas
|
||||
INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(CP2K_BLAS_LINK_LIBRARIES CP2K::BLAS::${_libs}::blas
|
||||
get_target_property(CP2K_BLAS_LINK_LIBRARIES cp2k::BLAS::${_libs}::blas
|
||||
INTERFACE_LINK_LIBRARIES)
|
||||
set(CP2K_BLAS_VENDOR "${_libs}")
|
||||
set(CP2K_BLAS_FOUND TRUE)
|
||||
|
|
@ -120,16 +120,16 @@ endif()
|
|||
find_package_handle_standard_args(
|
||||
Blas REQUIRED_VARS CP2K_BLAS_LINK_LIBRARIES CP2K_BLAS_VENDOR CP2K_BLAS_FOUND)
|
||||
|
||||
if(NOT TARGET CP2K::BLAS::blas)
|
||||
add_library(CP2K::BLAS::blas INTERFACE IMPORTED)
|
||||
if(NOT TARGET cp2k::BLAS::blas)
|
||||
add_library(cp2k::BLAS::blas INTERFACE IMPORTED)
|
||||
endif()
|
||||
|
||||
set_target_properties(CP2K::BLAS::blas PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
set_target_properties(cp2k::BLAS::blas PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
"${CP2K_BLAS_LINK_LIBRARIES}")
|
||||
|
||||
if(CP2K_BLAS_INCLUDE_DIRS)
|
||||
set_target_properties(
|
||||
CP2K::BLAS::blas PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
cp2k::BLAS::blas PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CP2K_BLAS_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -44,17 +44,17 @@ endif()
|
|||
|
||||
# add target to link against
|
||||
if(CP2K_BLIS_FOUND)
|
||||
if(NOT TARGET CP2K::BLAS::Blis::blis)
|
||||
add_library(CP2K::BLAS::Blis::blis INTERFACE IMPORTED)
|
||||
add_library(CP2K::BLAS::Blis::blas alias CP2K::BLAS::Blis::blis)
|
||||
if(NOT TARGET cp2k::BLAS::Blis::blis)
|
||||
add_library(cp2k::BLAS::Blis::blis INTERFACE IMPORTED)
|
||||
add_library(cp2k::BLAS::Blis::blas alias cp2k::BLAS::Blis::blis)
|
||||
endif()
|
||||
|
||||
set_property(TARGET CP2K::BLAS::Blis::blis
|
||||
set_property(TARGET cp2k::BLAS::Blis::blis
|
||||
PROPERTY INTERFACE_LINK_LIBRARIES ${CP2K_BLIS_LINK_LIBRARIES})
|
||||
|
||||
if(BLIS_INCLUDE_DIRS)
|
||||
set_property(
|
||||
TARGET CP2K::BLAS::Blis::blis PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
TARGET cp2k::BLAS::Blis::blis PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
${CP2K_BLIS_INCLUDE_DIRS})
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -20,11 +20,11 @@ cp2k_include_dirs(LIBCAL "cal.h")
|
|||
find_package_handle_standard_args(Cal DEFAULT_MSG CP2K_CAL_LINK_LIBRARIES
|
||||
CP2K_CAL_INCLUDE_DIRS)
|
||||
|
||||
if(CP2K_LIBCAL_FOUND AND not TARGET CP2K::CAL::cal)
|
||||
add_library(CP2K::CAL INTERFACE IMPORTED)
|
||||
set_target_properties(CP2K::CAL::cal PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
if(CP2K_LIBCAL_FOUND AND not TARGET cp2k::CAL::cal)
|
||||
add_library(cp2k::CAL INTERFACE IMPORTED)
|
||||
set_target_properties(cp2k::CAL::cal PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
"${CP2K_CAL_LINK_LIBRARIES}")
|
||||
set_target_properties(CP2K::CAL::cal PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
set_target_properties(cp2k::CAL::cal PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CP2K_CAL_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -21,14 +21,14 @@ find_package_handle_standard_args(
|
|||
CuSolverMP DEFAULT_MSG CP2K_CUSOLVER_MP_LINK_LIBRARIES
|
||||
CP2K_CUSOLVER_MP_INCLUDE_DIRS)
|
||||
|
||||
if(CP2K_CUSOLVER_MP_FOUND AND NOT TARGET CP2K::CUSOLVER_MP::cusolver_mp)
|
||||
add_library(CP2K::CUSOLVER_MP::cusolver_mp INTERFACE IMPORTED)
|
||||
if(CP2K_CUSOLVER_MP_FOUND AND NOT TARGET cp2k::CUSOLVER_MP::cusolver_mp)
|
||||
add_library(cp2k::CUSOLVER_MP::cusolver_mp INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
CP2K::CUSOLVER_MP::cusolver_mp
|
||||
cp2k::CUSOLVER_MP::cusolver_mp
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
"${CP2K_CUSOLVER_MP_LINK_LIBRARIES};CP2K::CAL::cal")
|
||||
"${CP2K_CUSOLVER_MP_LINK_LIBRARIES};cp2k::CAL::cal")
|
||||
set_target_properties(
|
||||
CP2K::CUSOLVER_MP::cusolver_mp
|
||||
cp2k::CUSOLVER_MP::cusolver_mp
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CP2K_CUSOLVER_MP_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -31,15 +31,15 @@ find_package_handle_standard_args(Elpa "DEFAULT_MSG" CP2K_ELPA_LINK_LIBRARIES
|
|||
CP2K_ELPA_INCLUDE_DIRS)
|
||||
|
||||
if(CP2K_ELPA_FOUND)
|
||||
if(NOT TARGET CP2K::ELPA::elpa)
|
||||
add_library(CP2K::ELPA::elpa INTERFACE IMPORTED)
|
||||
if(NOT TARGET cp2k::ELPA::elpa)
|
||||
add_library(cp2k::ELPA::elpa INTERFACE IMPORTED)
|
||||
endif()
|
||||
set_target_properties(
|
||||
CP2K::ELPA::elpa PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
cp2k::ELPA::elpa PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
"${CP2K_ELPA_LINK_LIBRARIES}")
|
||||
if(CP2K_ELPA_INCLUDE_DIRS)
|
||||
set_target_properties(
|
||||
CP2K::ELPA::elpa
|
||||
cp2k::ELPA::elpa
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CP2K_ELPA_INCLUDE_DIRS};${CP2K_ELPA_INCLUDE_DIRS}/modules")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -60,30 +60,30 @@ foreach(lib_name "fftw3" "fftw3l" "fftw3q" "fftw3f")
|
|||
string(TOUPPER "${lib_name}" __lib_name_up)
|
||||
|
||||
if(CP2K_${__lib_name_up}_FOUND)
|
||||
if(NOT TARGET CP2K::FFTW3::${lib_name})
|
||||
add_library(CP2K::FFTW3::${lib_name} INTERFACE IMPORTED)
|
||||
if(NOT TARGET cp2k::FFTW3::${lib_name})
|
||||
add_library(cp2k::FFTW3::${lib_name} INTERFACE IMPORTED)
|
||||
endif()
|
||||
# we do not recheck if the libraries are found when pkg_config is
|
||||
# successful.
|
||||
set_target_properties(
|
||||
CP2K::FFTW3::${lib_name}
|
||||
cp2k::FFTW3::${lib_name}
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
"${CP2K_${__lib_name_up}_LINK_LIBRARIES}")
|
||||
|
||||
if(CP2K_FFTW3_INCLUDE_DIRS)
|
||||
set_target_properties(
|
||||
CP2K::FFTW3::${lib_name} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
cp2k::FFTW3::${lib_name} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CP2K_FFTW3_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
foreach(sub_type "threads" "mpi" "omp")
|
||||
string(TOUPPER "${lib_name}_${sub_type}" __libs)
|
||||
if(CP2K_${__libs}_FOUND)
|
||||
if(NOT TARGET CP2K::FFTW3::${lib_name}_${sub_type})
|
||||
add_library(CP2K::FFTW3::${lib_name}_${sub_type} INTERFACE IMPORTED)
|
||||
if(NOT TARGET cp2k::FFTW3::${lib_name}_${sub_type})
|
||||
add_library(cp2k::FFTW3::${lib_name}_${sub_type} INTERFACE IMPORTED)
|
||||
endif()
|
||||
set_target_properties(
|
||||
CP2K::FFTW3::${lib_name}_${sub_type}
|
||||
cp2k::FFTW3::${lib_name}_${sub_type}
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
"${CP2K_${__libs}_LINK_LIBRARIES}")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -40,17 +40,17 @@ if(NOT CP2K_FLEXIBLAS_FOUND)
|
|||
endif()
|
||||
|
||||
if(CP2K_FLEXIBLAS_FOUND)
|
||||
if(NOT TARGET CP2K::BLAS::FlexiBLAS::flexiblas)
|
||||
add_library(CP2K::BLAS::FlexiBLAS::flexiblas INTERFACE IMPORTED)
|
||||
add_library(CP2K::BLAS::FlexiBLAS::blas ALIAS
|
||||
CP2K::BLAS::FlexiBLAS::flexiblas)
|
||||
if(NOT TARGET cp2k::BLAS::FlexiBLAS::flexiblas)
|
||||
add_library(cp2k::BLAS::FlexiBLAS::flexiblas INTERFACE IMPORTED)
|
||||
add_library(cp2k::BLAS::FlexiBLAS::blas ALIAS
|
||||
cp2k::BLAS::FlexiBLAS::flexiblas)
|
||||
endif()
|
||||
set_target_properties(
|
||||
CP2K::BLAS::FlexiBLAS::flexiblas
|
||||
cp2k::BLAS::FlexiBLAS::flexiblas
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES "${CP2K_FLEXIBLAS_LINK_LIBRARIES}")
|
||||
if(CP2K_FLEXIBLAS_INCLUDE_DIRS)
|
||||
set_target_properties(
|
||||
CP2K::BLAS::FlexiBLAS::flexiblas
|
||||
cp2k::BLAS::FlexiBLAS::flexiblas
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CP2K_FLEXIBLAS_INCLUDE_DIRS}")
|
||||
endif()
|
||||
set(CP2K_BLAS_VENDOR "FlexiBLAS")
|
||||
|
|
|
|||
|
|
@ -44,13 +44,13 @@ endif()
|
|||
# add target to link against
|
||||
if(GenericBLAS_FOUND)
|
||||
|
||||
if(NOT TARGET CP2K::BLAS::GenericBLAS::blas)
|
||||
add_library(CP2K::BLAS::GenericBLAS::blas INTERFACE IMPORTED)
|
||||
if(NOT TARGET cp2k::BLAS::GenericBLAS::blas)
|
||||
add_library(cp2k::BLAS::GenericBLAS::blas INTERFACE IMPORTED)
|
||||
endif()
|
||||
set_property(TARGET CP2K::BLAS::GenericBLAS::blas
|
||||
set_property(TARGET cp2k::BLAS::GenericBLAS::blas
|
||||
PROPERTY INTERFACE_LINK_LIBRARIES ${GenericBLAS_LIBRARIES})
|
||||
set_property(
|
||||
TARGET CP2K::BLAS::GenericBLAS::blas PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
TARGET cp2k::BLAS::GenericBLAS::blas PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
${GenericBLAS_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ if(CP2K_BLAS_FOUND)
|
|||
if(CP2K_BLAS_VENDOR MATCHES "MKL|OpenBLAS|Armpl|SCI|FlexiBLAS|NVHPC")
|
||||
# we just need to create the interface that's all
|
||||
set(CP2K_LAPACK_FOUND TRUE)
|
||||
get_target_property(CP2K_LAPACK_INCLUDE_DIRS CP2K::BLAS::blas
|
||||
get_target_property(CP2K_LAPACK_INCLUDE_DIRS cp2k::BLAS::blas
|
||||
INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(CP2K_LAPACK_LINK_LIBRARIES CP2K::BLAS::blas
|
||||
get_target_property(CP2K_LAPACK_LINK_LIBRARIES cp2k::BLAS::blas
|
||||
INTERFACE_LINK_LIBRARIES)
|
||||
else()
|
||||
# we might get lucky to find a pkgconfig package for lapack (fedora provides
|
||||
|
|
@ -51,15 +51,15 @@ endif()
|
|||
find_package_handle_standard_args(Lapack
|
||||
REQUIRED_VARS CP2K_LAPACK_LINK_LIBRARIES)
|
||||
|
||||
if(NOT TARGET CP2K::LAPACK::lapack)
|
||||
add_library(CP2K::LAPACK::lapack INTERFACE IMPORTED)
|
||||
add_library(CP2K::LAPACK::LAPACK ALIAS CP2K::LAPACK::lapack)
|
||||
if(NOT TARGET cp2k::LAPACK::lapack)
|
||||
add_library(cp2k::LAPACK::lapack INTERFACE IMPORTED)
|
||||
add_library(cp2k::LAPACK::LAPACK ALIAS cp2k::LAPACK::lapack)
|
||||
endif()
|
||||
set_property(TARGET CP2K::LAPACK::lapack PROPERTY INTERFACE_LINK_LIBRARIES
|
||||
set_property(TARGET cp2k::LAPACK::lapack PROPERTY INTERFACE_LINK_LIBRARIES
|
||||
${CP2K_LAPACK_LINK_LIBRARIES})
|
||||
if(CP2K_LAPACK_INCLUDE_DIRS)
|
||||
set_property(
|
||||
TARGET CP2K::LAPACK::lapack PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
TARGET cp2k::LAPACK::lapack PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
${CP2K_LAPACK_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -36,14 +36,14 @@ else()
|
|||
CP2K_LIBSPG_LINK_LIBRARIES)
|
||||
endif()
|
||||
|
||||
if(CP2K_LIBSPG_FOUND AND NOT TARGET CP2K::LIBSPG::libspg)
|
||||
add_library(CP2K::LIBSPG::libspg INTERFACE IMPORTED)
|
||||
if(CP2K_LIBSPG_FOUND AND NOT TARGET cp2k::LIBSPG::libspg)
|
||||
add_library(cp2k::LIBSPG::libspg INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
CP2K::LIBSPG::libspg PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
cp2k::LIBSPG::libspg PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
"${CP2K_LIBSPG_LINK_LIBRARIES}")
|
||||
if(CP2K_LIBSPG_INCLUDE_DIRS)
|
||||
set_target_properties(
|
||||
CP2K::LIBSPG::libspg PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
cp2k::LIBSPG::libspg PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CP2K_LIBSPG_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@ check_symbol_exists(vdwxc_init_mpi "${CP2K_LIBVDWXC_INCLUDE_DIRS}/vdwxc_mpi.h"
|
|||
find_package_handle_standard_args(
|
||||
LibVDWXC DEFAULT_MSG CP2K_LIBVDWXC_LINK_LIBRARIES CP2K_LIBVDWXC_INCLUDE_DIRS)
|
||||
|
||||
if(LibVDWXC_FOUND AND NOT TARGET CP2K::libvdwxc::libvdwxc)
|
||||
add_library(CP2K::libvdwxc::libvdwxc INTERFACE IMPORTED)
|
||||
if(LibVDWXC_FOUND AND NOT TARGET cp2k::libvdwxc::libvdwxc)
|
||||
add_library(cp2k::libvdwxc::libvdwxc INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
CP2K::libvdwxc::libvdwxc
|
||||
cp2k::libvdwxc::libvdwxc
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CP2K_LIBVDWXC_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${CP2K_LIBVDWXC_LINK_LIBRARIES}")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -24,14 +24,14 @@ else()
|
|||
CP2K_LIBVORI_LINK_LIBRARIES)
|
||||
endif()
|
||||
|
||||
if(NOT TARGET CP2K::VORI::vori)
|
||||
add_library(CP2K::VORI::vori INTERFACE IMPORTED)
|
||||
if(NOT TARGET cp2k::VORI::vori)
|
||||
add_library(cp2k::VORI::vori INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
CP2K::VORI::vori PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
cp2k::VORI::vori PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
"${CP2K_LIBVORI_LINK_LIBRARIES}")
|
||||
if(CP2K_LIBVORI_INCLUDE_DIRS)
|
||||
set_target_properties(
|
||||
CP2K::VORI::vori PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
cp2k::VORI::vori PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CP2K_LIBVORI_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -46,16 +46,16 @@ else()
|
|||
CP2K_LIBXC_LINK_LIBRARIES)
|
||||
endif()
|
||||
if(CP2K_LIBXC_FOUND)
|
||||
if(NOT TARGET CP2K::Libxc::xc)
|
||||
add_library(CP2K::Libxc::xc INTERFACE IMPORTED)
|
||||
if(NOT TARGET cp2k::Libxc::xc)
|
||||
add_library(cp2k::Libxc::xc INTERFACE IMPORTED)
|
||||
endif()
|
||||
|
||||
if(CP2K_LIBXC_INCLUDE_DIRS)
|
||||
set_target_properties(
|
||||
CP2K::Libxc::xc PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
cp2k::Libxc::xc PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CP2K_LIBXC_INCLUDE_DIRS}")
|
||||
endif()
|
||||
target_link_libraries(CP2K::Libxc::xc INTERFACE ${CP2K_LIBXC_LINK_LIBRARIES})
|
||||
target_link_libraries(cp2k::Libxc::xc INTERFACE ${CP2K_LIBXC_LINK_LIBRARIES})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(CP2K_LIBXC_FOUND CP2K_LIBXC_LINK_LIBRARIES
|
||||
|
|
|
|||
|
|
@ -57,20 +57,20 @@ else()
|
|||
CP2K_LIBXSMM_LINK_LIBRARIES)
|
||||
endif()
|
||||
|
||||
if(NOT TARGET CP2K::LibXSMM::libxsmm)
|
||||
if(NOT TARGET cp2k::LibXSMM::libxsmm)
|
||||
foreach(__lib libxsmm libxsmmf libxsmmext libxsmmnoblas)
|
||||
string(TOUPPER "CP2K_${__lib}" __lib_search_up)
|
||||
if(${__lib_search_up}_FOUND AND NOT TARGET CP2K::LibXSMM::${__lib})
|
||||
add_library(CP2K::LibXSMM::${__lib} INTERFACE IMPORTED)
|
||||
if(${__lib_search_up}_FOUND AND NOT TARGET cp2k::LibXSMM::${__lib})
|
||||
add_library(cp2k::LibXSMM::${__lib} INTERFACE IMPORTED)
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
CP2K::LibXSMM::${__lib} PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
cp2k::LibXSMM::${__lib} PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
"${${__lib_search_up}_LINK_LIBRARIES}")
|
||||
|
||||
if(CP2K_LIBXSMM_INCLUDE_DIRS)
|
||||
set_target_properties(
|
||||
CP2K::LibXSMM::${__lib}
|
||||
cp2k::LibXSMM::${__lib}
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CP2K_LIBXSMM_INCLUDE_DIRS};${CP2K_LIBXSMM_PREFIX}/include"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -42,18 +42,18 @@ find_package_handle_standard_args(
|
|||
CP2K_LIBINT2_LINK_LIBRARIES)
|
||||
|
||||
if(CP2K_LIBINT2_FOUND)
|
||||
if(NOT TARGET CP2K::Libint2::int2)
|
||||
add_library(CP2K::Libint2::int2 INTERFACE IMPORTED)
|
||||
if(NOT TARGET cp2k::Libint2::int2)
|
||||
add_library(cp2k::Libint2::int2 INTERFACE IMPORTED)
|
||||
endif()
|
||||
|
||||
if(CP2K_LIBINT2_INCLUDE_DIRS)
|
||||
set_target_properties(
|
||||
CP2K::Libint2::int2 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
cp2k::Libint2::int2 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CP2K_LIBINT2_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
CP2K::Libint2::int2 PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
cp2k::Libint2::int2 PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
${CP2K_LIBINT2_LINK_LIBRARIES})
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ foreach(_libtype "ST" "DYN")
|
|||
|
||||
string(TOLOWER "${_iface}_${_bits}_${_threading}_${_libtype}"
|
||||
_tgt_config)
|
||||
set(_mkl_tgt CP2K::BLAS::MKL::${_tgt_config})
|
||||
set(_mkl_tgt cp2k::BLAS::MKL::${_tgt_config})
|
||||
|
||||
if(MKL_FOUND
|
||||
AND _mkl_interface_lib
|
||||
|
|
@ -321,12 +321,12 @@ foreach(_libtype "ST" "DYN")
|
|||
TOLOWER "${_mpi_impl}_${_iface}_${_bits}_${_threading}_${_libtype}"
|
||||
_tgt_config)
|
||||
|
||||
set(_scalapack_tgt CP2K::BLAS::MKL::scalapack_${_tgt_config})
|
||||
set(_scalapack_tgt cp2k::BLAS::MKL::scalapack_${_tgt_config})
|
||||
|
||||
if(_mkl_blacs_lib
|
||||
AND TARGET ${_mkl_tgt}
|
||||
AND TARGET MPI::MPI_CXX
|
||||
AND NOT TARGET CP2K::BLAS::MKL::blacs_${_tgt_config})
|
||||
AND NOT TARGET cp2k::BLAS::MKL::blacs_${_tgt_config})
|
||||
set(_blacs_libs
|
||||
"${_mkl_linker_pre_flags_${_libtype}}"
|
||||
"${_mkl_interface_lib}"
|
||||
|
|
@ -337,22 +337,22 @@ foreach(_libtype "ST" "DYN")
|
|||
"MPI::MPI_CXX"
|
||||
"${_mkl_dep_${_threading}}"
|
||||
"Threads::Threads")
|
||||
add_library(CP2K::BLAS::MKL::blacs_${_tgt_config} INTERFACE
|
||||
add_library(cp2k::BLAS::MKL::blacs_${_tgt_config} INTERFACE
|
||||
IMPORTED)
|
||||
set_target_properties(
|
||||
CP2K::BLAS::MKL::blacs_${_tgt_config}
|
||||
cp2k::BLAS::MKL::blacs_${_tgt_config}
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CP2K_MKL_INCLUDE_DIRS}" INTERFACE_LINK_LIBRARIES
|
||||
"${_mkl_blacs_lib}")
|
||||
endif()
|
||||
|
||||
if(_mkl_scalapack_lib AND NOT TARGET
|
||||
CP2K::BLAS::MKL::scalapack_${_tgt_config})
|
||||
cp2k::BLAS::MKL::scalapack_${_tgt_config})
|
||||
set(_scalapack_libs "${_mkl_scalapack_lib}" "${_blacs_tgt}")
|
||||
add_library(CP2K::BLAS::MKL::scalapack_${_tgt_config} INTERFACE
|
||||
add_library(cp2k::BLAS::MKL::scalapack_${_tgt_config} INTERFACE
|
||||
IMPORTED)
|
||||
set_target_properties(
|
||||
CP2K::BLAS::MKL::scalapack_${_tgt_config}
|
||||
cp2k::BLAS::MKL::scalapack_${_tgt_config}
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES "${_scalapack_libs}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
|
@ -399,20 +399,20 @@ if(MKL_FOUND)
|
|||
|
||||
get_target_property(
|
||||
MKL_BLAS_INCLUDE_DIRS
|
||||
CP2K::BLAS::MKL::${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE}_${BLAS_mkl_thread__}_dyn
|
||||
cp2k::BLAS::MKL::${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE}_${BLAS_mkl_thread__}_dyn
|
||||
INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(
|
||||
MKL_BLAS_LIBRARIES
|
||||
CP2K::BLAS::MKL::${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE}_${BLAS_mkl_thread__}_dyn
|
||||
cp2k::BLAS::MKL::${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE}_${BLAS_mkl_thread__}_dyn
|
||||
INTERFACE_LINK_LIBRARIES)
|
||||
if(NOT TARGET CP2K::BLAS::MKL::blas)
|
||||
add_library(CP2K::BLAS::MKL::MKL INTERFACE IMPORTED)
|
||||
add_library(CP2K::BLAS::MKL::blas ALIAS CP2K::BLAS::MKL::MKL)
|
||||
if(NOT TARGET cp2k::BLAS::MKL::blas)
|
||||
add_library(cp2k::BLAS::MKL::MKL INTERFACE IMPORTED)
|
||||
add_library(cp2k::BLAS::MKL::blas ALIAS cp2k::BLAS::MKL::MKL)
|
||||
# create a empty lapack
|
||||
add_library(CP2K::BLAS::MKL::lapack INTERFACE IMPORTED)
|
||||
add_library(cp2k::BLAS::MKL::lapack INTERFACE IMPORTED)
|
||||
endif()
|
||||
set_target_properties(
|
||||
CP2K::BLAS::MKL::MKL
|
||||
cp2k::BLAS::MKL::MKL
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CP2K_MKL_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${MKL_BLAS_LIBRARIES}")
|
||||
|
||||
|
|
@ -424,24 +424,24 @@ if(MKL_FOUND)
|
|||
|
||||
get_target_property(
|
||||
__mkl_scalapack_inc
|
||||
CP2K::BLAS::MKL::scalapack_${__mkl_mpi_ver_}_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE}_${BLAS_mkl_thread__}_dyn
|
||||
cp2k::BLAS::MKL::scalapack_${__mkl_mpi_ver_}_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE}_${BLAS_mkl_thread__}_dyn
|
||||
INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(
|
||||
__mkl_scalapack_lib
|
||||
CP2K::BLAS::MKL::scalapack_${__mkl_mpi_ver_}_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE}_${BLAS_mkl_thread__}_dyn
|
||||
cp2k::BLAS::MKL::scalapack_${__mkl_mpi_ver_}_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE}_${BLAS_mkl_thread__}_dyn
|
||||
INTERFACE_LINK_LIBRARIES)
|
||||
get_target_property(
|
||||
__mkl_blacs_inc
|
||||
CP2K::BLAS::MKL::blacs_${__mkl_mpi_ver_}_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE}_${BLAS_mkl_thread__}_dyn
|
||||
cp2k::BLAS::MKL::blacs_${__mkl_mpi_ver_}_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE}_${BLAS_mkl_thread__}_dyn
|
||||
INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(
|
||||
__mkl_blacs_lib
|
||||
CP2K::BLAS::MKL::blacs_${__mkl_mpi_ver_}_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE}_${BLAS_mkl_thread__}_dyn
|
||||
cp2k::BLAS::MKL::blacs_${__mkl_mpi_ver_}_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE}_${BLAS_mkl_thread__}_dyn
|
||||
INTERFACE_LINK_LIBRARIES)
|
||||
if(NOT TARGET CP2K::BLAS::MKL::scalapack_link)
|
||||
add_library(CP2K::BLAS::MKL::scalapack_link INTERFACE IMPORTED)
|
||||
if(NOT TARGET cp2k::BLAS::MKL::scalapack_link)
|
||||
add_library(cp2k::BLAS::MKL::scalapack_link INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
CP2K::BLAS::MKL::scalapack_link
|
||||
cp2k::BLAS::MKL::scalapack_link
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${__mkl_scalapack_inc}"
|
||||
INTERFACE_LINK_LIBRARIES
|
||||
"${__mkl_scalapack_lib};${__mkl_blacs_lib}")
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@ cp2k_include_dirs(FFTW3 "metis.h")
|
|||
find_package_handle_standard_args(Metis DEFAULT_MSG CP2K_METIS_LINK_LIBRARIES
|
||||
CP2K_METIS_INCLUDE_DIRS CP2K_METIS_FOUND)
|
||||
|
||||
if(CP2K_METIS_FOUND AND NOT TARGET CP2K::metis::metis)
|
||||
add_library(CP2K::metis::metis INTERFACE IMPORTED)
|
||||
if(CP2K_METIS_FOUND AND NOT TARGET cp2k::metis::metis)
|
||||
add_library(cp2k::metis::metis INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
CP2K::metis::metis
|
||||
cp2k::metis::metis
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CP2K_METIS_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${CP2K_METIS_LINK_LIBRARIES}")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -65,10 +65,10 @@ find_package_handle_standard_args(
|
|||
set(CP2K_BLAS_VENDOR "NVHPCBlas")
|
||||
set(CP2K_NVHPCBLAS_FOUND "ON")
|
||||
|
||||
if(NOT TARGET CP2K::BLAS::NVHPCBlas::nvhpcblas)
|
||||
add_library(CP2K::BLAS::NVHPCBlas::nvhpcblas INTERFACE IMPORTED)
|
||||
add_library(CP2K::BLAS::NVHPCBlas::blas ALIAS
|
||||
CP2K::BLAS::NVHPCBlas::nvhpcblas)
|
||||
if(NOT TARGET cp2k::BLAS::NVHPCBlas::nvhpcblas)
|
||||
add_library(cp2k::BLAS::NVHPCBlas::nvhpcblas INTERFACE IMPORTED)
|
||||
add_library(cp2k::BLAS::NVHPCBlas::blas ALIAS
|
||||
cp2k::BLAS::NVHPCBlas::nvhpcblas)
|
||||
endif()
|
||||
|
||||
if(CP2K_BLAS_INTERFACE MATCHES "64bits")
|
||||
|
|
@ -82,7 +82,7 @@ else()
|
|||
endif()
|
||||
|
||||
set_target_properties(
|
||||
CP2K::BLAS::NVHPCBlas::nvhpcblas
|
||||
cp2k::BLAS::NVHPCBlas::nvhpcblas
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES "${CP2K_NVHPC_BLAS_LINK_LIBRARIES}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${CP2K_NVHPC_BLAS_INCLUDE_DIRS}")
|
||||
|
||||
|
|
|
|||
|
|
@ -46,19 +46,19 @@ endif()
|
|||
|
||||
# add target to link against
|
||||
if(CP2K_OPENBLAS_FOUND)
|
||||
if(NOT TARGET CP2K::BLAS::OpenBLAS::openblas)
|
||||
add_library(CP2K::BLAS::OpenBLAS::openblas INTERFACE IMPORTED)
|
||||
if(NOT TARGET cp2k::BLAS::OpenBLAS::openblas)
|
||||
add_library(cp2k::BLAS::OpenBLAS::openblas INTERFACE IMPORTED)
|
||||
endif()
|
||||
set_property(
|
||||
TARGET CP2K::BLAS::OpenBLAS::openblas
|
||||
TARGET cp2k::BLAS::OpenBLAS::openblas
|
||||
PROPERTY INTERFACE_LINK_LIBRARIES ${CP2K_OPENBLAS_LINK_LIBRARIES})
|
||||
if(CP2K_OPENBLAS_INCLUDE_DIRS)
|
||||
set_property(
|
||||
TARGET CP2K::BLAS::OpenBLAS::openblas
|
||||
TARGET cp2k::BLAS::OpenBLAS::openblas
|
||||
PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CP2K_OPENBLAS_INCLUDE_DIRS})
|
||||
endif()
|
||||
if(NOT TARGET CP2K::BLAS::OpenBLAS::blas)
|
||||
add_library(CP2K::BLAS::OpenBLAS::blas ALIAS CP2K::BLAS::OpenBLAS::openblas)
|
||||
if(NOT TARGET cp2k::BLAS::OpenBLAS::blas)
|
||||
add_library(cp2k::BLAS::OpenBLAS::blas ALIAS cp2k::BLAS::OpenBLAS::openblas)
|
||||
endif()
|
||||
set(CP2K_BLAS_VENDOR "OpenBLAS")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -32,12 +32,12 @@ endif()
|
|||
find_package_handle_standard_args(PEXSI DEFAULT_MSG CP2K_PEXSI_INCLUDE_DIRS
|
||||
CP2K_PEXSI_LINK_LIBRARIES)
|
||||
|
||||
if(CP2K_PEXSI_FOUND AND NOT TARGET CP2K::PEXSI::pexsi)
|
||||
add_library(CP2K::PEXSI::pexsi INTERFACE IMPORTED)
|
||||
set_target_properties(CP2K::PEXSI PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
if(CP2K_PEXSI_FOUND AND NOT TARGET cp2k::PEXSI::pexsi)
|
||||
add_library(cp2k::PEXSI::pexsi INTERFACE IMPORTED)
|
||||
set_target_properties(cp2k::PEXSI PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
"${CP2K_PEXSI_LINK_LIBRARIES}")
|
||||
if(DEFINED CP2K_PEXSI_INCLUDE_DIRS)
|
||||
set_target_properties(CP2K::PEXSI PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
set_target_properties(cp2k::PEXSI PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CP2K_PEXSI_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -35,11 +35,11 @@ else()
|
|||
endif()
|
||||
|
||||
if(CP2K_PLUMED_FOUND)
|
||||
if(NOT TARGET CP2K::plumed::plumed)
|
||||
add_library(CP2K::plumed::plumed INTERFACE IMPORTED)
|
||||
if(NOT TARGET cp2k::plumed::plumed)
|
||||
add_library(cp2k::plumed::plumed INTERFACE IMPORTED)
|
||||
endif()
|
||||
set_target_properties(
|
||||
CP2K::plumed::plumed
|
||||
cp2k::plumed::plumed
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CP2K_PLUMED_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${CP2K_PLUMED_LINK_LIBRARIES}")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -51,10 +51,10 @@ find_package_handle_standard_args(
|
|||
CP2K_SCOTCHERR_LINK_LIBRARIES
|
||||
CP2K_PTESMUMPS_LINK_LIBRARIES)
|
||||
|
||||
if(CP2K_PTSCOTCH_FOUND AND NOT TARGET CP2K::ptscotch::ptscotch)
|
||||
add_library(CP2K::ptscotch::ptscotch INTERFACE IMPORTED)
|
||||
if(CP2K_PTSCOTCH_FOUND AND NOT TARGET cp2k::ptscotch::ptscotch)
|
||||
add_library(cp2k::ptscotch::ptscotch INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
CP2K::ptscotch::ptscotch
|
||||
cp2k::ptscotch::ptscotch
|
||||
PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${PTSCOTCH_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@ endif()
|
|||
find_package_handle_standard_args(Quip DEFAULT_MSG CP2K_LIBQUIP_INCLUDE_DIRS
|
||||
CP2K_QUIP_LINK_LIBRARIES)
|
||||
|
||||
if(CP2K_LIBQUIP_FOUND AND NOT TARGET CP2K::quip::quip)
|
||||
add_library(CP2K::quip::quip INTERFACE IMPORTED)
|
||||
if(CP2K_LIBQUIP_FOUND AND NOT TARGET cp2k::quip::quip)
|
||||
add_library(cp2k::quip::quip INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
CP2K::quip::quip
|
||||
cp2k::quip::quip
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CP2K_LIBQUIP_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${CP2K_LIBQUIP_LINK_LIBRARIES}")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ cp2k_set_default_paths(SCALAPACK "SCALAPACK")
|
|||
# distro if found
|
||||
|
||||
if(CP2K_SCALAPACK_VENDOR STREQUAL "GENERIC")
|
||||
if(TARGET CP2K::BLAS::MKL::scalapack_link)
|
||||
if(TARGET cp2k::BLAS::MKL::scalapack_link)
|
||||
message("-----------------------------------------------------------------")
|
||||
message("- FindScalapack warning -")
|
||||
message("-----------------------------------------------------------------")
|
||||
|
|
@ -29,7 +29,7 @@ if(CP2K_SCALAPACK_VENDOR STREQUAL "GENERIC")
|
|||
)
|
||||
endif()
|
||||
|
||||
if(TARGET CP2K::BLAS::SCI::scalapack_link)
|
||||
if(TARGET cp2k::BLAS::SCI::scalapack_link)
|
||||
message("-----------------------------------------------------------------")
|
||||
message("- FindScalapack warning -")
|
||||
message("-----------------------------------------------------------------")
|
||||
|
|
@ -56,15 +56,15 @@ if(CP2K_SCALAPACK_VENDOR STREQUAL "GENERIC")
|
|||
if(NOT CP2K_SCALAPACK_FOUND)
|
||||
cp2k_find_libraries(SCALAPACK "scalapack")
|
||||
endif()
|
||||
elseif(TARGET CP2K::BLAS::MKL::scalapack_link)
|
||||
elseif(TARGET cp2k::BLAS::MKL::scalapack_link)
|
||||
# we have mkl check for the different mkl target
|
||||
get_target_property(CP2K_SCALAPACK_LINK_LIBRARIES
|
||||
CP2K::BLAS::MKL::scalapack_link INTERFACE_LINK_LIBRARIES)
|
||||
cp2k::BLAS::MKL::scalapack_link INTERFACE_LINK_LIBRARIES)
|
||||
set(CP2K_SCALAPACK_FOUND yes)
|
||||
elseif(TARGET CP2K::BLAS::SCI::scalapack_link)
|
||||
elseif(TARGET cp2k::BLAS::SCI::scalapack_link)
|
||||
# we have mkl check for the different mkl target
|
||||
get_target_property(CP2K_SCALAPACK_LINK_LIBRARIES
|
||||
CP2K::BLAS::SCI::scalapack_link INTERFACE_LINK_LIBRARIES)
|
||||
cp2k::BLAS::SCI::scalapack_link INTERFACE_LINK_LIBRARIES)
|
||||
set(CP2K_SCALAPACK_FOUND yes)
|
||||
endif()
|
||||
|
||||
|
|
@ -76,12 +76,12 @@ find_package_handle_standard_args(SCALAPACK
|
|||
# add target to link against
|
||||
if(CP2K_SCALAPACK_FOUND)
|
||||
|
||||
if(NOT TARGET CP2K::SCALAPACK::scalapack)
|
||||
add_library(CP2K::SCALAPACK::scalapack INTERFACE IMPORTED)
|
||||
if(NOT TARGET cp2k::SCALAPACK::scalapack)
|
||||
add_library(cp2k::SCALAPACK::scalapack INTERFACE IMPORTED)
|
||||
endif()
|
||||
|
||||
set_property(
|
||||
TARGET CP2K::SCALAPACK::scalapack PROPERTY INTERFACE_LINK_LIBRARIES
|
||||
TARGET cp2k::SCALAPACK::scalapack PROPERTY INTERFACE_LINK_LIBRARIES
|
||||
${CP2K_SCALAPACK_LINK_LIBRARIES})
|
||||
endif()
|
||||
mark_as_advanced(CP2K_SCALAPACK_FOUND CP2K_SCALAPACK_LINK_LIBRARIES)
|
||||
|
|
|
|||
|
|
@ -43,58 +43,58 @@ find_package_handle_standard_args(SCI REQUIRED_VARS CP2K_LIBSCI_INCLUDE_DIRS
|
|||
|
||||
# add target to link against
|
||||
if(CP2K_LIBSCI_FOUND)
|
||||
if(NOT TARGET CP2K::BLAS::SCI::sci)
|
||||
add_library(CP2K::BLAS::SCI::sci INTERFACE IMPORTED)
|
||||
add_library(CP2K::BLAS::SCI::sci_mpi INTERFACE IMPORTED)
|
||||
add_library(CP2K::BLAS::SCI::sci_mp INTERFACE IMPORTED)
|
||||
add_library(CP2K::BLAS::SCI::sci_mpi_mp INTERFACE IMPORTED)
|
||||
add_library(CP2K::BLAS::SCI::scalapack_link INTERFACE IMPORTED)
|
||||
add_library(CP2K::BLAS::SCI::blas INTERFACE IMPORTED)
|
||||
if(NOT TARGET cp2k::BLAS::SCI::sci)
|
||||
add_library(cp2k::BLAS::SCI::sci INTERFACE IMPORTED)
|
||||
add_library(cp2k::BLAS::SCI::sci_mpi INTERFACE IMPORTED)
|
||||
add_library(cp2k::BLAS::SCI::sci_mp INTERFACE IMPORTED)
|
||||
add_library(cp2k::BLAS::SCI::sci_mpi_mp INTERFACE IMPORTED)
|
||||
add_library(cp2k::BLAS::SCI::scalapack_link INTERFACE IMPORTED)
|
||||
add_library(cp2k::BLAS::SCI::blas INTERFACE IMPORTED)
|
||||
|
||||
if(CP2K_LIBSCI_INCLUDE_DIRS)
|
||||
set_property(
|
||||
TARGET CP2K::BLAS::SCI::sci PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
TARGET cp2k::BLAS::SCI::sci PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CP2K_LIBSCI_INCLUDE_DIRS}")
|
||||
set_property(
|
||||
TARGET CP2K::BLAS::SCI::sci_mp PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
TARGET cp2k::BLAS::SCI::sci_mp PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CP2K_LIBSCI_INCLUDE_DIRS}")
|
||||
set_property(
|
||||
TARGET CP2K::BLAS::SCI::sci_mpi PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
TARGET cp2k::BLAS::SCI::sci_mpi PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CP2K_LIBSCI_INCLUDE_DIRS}")
|
||||
set_property(
|
||||
TARGET CP2K::BLAS::SCI::sci_mpi_mp
|
||||
TARGET cp2k::BLAS::SCI::sci_mpi_mp
|
||||
PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CP2K_LIBSCI_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
set_property(
|
||||
TARGET CP2K::BLAS::SCI::sci PROPERTY INTERFACE_LINK_LIBRARIES
|
||||
TARGET cp2k::BLAS::SCI::sci PROPERTY INTERFACE_LINK_LIBRARIES
|
||||
${CP2K_LIBSCI_LINK_LIBRARIES})
|
||||
set_property(
|
||||
TARGET CP2K::BLAS::SCI::sci_mp PROPERTY INTERFACE_LINK_LIBRARIES
|
||||
TARGET cp2k::BLAS::SCI::sci_mp PROPERTY INTERFACE_LINK_LIBRARIES
|
||||
${CP2K_LIBSCI_MP_LINK_LIBRARIES})
|
||||
set_property(
|
||||
TARGET CP2K::BLAS::SCI::sci_mpi
|
||||
TARGET cp2k::BLAS::SCI::sci_mpi
|
||||
PROPERTY INTERFACE_LINK_LIBRARIES ${CP2K_LIBSCI_MPI_LINK_LIBRARIES}
|
||||
CP2K::BLAS::SCI::sci)
|
||||
cp2k::BLAS::SCI::sci)
|
||||
set_property(
|
||||
TARGET CP2K::BLAS::SCI::sci_mpi_mp
|
||||
TARGET cp2k::BLAS::SCI::sci_mpi_mp
|
||||
PROPERTY INTERFACE_LINK_LIBRARIES ${CP2K_LIBSCI_MPI_MP_LINK_LIBRARIES}
|
||||
CP2K::BLAS::SCI::sci_mp)
|
||||
cp2k::BLAS::SCI::sci_mp)
|
||||
set_property(
|
||||
TARGET CP2K::BLAS::SCI::scalapack_link
|
||||
TARGET cp2k::BLAS::SCI::scalapack_link
|
||||
PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CP2K_LIBSCI_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
if(CP2K_BLAS_THREADING MATCHES "sequential")
|
||||
set_property(TARGET CP2K::BLAS::SCI::blas PROPERTY INTERFACE_LINK_LIBRARIES
|
||||
CP2K::BLAS::SCI::sci)
|
||||
set_property(TARGET CP2K::BLAS::SCI::scalapack_link
|
||||
PROPERTY INTERFACE_LINK_LIBRARIES CP2K::BLAS::SCI::sci_mpi)
|
||||
set_property(TARGET cp2k::BLAS::SCI::blas PROPERTY INTERFACE_LINK_LIBRARIES
|
||||
cp2k::BLAS::SCI::sci)
|
||||
set_property(TARGET cp2k::BLAS::SCI::scalapack_link
|
||||
PROPERTY INTERFACE_LINK_LIBRARIES cp2k::BLAS::SCI::sci_mpi)
|
||||
else()
|
||||
set_property(TARGET CP2K::BLAS::SCI::blas PROPERTY INTERFACE_LINK_LIBRARIES
|
||||
CP2K::BLAS::SCI::sci_mp)
|
||||
set_property(TARGET CP2K::BLAS::SCI::scalapack_link
|
||||
PROPERTY INTERFACE_LINK_LIBRARIES CP2K::BLAS::SCI::sci_mpi_mp)
|
||||
set_property(TARGET cp2k::BLAS::SCI::blas PROPERTY INTERFACE_LINK_LIBRARIES
|
||||
cp2k::BLAS::SCI::sci_mp)
|
||||
set_property(TARGET cp2k::BLAS::SCI::scalapack_link
|
||||
PROPERTY INTERFACE_LINK_LIBRARIES cp2k::BLAS::SCI::sci_mpi_mp)
|
||||
endif()
|
||||
|
||||
set(CP2K_BLAS_VENDOR "SCI")
|
||||
|
|
|
|||
|
|
@ -28,11 +28,11 @@ endif()
|
|||
find_package_handle_standard_args(SuperLU DEFAULT_MSG CP2K_SUPERLU_INCLUDE_DIRS
|
||||
CP2K_SUPERLU_LINK_LIBRARIES)
|
||||
|
||||
if(CP2K_SUPERLU_FOUND AND NOT TARGET CP2K::superlu::superlu)
|
||||
add_library(CP2K::superlu::superlu INTERFACE IMPORTED)
|
||||
if(CP2K_SUPERLU_FOUND AND NOT TARGET cp2k::superlu::superlu)
|
||||
add_library(cp2k::superlu::superlu INTERFACE IMPORTED)
|
||||
endif()
|
||||
set_target_properties(
|
||||
CP2K::superlu::superlu
|
||||
cp2k::superlu::superlu
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CP2K_SUPERLU_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${CP2K_SUPERLU_LINK_LIBRARIES}")
|
||||
mark_as_advanced(CP2K_SUPERLU_LINK_LIBRARIES CP2K_SUPERLU_INCLUDE_DIRS
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ if (@CP2K_SCALAPACK_VENDOR@ MATCHES "CUSTOM")
|
|||
set(CP2K_SCALAPACK_LINK_LIBRARIES @CP2K_SCALAPACK_LINK_LIBRARIES@)
|
||||
endif()
|
||||
|
||||
set(cp2k_VERSION @cp2k_VERSION@)
|
||||
|
||||
find_package(Lapack REQUIRED)
|
||||
find_package(DBCSR 2.4 REQUIRED)
|
||||
|
||||
|
|
@ -112,5 +114,4 @@ if(@CP2K_USE_LIBTORCH@)
|
|||
find_package(Torch REQUIRED)
|
||||
endif()
|
||||
|
||||
# Include SIRIUS target
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/cp2kTargets.cmake")
|
||||
|
|
|
|||
|
|
@ -118,3 +118,148 @@ function(cp2k_compare_src_with_list _list_files _extension)
|
|||
set(list_size_ 0)
|
||||
set(found_list_size_ 0)
|
||||
endfunction()
|
||||
|
||||
macro(cp2k_FindPackage name)
|
||||
#[===[.md
|
||||
# cp2k_FindPackage
|
||||
|
||||
A compatibility macro that links `find_package(CONFIG)` packages with `pkg-config`. This should only
|
||||
be called within the `Find<PackageName>.cmake` file.
|
||||
|
||||
Note: Version range syntax is not supported for pkg-config searching. Only the lower bound will be respected.
|
||||
Taken from Octopus repository.
|
||||
]===]
|
||||
|
||||
set(ARGS_Options "")
|
||||
set(ARGS_OneValue "")
|
||||
set(ARGS_MultiValue "NAMES;PKG_MODULE_NAMES;PKG_MODULE_SPECS")
|
||||
cmake_parse_arguments(ARGS "${ARGS_Options}" "${ARGS_OneValue}"
|
||||
"${ARGS_MultiValue}" ${ARGN})
|
||||
|
||||
# First try to find native <PackageName>Config.cmake Build the arguments
|
||||
# COMPONENTS
|
||||
set(_comp_args)
|
||||
set(_opt_comp_args)
|
||||
if(DEFINED ${name}_FIND_COMPONENTS)
|
||||
list(APPEND _comp_args COMPONENTS)
|
||||
foreach(_comp IN LISTS ${name}_FIND_COMPONENTS)
|
||||
if(${name}_FIND_REQUIRED_${_comp})
|
||||
list(APPEND _comp_args ${_comp})
|
||||
else()
|
||||
if(NOT DEFINED _opt_comp_args)
|
||||
list(APPEND _opt_comp_args OPTIONAL_COMPONENTS)
|
||||
endif()
|
||||
list(APPEND _opt_comp_args ${_comp})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# Version Try range format first, otherwise use the default
|
||||
set(_version_args ${${name}_FIND_VERSION_RANGE})
|
||||
if(NOT DEFINED _version_args)
|
||||
set(_version_args ${${name}_FIND_VERSION})
|
||||
endif()
|
||||
if(${name}_FIND_VERSION_EXACT)
|
||||
list(APPEND _version_args EXACT)
|
||||
endif()
|
||||
|
||||
# QUIET
|
||||
set(_quiet_arg)
|
||||
if(${name}_FIND_QUIETLY)
|
||||
list(APPEND _quiet_arg QUIET)
|
||||
endif()
|
||||
|
||||
# REQUIRED
|
||||
set(_required_arg)
|
||||
if(${name}_FIND_REQUIRED)
|
||||
list(APPEND _required_arg REQUIRED)
|
||||
endif()
|
||||
|
||||
# REGISTRY_VIEW
|
||||
set(_registry_view_arg)
|
||||
if(${name}_FIND_REGISTRY_VIEW)
|
||||
list(APPEND _registry_view REGISTRY_VIEW ${${name}_FIND_REGISTRY_VIEW})
|
||||
endif()
|
||||
|
||||
# NAMES
|
||||
set(_names_args)
|
||||
if(DEFINED ARGS_NAMES)
|
||||
list(APPEND _names_args NAMES ${ARGS_NAMES})
|
||||
endif()
|
||||
|
||||
# Try <PackageName>Config.cmake
|
||||
find_package(
|
||||
${name}
|
||||
${_version_args}
|
||||
${_quiet_arg}
|
||||
CONFIG
|
||||
${_comp_args}
|
||||
${_opt_comp_args}
|
||||
${_registry_view_arg}
|
||||
${_names_args})
|
||||
|
||||
if(NOT ${name}_FOUND)
|
||||
# Try pkg-config next Construct the moduleSpec to search for
|
||||
if(NOT DEFINED ARGS_PKG_MODULE_SPECS)
|
||||
if(NOT DEFINED ARGS_PKG_MODULE_NAMES)
|
||||
set(ARGS_PKG_MODULE_NAMES ${name})
|
||||
endif()
|
||||
if(DEFINED ${name}_FIND_VERSION_RANGE)
|
||||
# Can only parse the minimum requirement
|
||||
foreach(_pkg_name IN LISTS ARGS_PKG_MODULE_NAMES)
|
||||
list(APPEND ARGS_PKG_MODULE_SPECS
|
||||
"${_pkg_name}>=${${name}_FIND_VERSION_MIN}")
|
||||
endforeach()
|
||||
elseif({${name}_FIND_VERSION_EXACT)
|
||||
# Requesting exact version
|
||||
foreach(_pkg_name IN LISTS ARGS_PKG_MODULE_NAMES)
|
||||
list(APPEND ARGS_PKG_MODULE_SPECS
|
||||
"${_pkg_name}=${${name}_FIND_VERSION}")
|
||||
endforeach()
|
||||
elseif(DEFINED ${name}_FIND_VERSION)
|
||||
# Otherwise treat the request as minimum requirement
|
||||
foreach(_pkg_name IN LISTS ARGS_PKG_MODULE_NAMES)
|
||||
list(APPEND ARGS_PKG_MODULE_SPECS
|
||||
"${_pkg_name}>=${${name}_FIND_VERSION}")
|
||||
endforeach()
|
||||
else()
|
||||
# Fallthrough if no version is required
|
||||
foreach(_pkg_name IN LISTS ARGS_PKG_MODULE_NAMES)
|
||||
list(APPEND ARGS_PKG_MODULE_SPECS "${_pkg_name}")
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
# Call pkg-config
|
||||
if(CMAKE_VERSION VERSION_LESS 3.28)
|
||||
# https://gitlab.kitware.com/cmake/cmake/-/issues/25228
|
||||
set(ENV{PKG_CONFIG_ALLOW_SYSTEM_CFLAGS} 1)
|
||||
endif()
|
||||
if(CMAKE_VERSION VERSION_LESS 3.22)
|
||||
# Back-porting
|
||||
# https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6345
|
||||
set(ENV{PKG_CONFIG_ALLOW_SYSTEM_CFLAGS} 1)
|
||||
endif()
|
||||
pkg_search_module(${name} ${_required_arg} ${_quiet_arg} IMPORTED_TARGET
|
||||
${ARGS_PKG_MODULE_SPECS})
|
||||
# Mark the package as found by pkg-config
|
||||
if(${name}_FOUND)
|
||||
set(${name}_PKGCONFIG True)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Sanitize local variables in order to not contaminate future calls
|
||||
set(ARGS_Options)
|
||||
set(ARGS_OneValue)
|
||||
set(ARGS_MultiValue)
|
||||
set(ARGS_UNPARSED_ARGUMENTS)
|
||||
set(ARGS_NAMES)
|
||||
set(ARGS_PKG_MODULE_NAMES)
|
||||
set(ARGS_PKG_MODULE_SPECS)
|
||||
set(_version_args)
|
||||
set(_quiet_arg)
|
||||
set(_comp_args)
|
||||
set(_opt_comp_args)
|
||||
set(_registry_view_arg)
|
||||
set(_names_args)
|
||||
set(_pkg_name)
|
||||
endmacro()
|
||||
|
|
|
|||
|
|
@ -83,10 +83,11 @@ function(ADD_FYPP_SOURCES OUTVAR)
|
|||
endforeach()
|
||||
|
||||
# build a custom target to fypp seperately (required for example by the doc
|
||||
# target)
|
||||
# target) cmake 3.27.5 seems to have issues with these two next commands. I do
|
||||
# not use the fypp target anyway
|
||||
|
||||
add_custom_target("fypp_${OUTVAR}" DEPENDS ${outfiles})
|
||||
add_dependencies(fypp "fypp_${OUTVAR}")
|
||||
# add_custom_target("fypp_${OUTVAR}" DEPENDS ${outfiles})
|
||||
# add_dependencies(fypp "fypp_${OUTVAR}")
|
||||
|
||||
# set the output list in the calling scope
|
||||
set(${OUTVAR}
|
||||
|
|
|
|||
|
|
@ -1438,7 +1438,7 @@ if(CP2K_USE_CUDA)
|
|||
else()
|
||||
target_link_libraries(
|
||||
cp2k_cuda_libs
|
||||
INTERFACE $<$<BOOL:${CP2K_USE_CUSOLVER_MP}>:CP2K::CUSOLVER_MP::cusolvermp>
|
||||
INTERFACE $<$<BOOL:${CP2K_USE_CUSOLVER_MP}>:cp2k::CUSOLVER_MP::cusolvermp>
|
||||
CUDA::cufft CUDA::cufftw CUDA::cublas CUDA::cudart
|
||||
CUDA::cuda_driver)
|
||||
endif()
|
||||
|
|
@ -1453,10 +1453,10 @@ endif()
|
|||
add_library(cp2k_linalg_libs INTERFACE)
|
||||
target_link_libraries(
|
||||
cp2k_linalg_libs
|
||||
INTERFACE CP2K::LAPACK::lapack
|
||||
$<$<BOOL:${CP2K_USE_LIBXSMM}>:CP2K::LibXSMM::libxsmmf>
|
||||
$<$<BOOL:${CP2K_USE_LIBXSMM}>:CP2K::LibXSMM::libxsmmext>
|
||||
CP2K::BLAS::blas
|
||||
INTERFACE cp2k::LAPACK::lapack
|
||||
$<$<BOOL:${CP2K_USE_LIBXSMM}>:cp2k::LibXSMM::libxsmmf>
|
||||
$<$<BOOL:${CP2K_USE_LIBXSMM}>:cp2k::LibXSMM::libxsmmext>
|
||||
cp2k::BLAS::blas
|
||||
$<$<BOOL:${CP2K_USE_CUDA}>:cp2k_cuda_libs>
|
||||
$<$<BOOL:${CP2K_USE_HIP}>:cp2k_hip_libs>
|
||||
$<$<BOOL:${CP2K_USE_MPI}>:MPI::MPI_Fortran>
|
||||
|
|
@ -1546,22 +1546,22 @@ target_link_libraries(
|
|||
cp2k_link_libs
|
||||
INTERFACE
|
||||
$<$<BOOL:${CP2K_USE_SIRIUS}>:sirius::sirius>
|
||||
$<$<BOOL:${CP2K_USE_VORI}>:CP2K::VORI::vori>
|
||||
$<$<BOOL:${CP2K_USE_PEXSI}>:CP2K::PEXSI::pexsi>
|
||||
$<$<BOOL:${CP2K_USE_PEXSI}>:CP2K::ptscotch::ptscotch>
|
||||
$<$<BOOL:${CP2K_USE_SPGLIB}>:CP2K::LIBSPG::libspg>
|
||||
$<$<BOOL:${CP2K_USE_LIBXC}>:CP2K::Libxc::xc>
|
||||
$<$<BOOL:${CP2K_USE_ELPA}>:CP2K::ELPA::elpa>
|
||||
$<$<BOOL:${CP2K_USE_FFTW3}>:CP2K::FFTW3::fftw3>
|
||||
$<$<BOOL:${CP2K_ENABLE_FFTW3_THREADS_SUPPORT}>:CP2K::FFTW3::fftw3_threads>
|
||||
$<$<BOOL:${CP2K_ENABLE_FFTW3_OPENMP_SUPPORT}>:CP2K::FFTW3::fftw3_omp>
|
||||
$<$<BOOL:${CP2K_USE_VORI}>:cp2k::VORI::vori>
|
||||
$<$<BOOL:${CP2K_USE_PEXSI}>:cp2k::PEXSI::pexsi>
|
||||
$<$<BOOL:${CP2K_USE_PEXSI}>:cp2k::ptscotch::ptscotch>
|
||||
$<$<BOOL:${CP2K_USE_SPGLIB}>:cp2k::LIBSPG::libspg>
|
||||
$<$<BOOL:${CP2K_USE_LIBXC}>:cp2k::Libxc::xc>
|
||||
$<$<BOOL:${CP2K_USE_ELPA}>:cp2k::ELPA::elpa>
|
||||
$<$<BOOL:${CP2K_USE_FFTW3}>:cp2k::FFTW3::fftw3>
|
||||
$<$<BOOL:${CP2K_ENABLE_FFTW3_THREADS_SUPPORT}>:cp2k::FFTW3::fftw3_threads>
|
||||
$<$<BOOL:${CP2K_ENABLE_FFTW3_OPENMP_SUPPORT}>:cp2k::FFTW3::fftw3_omp>
|
||||
$<$<BOOL:${CP2K_USE_SPLA}>:SPLA::spla>
|
||||
$<$<BOOL:${CP2K_USE_LIBINT2}>:CP2K::Libint2::int2>
|
||||
$<$<BOOL:${CP2K_USE_LIBINT2}>:cp2k::Libint2::int2>
|
||||
$<$<BOOL:${CP2K_USE_TORCH}>:${TORCH_LIBRARIES}>
|
||||
$<$<BOOL:${CP2K_USE_COSMA}>:cosma::cosma_prefixed_pxgemm>
|
||||
$<$<BOOL:${CP2K_USE_COSMA}>:cosma::cosma>
|
||||
DBCSR::dbcsr
|
||||
$<$<BOOL:${CP2K_USE_MPI}>:CP2K::SCALAPACK::scalapack>
|
||||
$<$<BOOL:${CP2K_USE_MPI}>:cp2k::SCALAPACK::scalapack>
|
||||
cp2k_linalg_libs)
|
||||
|
||||
string(TIMESTAMP CP2K_TIMESTAMP "%Y-%m-%d %H:%M:%S")
|
||||
|
|
@ -1620,6 +1620,11 @@ if(CP2K_USE_CUDA OR CP2K_USE_HIP)
|
|||
$<$<BOOL:${CP2K_DISABLE_DBM_GPU}>:__NO_OFFLOAD_DBM>)
|
||||
endif()
|
||||
|
||||
# add an alias for the FetchContent. Note that FindPackage will automatically
|
||||
# have this alias available.
|
||||
|
||||
add_library(cp2k::cp2k ALIAS cp2k)
|
||||
|
||||
# ##############################################################################
|
||||
# applications
|
||||
# ##############################################################################
|
||||
|
|
@ -1763,10 +1768,10 @@ install(
|
|||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
INCLUDES
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/cp2k")
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}")
|
||||
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/data"
|
||||
DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/cp2k")
|
||||
DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/${PROJECT_NAME}")
|
||||
|
||||
# ##############################################################################
|
||||
# cp2kConfig.cmake, etc...
|
||||
|
|
@ -1790,12 +1795,14 @@ install(
|
|||
EXPORT cp2k_targets
|
||||
FILE cp2kTargets.cmake
|
||||
NAMESPACE cp2k::
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/cp2k")
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
|
||||
|
||||
install(FILES start/libcp2k.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/cp2k")
|
||||
install(FILES start/libcp2k.h
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}")
|
||||
|
||||
install(
|
||||
DIRECTORY "${PROJECT_BINARY_DIR}/src/mod_files"
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/cp2k"
|
||||
DIRECTORY "${PROJECT_BINARY_DIR}/src/"
|
||||
DESTINATION
|
||||
"${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/${CMAKE_Fortran_COMPILER_ID}-${CMAKE_Fortran_COMPILER_VERSION}"
|
||||
FILES_MATCHING
|
||||
PATTERN "*.mod")
|
||||
|
|
|
|||
62
tools/docker/Dockerfile.gcc_spack
Normal file
62
tools/docker/Dockerfile.gcc_spack
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
#
|
||||
# This file was created by generate_dockerfiles.py.
|
||||
# Usage: docker build -f ./Dockerfile.gcc_spack ../../
|
||||
#
|
||||
|
||||
FROM docker.io/ubuntu22.04 as builder
|
||||
|
||||
ARG CUDA_ARCH=80
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
ENV FORCE_UNSAFE_CONFIGURE 1
|
||||
|
||||
ENV PATH="/spack/bin:${PATH}"
|
||||
|
||||
ENV MPICH_VERSION=4.0.3
|
||||
ENV CMAKE_VERSION=3.25.2
|
||||
RUN apt-get update -qq
|
||||
RUN apt-get install -qq --no-install-recommends autoconf autogen automake autotools-dev bzip2 ca-certificates g++ gcc gfortran git less libtool libtool-bin make nano patch pkg-config python3 unzip wget xxd zlib1g-dev cmake gnupg m4 xz-utils libssl-dev libssh-dev
|
||||
RUN wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_386 && chmod a+x /usr/local/bin/yq
|
||||
# get latest version of spack
|
||||
RUN git clone https://github.com/spack/spack.git
|
||||
|
||||
# set the location of packages built by spack
|
||||
RUN spack config add config:install_tree:root:/opt/spack
|
||||
|
||||
# find all external packages
|
||||
RUN spack external find --all --exclude python
|
||||
# find compilers
|
||||
RUN spack compiler find
|
||||
# tweaking the arguments
|
||||
RUN yq -i '.compilers[0].compiler.flags.fflags = "-fallow-argument-mismatch"' /root/.spack/linux/compilers.yaml
|
||||
|
||||
# copy bunch of things from the ci
|
||||
COPY ci/spack /root/spack-recipe
|
||||
RUN spack repo add /root/spack-recipe/ --scope user
|
||||
|
||||
#install openmpi
|
||||
RUN spack install openmpi
|
||||
|
||||
#install few dependencies.
|
||||
RUN spack install intel-oneapi-mkl+cluster
|
||||
RUN spack install openblas+fortran
|
||||
RUN spack install libxsmm
|
||||
RUN spack install libxc
|
||||
RUN spack install gsl
|
||||
RUN spack install py-fypp
|
||||
RUN spack install spglib
|
||||
RUN spack install fftw
|
||||
RUN spack install fftw+openmp
|
||||
RUN spack install libvori
|
||||
|
||||
# full spec
|
||||
ENV SPEC_OPENBLAS="cp2k@master%gcc +libxc +libint +sirius +elpa +plumed +pexsi smm=libxsmm +spglib +cosma +mpi +openmp ^openblas+fortran ^cosma+scalapack+shared"
|
||||
|
||||
# NB : the next 4 lines can be removed normally but it is still better to create
|
||||
additional stages in case of a build failure of cp2k.
|
||||
|
||||
# install all dependencies
|
||||
RUN spack install --only=dependencies --fail-fast $SPEC_OPENBLAS ^openmpi
|
||||
RUN spack install --fail-fast $SPEC_OPENBLAS ^openmpi
|
||||
RUN spack clean -dfs
|
||||
66
tools/docker/Dockerfile.gcc_spack_cuda
Normal file
66
tools/docker/Dockerfile.gcc_spack_cuda
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
#
|
||||
# This file was created by generate_dockerfiles.py.
|
||||
# Usage: docker build -f ./Dockerfile.gcc_spack_cuda ../../
|
||||
#
|
||||
|
||||
FROM docker.io/nvidia/cuda:12.1.0-devel-ubuntu22.04 as builder
|
||||
|
||||
ARG CUDA_ARCH=80
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
ENV FORCE_UNSAFE_CONFIGURE 1
|
||||
ENV LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda/lib64/stubs
|
||||
|
||||
ENV PATH="/spack/bin:${PATH}"
|
||||
|
||||
ENV MPICH_VERSION=4.0.3
|
||||
ENV CMAKE_VERSION=3.25.2
|
||||
RUN apt-get update -qq
|
||||
RUN apt-get install -qq --no-install-recommends autoconf autogen automake autotools-dev bzip2 ca-certificates g++ gcc gfortran git less libtool libtool-bin make nano patch pkg-config python3 unzip wget xxd zlib1g-dev cmake gnupg m4 xz-utils libssl-dev libssh-dev
|
||||
RUN wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_386 && chmod a+x /usr/local/bin/yq
|
||||
# get latest version of spack
|
||||
RUN git clone https://github.com/spack/spack.git
|
||||
|
||||
# set the location of packages built by spack
|
||||
RUN spack config add config:install_tree:root:/opt/spack
|
||||
# set cuda_arch for all packages
|
||||
# RUN spack config add packages:all:variants:cuda_arch=${CUDA_ARCH}
|
||||
|
||||
# find all external packages
|
||||
RUN spack external find --all --exclude python
|
||||
# find compilers
|
||||
RUN spack compiler find
|
||||
# tweaking the arguments
|
||||
RUN yq -i '.compilers[0].compiler.flags.fflags = "-fallow-argument-mismatch"' /root/.spack/linux/compilers.yaml
|
||||
|
||||
# copy bunch of things from the ci
|
||||
COPY ci/spack /root/spack-recipe
|
||||
RUN spack repo add /root/spack-recipe/ --scope user
|
||||
|
||||
#install openmpi
|
||||
RUN spack install openmpi
|
||||
|
||||
#install few dependencies.
|
||||
RUN spack install openblas+fortran
|
||||
RUN spack install libxsmm
|
||||
RUN spack install gsl
|
||||
RUN spack install py-fypp
|
||||
RUN spack install spglib
|
||||
RUN spack install fftw
|
||||
RUN spack install fftw+openmp
|
||||
RUN spack install libvori
|
||||
RUN ldconfig
|
||||
|
||||
# full spec
|
||||
ENV SPEC_OPENBLAS="cp2k@master%gcc build_system=cmake +libxc+libint+sirius+elpa+plumed+pexsi+spglib+cosma+mpi+openmp+cuda cuda_arch=80 smm=libxsmm ^openblas+fortran ^cosma+scalapack+shared+cuda ^dbcsr+cuda~shared cuda_arch=70 ^sirius+cuda"
|
||||
#ENV SPEC_MKL="cp2k@master%gcc build_system=cmake +libxc+libint+sirius+elpa+plumed+pexsi smm=libxsmm +spglib +mpi +openmp +cuda cuda_arch=80 ^intel-oneapi-mkl+cluster ^dbcsr+cuda+shared cuda_arch=70"
|
||||
|
||||
# NB : the next 4 lines can be removed normally but it is still better to create
|
||||
# additional stages in case of a build failure of cp2k.
|
||||
|
||||
# install all dependencies
|
||||
RUN spack install --only=dependencies --fail-fast $SPEC_OPENBLAS ^openmpi
|
||||
# install cp2k itself
|
||||
RUN spack install --fail-fast $SPEC_OPENBLAS ^openmpi
|
||||
RUN spack clean -dfs
|
||||
78
tools/docker/Dockerfile.gcc_spack_rocm
Normal file
78
tools/docker/Dockerfile.gcc_spack_rocm
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
#
|
||||
# This file was created by generate_dockerfiles.py.
|
||||
# Usage: docker build -f ./Dockerfile.gcc_spack_rocm ../../
|
||||
#
|
||||
|
||||
FROM docker.io/rocm/dev-ubuntu-22.04:5.5.1-complete
|
||||
|
||||
ARG ROCM_ARCH=gfx90a
|
||||
ARG ROCM_VERSION=5.5.1
|
||||
ARG AMDGPU_VERSION=5.4.3
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
ENV FORCE_UNSAFE_CONFIGURE 1
|
||||
|
||||
ENV PATH="/spack/bin:${PATH}"
|
||||
|
||||
ENV CMAKE_VERSION=3.26.3
|
||||
ENV MPICH_VERSION=3.4.3
|
||||
|
||||
RUN apt-get -y update && apt-get install -y apt-utils
|
||||
|
||||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl gnupg && \
|
||||
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
sudo \
|
||||
libelf1 \
|
||||
xz-utils \
|
||||
liblzma-dev \
|
||||
libnuma-dev \
|
||||
build-essential \
|
||||
git \
|
||||
vim-nox \
|
||||
cmake-curses-gui \
|
||||
kmod \
|
||||
file \
|
||||
libbz2-dev \
|
||||
python3 \
|
||||
python3-dev \
|
||||
python3-pip \
|
||||
rocm-dev gcc g++ gfortran clang git make unzip \
|
||||
vim wget pkg-config python3-pip python3-venv curl tcl m4 cpio automake \
|
||||
apt-transport-https ca-certificates gnupg software-properties-common \
|
||||
patchelf meson
|
||||
|
||||
# install CMake
|
||||
RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz -O cmake.tar.gz && \
|
||||
tar zxvf cmake.tar.gz --strip-components=1 -C /usr
|
||||
|
||||
# get latest version of spack
|
||||
RUN git clone https://github.com/spack/spack.git
|
||||
|
||||
# set the location of packages built by spack
|
||||
RUN spack config add config:install_tree:root:/opt/local
|
||||
# set amdgpu_target for all packages
|
||||
RUN spack config add packages:all:variants:amdgpu_target=${ROCM_ARCH}
|
||||
# set basic x86_64 architecture
|
||||
RUN spack config add packages:all:target:x86_64
|
||||
|
||||
# find gcc and clang compilers
|
||||
RUN spack compiler find
|
||||
RUN spack external find --all
|
||||
|
||||
# install yq (utility to manipulate the yaml files)
|
||||
RUN wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_386 && chmod a+x /usr/local/bin/yq
|
||||
|
||||
# change the fortran compilers: for gcc the gfortran is already properly set and the change has no effect; add it for clang
|
||||
RUN yq -i '.compilers[0].compiler.flags.fflags = "-fallow-argument-mismatch"' /root/.spack/linux/compilers.yaml
|
||||
|
||||
# copy bunch of things from the ci
|
||||
COPY ci/spack /root/spack-recipe
|
||||
RUN spack repo add /root/spack-recipe/ --scope user
|
||||
|
||||
# find gcc and clang compilers
|
||||
#RUN spack compiler find
|
||||
#RUN spack external find --all
|
||||
|
||||
ENV SPEC_OPENBLAS="cp2k@master%gcc build_system=cmake +sirius +elpa +libxc +libint smm=libxsmm +spglib +cosma +rocm amdgpu_target=gfx90a +pexsi +plumed +libvori +openmp ^openblas+fortran ^dbcsr+mpi+rocm~shared+openmp amdgpu_target=gfx906 ^cosma+shared~tests~apps+rocm"
|
||||
# install all dependencies
|
||||
RUN spack install --only=dependencies --fail-fast $SPEC_OPENBLAS ^openmpi
|
||||
|
|
@ -124,6 +124,15 @@ def main() -> None:
|
|||
with OutputFile(f"Dockerfile.test_{name}", args.check) as f:
|
||||
f.write(test_without_build(name))
|
||||
|
||||
with OutputFile(f"Dockerfile.gcc_spack", args.check) as f:
|
||||
f.write(spack_toolchain_cpu())
|
||||
|
||||
with OutputFile(f"Dockerfile.gcc_spack_cuda", args.check) as f:
|
||||
f.write(spack_toolchain_cuda())
|
||||
|
||||
with OutputFile(f"Dockerfile.gcc_spack_rocm", args.check) as f:
|
||||
f.write(spack_toolchain_rocm())
|
||||
|
||||
|
||||
# ======================================================================================
|
||||
def regtest(
|
||||
|
|
@ -770,6 +779,215 @@ RUN ./scripts/generate_arch_files.sh && rm -rf ./build
|
|||
""".lstrip()
|
||||
|
||||
|
||||
# ======================================================================================
|
||||
def spack_toolchain_cpu() -> str:
|
||||
return rf"""
|
||||
FROM docker.io/ubuntu22.04 as builder
|
||||
|
||||
ARG CUDA_ARCH=80
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
ENV FORCE_UNSAFE_CONFIGURE 1
|
||||
|
||||
ENV PATH="/spack/bin:${{PATH}}"
|
||||
|
||||
ENV MPICH_VERSION=4.0.3
|
||||
ENV CMAKE_VERSION=3.25.2
|
||||
RUN apt-get update -qq
|
||||
RUN apt-get install -qq --no-install-recommends autoconf autogen automake autotools-dev bzip2 ca-certificates g++ gcc gfortran git less libtool libtool-bin make nano patch pkg-config python3 unzip wget xxd zlib1g-dev cmake gnupg m4 xz-utils libssl-dev libssh-dev
|
||||
RUN wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_386 && chmod a+x /usr/local/bin/yq
|
||||
# get latest version of spack
|
||||
RUN git clone https://github.com/spack/spack.git
|
||||
|
||||
# set the location of packages built by spack
|
||||
RUN spack config add config:install_tree:root:/opt/spack
|
||||
|
||||
# find all external packages
|
||||
RUN spack external find --all --exclude python
|
||||
# find compilers
|
||||
RUN spack compiler find
|
||||
# tweaking the arguments
|
||||
RUN yq -i '.compilers[0].compiler.flags.fflags = "-fallow-argument-mismatch"' /root/.spack/linux/compilers.yaml
|
||||
|
||||
# copy bunch of things from the ci
|
||||
COPY ci/spack /root/spack-recipe
|
||||
RUN spack repo add /root/spack-recipe/ --scope user
|
||||
|
||||
#install openmpi
|
||||
RUN spack install openmpi
|
||||
|
||||
#install few dependencies.
|
||||
RUN spack install intel-oneapi-mkl+cluster
|
||||
RUN spack install openblas+fortran
|
||||
RUN spack install libxsmm
|
||||
RUN spack install libxc
|
||||
RUN spack install gsl
|
||||
RUN spack install py-fypp
|
||||
RUN spack install spglib
|
||||
RUN spack install fftw
|
||||
RUN spack install fftw+openmp
|
||||
RUN spack install libvori
|
||||
|
||||
# full spec
|
||||
ENV SPEC_OPENBLAS="cp2k@master%gcc +libxc +libint +sirius +elpa +plumed +pexsi smm=libxsmm +spglib +cosma +mpi +openmp ^openblas+fortran ^cosma+scalapack+shared"
|
||||
|
||||
# NB : the next 4 lines can be removed normally but it is still better to create
|
||||
additional stages in case of a build failure of cp2k.
|
||||
|
||||
# install all dependencies
|
||||
RUN spack install --only=dependencies --fail-fast $SPEC_OPENBLAS ^openmpi
|
||||
RUN spack install --fail-fast $SPEC_OPENBLAS ^openmpi
|
||||
RUN spack clean -dfs
|
||||
"""
|
||||
|
||||
|
||||
# ======================================================================================
|
||||
def spack_toolchain_cuda() -> str:
|
||||
return rf"""
|
||||
FROM docker.io/nvidia/cuda:12.1.0-devel-ubuntu22.04 as builder
|
||||
|
||||
ARG CUDA_ARCH=80
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
ENV FORCE_UNSAFE_CONFIGURE 1
|
||||
ENV LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda/lib64/stubs
|
||||
|
||||
ENV PATH="/spack/bin:${{PATH}}"
|
||||
|
||||
ENV MPICH_VERSION=4.0.3
|
||||
ENV CMAKE_VERSION=3.25.2
|
||||
RUN apt-get update -qq
|
||||
RUN apt-get install -qq --no-install-recommends autoconf autogen automake autotools-dev bzip2 ca-certificates g++ gcc gfortran git less libtool libtool-bin make nano patch pkg-config python3 unzip wget xxd zlib1g-dev cmake gnupg m4 xz-utils libssl-dev libssh-dev
|
||||
RUN wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_386 && chmod a+x /usr/local/bin/yq
|
||||
# get latest version of spack
|
||||
RUN git clone https://github.com/spack/spack.git
|
||||
|
||||
# set the location of packages built by spack
|
||||
RUN spack config add config:install_tree:root:/opt/spack
|
||||
# set cuda_arch for all packages
|
||||
# RUN spack config add packages:all:variants:cuda_arch=${{CUDA_ARCH}}
|
||||
|
||||
# find all external packages
|
||||
RUN spack external find --all --exclude python
|
||||
# find compilers
|
||||
RUN spack compiler find
|
||||
# tweaking the arguments
|
||||
RUN yq -i '.compilers[0].compiler.flags.fflags = "-fallow-argument-mismatch"' /root/.spack/linux/compilers.yaml
|
||||
|
||||
# copy bunch of things from the ci
|
||||
COPY ci/spack /root/spack-recipe
|
||||
RUN spack repo add /root/spack-recipe/ --scope user
|
||||
|
||||
#install openmpi
|
||||
RUN spack install openmpi
|
||||
|
||||
#install few dependencies.
|
||||
RUN spack install openblas+fortran
|
||||
RUN spack install libxsmm
|
||||
RUN spack install gsl
|
||||
RUN spack install py-fypp
|
||||
RUN spack install spglib
|
||||
RUN spack install fftw
|
||||
RUN spack install fftw+openmp
|
||||
RUN spack install libvori
|
||||
RUN ldconfig
|
||||
|
||||
# full spec
|
||||
ENV SPEC_OPENBLAS="cp2k@master%gcc build_system=cmake +libxc+libint+sirius+elpa+plumed+pexsi+spglib+cosma+mpi+openmp+cuda cuda_arch=80 smm=libxsmm ^openblas+fortran ^cosma+scalapack+shared+cuda ^dbcsr+cuda~shared cuda_arch=70 ^sirius+cuda"
|
||||
#ENV SPEC_MKL="cp2k@master%gcc build_system=cmake +libxc+libint+sirius+elpa+plumed+pexsi smm=libxsmm +spglib +mpi +openmp +cuda cuda_arch=80 ^intel-oneapi-mkl+cluster ^dbcsr+cuda+shared cuda_arch=70"
|
||||
|
||||
# NB : the next 4 lines can be removed normally but it is still better to create
|
||||
# additional stages in case of a build failure of cp2k.
|
||||
|
||||
# install all dependencies
|
||||
RUN spack install --only=dependencies --fail-fast $SPEC_OPENBLAS ^openmpi
|
||||
# install cp2k itself
|
||||
RUN spack install --fail-fast $SPEC_OPENBLAS ^openmpi
|
||||
RUN spack clean -dfs
|
||||
"""
|
||||
|
||||
|
||||
# ======================================================================================
|
||||
def spack_toolchain_rocm() -> str:
|
||||
return rf"""
|
||||
FROM docker.io/rocm/dev-ubuntu-22.04:5.5.1-complete
|
||||
|
||||
ARG ROCM_ARCH=gfx90a
|
||||
ARG ROCM_VERSION=5.5.1
|
||||
ARG AMDGPU_VERSION=5.4.3
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
ENV FORCE_UNSAFE_CONFIGURE 1
|
||||
|
||||
ENV PATH="/spack/bin:${{PATH}}"
|
||||
|
||||
ENV CMAKE_VERSION=3.26.3
|
||||
ENV MPICH_VERSION=3.4.3
|
||||
|
||||
RUN apt-get -y update && apt-get install -y apt-utils
|
||||
|
||||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl gnupg && \
|
||||
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
sudo \
|
||||
libelf1 \
|
||||
xz-utils \
|
||||
liblzma-dev \
|
||||
libnuma-dev \
|
||||
build-essential \
|
||||
git \
|
||||
vim-nox \
|
||||
cmake-curses-gui \
|
||||
kmod \
|
||||
file \
|
||||
libbz2-dev \
|
||||
python3 \
|
||||
python3-dev \
|
||||
python3-pip \
|
||||
rocm-dev gcc g++ gfortran clang git make unzip \
|
||||
vim wget pkg-config python3-pip python3-venv curl tcl m4 cpio automake \
|
||||
apt-transport-https ca-certificates gnupg software-properties-common \
|
||||
patchelf meson
|
||||
|
||||
# install CMake
|
||||
RUN wget https://github.com/Kitware/CMake/releases/download/v${{CMAKE_VERSION}}/cmake-${{CMAKE_VERSION}}-linux-x86_64.tar.gz -O cmake.tar.gz && \
|
||||
tar zxvf cmake.tar.gz --strip-components=1 -C /usr
|
||||
|
||||
# get latest version of spack
|
||||
RUN git clone https://github.com/spack/spack.git
|
||||
|
||||
# set the location of packages built by spack
|
||||
RUN spack config add config:install_tree:root:/opt/local
|
||||
# set amdgpu_target for all packages
|
||||
RUN spack config add packages:all:variants:amdgpu_target=${{ROCM_ARCH}}
|
||||
# set basic x86_64 architecture
|
||||
RUN spack config add packages:all:target:x86_64
|
||||
|
||||
# find gcc and clang compilers
|
||||
RUN spack compiler find
|
||||
RUN spack external find --all
|
||||
|
||||
# install yq (utility to manipulate the yaml files)
|
||||
RUN wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_386 && chmod a+x /usr/local/bin/yq
|
||||
|
||||
# change the fortran compilers: for gcc the gfortran is already properly set and the change has no effect; add it for clang
|
||||
RUN yq -i '.compilers[0].compiler.flags.fflags = "-fallow-argument-mismatch"' /root/.spack/linux/compilers.yaml
|
||||
|
||||
# copy bunch of things from the ci
|
||||
COPY ci/spack /root/spack-recipe
|
||||
RUN spack repo add /root/spack-recipe/ --scope user
|
||||
|
||||
# find gcc and clang compilers
|
||||
#RUN spack compiler find
|
||||
#RUN spack external find --all
|
||||
|
||||
ENV SPEC_OPENBLAS="cp2k@master%gcc build_system=cmake +sirius +elpa +libxc +libint smm=libxsmm +spglib +cosma +rocm amdgpu_target=gfx90a +pexsi +plumed +libvori +openmp ^openblas+fortran ^dbcsr+mpi+rocm~shared+openmp amdgpu_target=gfx906 ^cosma+shared~tests~apps+rocm"
|
||||
# install all dependencies
|
||||
RUN spack install --only=dependencies --fail-fast $SPEC_OPENBLAS ^openmpi
|
||||
"""
|
||||
|
||||
|
||||
# ======================================================================================
|
||||
class OutputFile:
|
||||
def __init__(self, filename: str, check: bool) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue