From f577188f4723484bc027294ecb03c149b0cf5c22 Mon Sep 17 00:00:00 2001 From: SY Wang Date: Sun, 26 Apr 2026 18:40:37 +0800 Subject: [PATCH] Toolchain: Replace "scripts/generate_cmake_options.sh" with "build_cp2k.sh" (#5080) Co-authored-by: HE Zilong <159878975+he-zilong@users.noreply.github.com> --- INSTALL.md | 13 + docs/getting-started/build-from-source.md | 27 +- docs/getting-started/distributions.md | 6 + tools/docker/Dockerfile.build_hip_rocm_Mi100 | 4 +- tools/docker/Dockerfile.build_hip_rocm_Mi50 | 4 +- tools/docker/Dockerfile.test_aiida | 4 +- tools/docker/Dockerfile.test_arm64-psmp | 4 +- tools/docker/Dockerfile.test_asan-psmp | 4 +- tools/docker/Dockerfile.test_ase | 4 +- tools/docker/Dockerfile.test_conventions | 4 +- tools/docker/Dockerfile.test_coverage | 4 +- tools/docker/Dockerfile.test_cuda_A100 | 4 +- tools/docker/Dockerfile.test_cuda_P100 | 4 +- tools/docker/Dockerfile.test_cuda_V100 | 4 +- tools/docker/Dockerfile.test_fedora-psmp | 4 +- tools/docker/Dockerfile.test_gcc10 | 4 +- tools/docker/Dockerfile.test_gcc11 | 4 +- tools/docker/Dockerfile.test_gcc12 | 4 +- tools/docker/Dockerfile.test_gcc13 | 4 +- tools/docker/Dockerfile.test_gcc14 | 4 +- tools/docker/Dockerfile.test_gcc15 | 4 +- tools/docker/Dockerfile.test_gcc8 | 4 +- tools/docker/Dockerfile.test_gcc9 | 4 +- tools/docker/Dockerfile.test_generic_psmp | 4 +- tools/docker/Dockerfile.test_gromacs | 4 +- tools/docker/Dockerfile.test_i-pi | 4 +- tools/docker/Dockerfile.test_intel-ifort-psmp | 4 +- tools/docker/Dockerfile.test_intel-ifort-ssmp | 4 +- tools/docker/Dockerfile.test_intel-ifx-psmp | 4 +- tools/docker/Dockerfile.test_intel-ifx-ssmp | 4 +- tools/docker/Dockerfile.test_manual | 4 +- tools/docker/Dockerfile.test_minimal | 4 +- tools/docker/Dockerfile.test_openmpi-psmp | 4 +- tools/docker/Dockerfile.test_pdbg | 4 +- tools/docker/Dockerfile.test_performance | 4 +- .../Dockerfile.test_performance_cuda_A100 | 4 +- .../Dockerfile.test_performance_cuda_P100 | 4 +- .../Dockerfile.test_performance_cuda_V100 | 4 +- tools/docker/Dockerfile.test_phonopy | 4 +- tools/docker/Dockerfile.test_psmp | 4 +- tools/docker/Dockerfile.test_psmp_4ranks | 4 +- tools/docker/Dockerfile.test_sdbg | 4 +- tools/docker/Dockerfile.test_ssmp | 4 +- tools/docker/generate_dockerfiles.py | 4 +- tools/toolchain/README.md | 3 +- tools/toolchain/build_cp2k.sh | 282 ++++++++++++++++++ tools/toolchain/install_cp2k_toolchain.sh | 62 ++-- .../scripts/generate_cmake_options.sh | 240 --------------- .../toolchain/scripts/stage9/install_dbcsr.sh | 5 +- 49 files changed, 407 insertions(+), 395 deletions(-) create mode 100755 tools/toolchain/build_cp2k.sh delete mode 100755 tools/toolchain/scripts/generate_cmake_options.sh diff --git a/INSTALL.md b/INSTALL.md index 29afbb0168..01b2094da6 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -70,6 +70,19 @@ a range of devices). If you wish to build with GPU support, please see the --with-fftw=system --enable-hip ``` +- Build and install CP2K with prepared toolchain environment: + +```shell +./build_cp2k.sh +``` + +It is also available to make installed program and dependencies outside the source tree: + +```shell +./install_cp2k_toolchain.sh --install-dir=/opt/cp2k/toolchain +./build_cp2k.sh --prefix /opt/cp2k +``` + ## 3. Compile This section has been moved to the diff --git a/docs/getting-started/build-from-source.md b/docs/getting-started/build-from-source.md index b8fdbf737f..9cb864b3a4 100644 --- a/docs/getting-started/build-from-source.md +++ b/docs/getting-started/build-from-source.md @@ -3,14 +3,23 @@ CP2K uses the [CMake](https://cmake.org) build system, which detects dependencies and controls the compilation process. The dependencies have to be installed in advance. -Currently, CP2K offers two convenient ways for building CP2K from source with its dependencies. One -is to use the classic toolchain scripts to customize and install the required dependencies in a -single step, thereby preparing the environment for compiling CP2K. +Currently, CP2K offers two convenient ways for building CP2K from source with its dependencies: -A more modern and automated approach is via the `make_cp2k.sh` script, which leverages -[Spack](https://spack.readthedocs.io) to install the dependencies and subsequently build CP2K. The -latter approach is only available for the current [CP2K master branch](https://github.com/cp2k/cp2k) -and CP2K release versions `2026.02` and newer. +- The toolchain scripts, which customize and install the required dependencies in a single step, + thereby preparing the environment for compiling CP2K. Run `install_cp2k_toolchain.sh` under + `cp2k/tools/toolchain` to perform the toolchain steps; for detailed information, see + . After building toolchain, + you can use `build_cp2k.sh` to build and install CP2K with prepared toolchain environment. +- The `make_cp2k.sh` script, a more modern and automated approach which leverages + [Spack](https://spack.readthedocs.io) to install the dependencies and subsequently build CP2K. + +```{note} +- The toolchain does not cover all optional dependencies due to their complicated dependencies + requirements, such as DLA-Future. SIRIUS with complete support (including DFT-D4 and NLCG) is + also unavailable via toolchain due to the same reason. +- The latter approach with Spack is only available for the current +[CP2K master branch](https://github.com/cp2k/cp2k) and CP2K release versions `2026.02` and newer. +``` ## make_cp2k.sh @@ -105,8 +114,8 @@ Features: cray_pm_accel_energy | cusolver_mp | dbm_gpu | elpa_gpu | grid_gpu | p -The first run will take longer as it will build all CP2K dependencies with Spack. The Spack -installation is kept fully local in the subfolder `cp2k/spack` which corresponds to the +The first run will take longer as it will build all requested CP2K dependencies with Spack. The +Spack installation is kept fully local in the subfolder `cp2k/spack` which corresponds to the `tools/toolchain/install` folder created by the CP2K toolchain. Subsequent runs of the `make_cp2k.sh` script will use the software stack from that `cp2k/spack` diff --git a/docs/getting-started/distributions.md b/docs/getting-started/distributions.md index 0f6d8c405d..f8aac6e92a 100644 --- a/docs/getting-started/distributions.md +++ b/docs/getting-started/distributions.md @@ -2,6 +2,12 @@ The easiest way to get started with CP2K is to install it from a distribution. +```{note} +The pre-compiled package from distributions may not performs as well as package +built from source, as it usually adopts a conservative compilation strategy to +ensure broad compatibility. +``` + ## Arch ```shell diff --git a/tools/docker/Dockerfile.build_hip_rocm_Mi100 b/tools/docker/Dockerfile.build_hip_rocm_Mi100 index 99d44fe8cc..03d6a7bc2c 100644 --- a/tools/docker/Dockerfile.build_hip_rocm_Mi100 +++ b/tools/docker/Dockerfile.build_hip_rocm_Mi100 @@ -38,7 +38,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -46,8 +45,7 @@ RUN ./install_cp2k_toolchain.sh \ --enable-hip=yes \ --gpu-ver=Mi100 \ --with-dbcsr \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.build_hip_rocm_Mi50 b/tools/docker/Dockerfile.build_hip_rocm_Mi50 index 6ba9e29746..e73fe4a7f3 100644 --- a/tools/docker/Dockerfile.build_hip_rocm_Mi50 +++ b/tools/docker/Dockerfile.build_hip_rocm_Mi50 @@ -38,7 +38,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -46,8 +45,7 @@ RUN ./install_cp2k_toolchain.sh \ --enable-hip=yes \ --gpu-ver=Mi50 \ --with-dbcsr \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_aiida b/tools/docker/Dockerfile.test_aiida index 72e774f4d5..f1795cb9ed 100644 --- a/tools/docker/Dockerfile.test_aiida +++ b/tools/docker/Dockerfile.test_aiida @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -26,8 +25,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=no \ --with-dbcsr \ --with-gcc=system \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_arm64-psmp b/tools/docker/Dockerfile.test_arm64-psmp index 9b2d70e105..fabdeb278f 100644 --- a/tools/docker/Dockerfile.test_arm64-psmp +++ b/tools/docker/Dockerfile.test_arm64-psmp @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -28,8 +27,7 @@ RUN ./install_cp2k_toolchain.sh \ --with-gcc=system \ --with-libtorch=no \ --with-deepmd=no \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_asan-psmp b/tools/docker/Dockerfile.test_asan-psmp index ccf2a76fba..45edd8aaf1 100644 --- a/tools/docker/Dockerfile.test_asan-psmp +++ b/tools/docker/Dockerfile.test_asan-psmp @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -26,8 +25,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=mpich \ --with-dbcsr \ --with-gcc=system \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_ase b/tools/docker/Dockerfile.test_ase index 92d5760438..2731d8b420 100644 --- a/tools/docker/Dockerfile.test_ase +++ b/tools/docker/Dockerfile.test_ase @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -26,8 +25,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=no \ --with-dbcsr \ --with-gcc=system \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_conventions b/tools/docker/Dockerfile.test_conventions index b6432c2258..8412d05f3f 100644 --- a/tools/docker/Dockerfile.test_conventions +++ b/tools/docker/Dockerfile.test_conventions @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -26,8 +25,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=mpich \ --with-dbcsr \ --with-gcc=system \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_coverage b/tools/docker/Dockerfile.test_coverage index 8be241f29f..edb0370630 100644 --- a/tools/docker/Dockerfile.test_coverage +++ b/tools/docker/Dockerfile.test_coverage @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -26,8 +25,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=mpich \ --with-dbcsr \ --with-gcc=system \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_cuda_A100 b/tools/docker/Dockerfile.test_cuda_A100 index 7135af5e66..00c32296d6 100644 --- a/tools/docker/Dockerfile.test_cuda_A100 +++ b/tools/docker/Dockerfile.test_cuda_A100 @@ -31,7 +31,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -39,8 +38,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=mpich \ --enable-cuda=yes \ --gpu-ver=A100 \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_cuda_P100 b/tools/docker/Dockerfile.test_cuda_P100 index 7a238cf5e6..1d33aa9367 100644 --- a/tools/docker/Dockerfile.test_cuda_P100 +++ b/tools/docker/Dockerfile.test_cuda_P100 @@ -31,7 +31,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -39,8 +38,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=mpich \ --enable-cuda=yes \ --gpu-ver=P100 \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_cuda_V100 b/tools/docker/Dockerfile.test_cuda_V100 index ee40e9df05..b5aa0f4e9a 100644 --- a/tools/docker/Dockerfile.test_cuda_V100 +++ b/tools/docker/Dockerfile.test_cuda_V100 @@ -31,7 +31,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -39,8 +38,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=mpich \ --enable-cuda=yes \ --gpu-ver=V100 \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_fedora-psmp b/tools/docker/Dockerfile.test_fedora-psmp index b7de259efd..2a326c7bbe 100644 --- a/tools/docker/Dockerfile.test_fedora-psmp +++ b/tools/docker/Dockerfile.test_fedora-psmp @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -26,8 +25,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=mpich \ --with-dbcsr \ --with-gcc=system \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_gcc10 b/tools/docker/Dockerfile.test_gcc10 index b017f1cb47..4e56821b4a 100644 --- a/tools/docker/Dockerfile.test_gcc10 +++ b/tools/docker/Dockerfile.test_gcc10 @@ -47,7 +47,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -63,8 +62,7 @@ RUN ./install_cp2k_toolchain.sh \ --with-libxsmm=no \ --with-spglib=no \ --with-libvori=no \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_gcc11 b/tools/docker/Dockerfile.test_gcc11 index 64416c0ac1..2909c43546 100644 --- a/tools/docker/Dockerfile.test_gcc11 +++ b/tools/docker/Dockerfile.test_gcc11 @@ -47,7 +47,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -63,8 +62,7 @@ RUN ./install_cp2k_toolchain.sh \ --with-libxsmm=no \ --with-spglib=no \ --with-libvori=no \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_gcc12 b/tools/docker/Dockerfile.test_gcc12 index c48aeac553..3f2f526431 100644 --- a/tools/docker/Dockerfile.test_gcc12 +++ b/tools/docker/Dockerfile.test_gcc12 @@ -47,7 +47,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -63,8 +62,7 @@ RUN ./install_cp2k_toolchain.sh \ --with-libxsmm=no \ --with-spglib=no \ --with-libvori=no \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_gcc13 b/tools/docker/Dockerfile.test_gcc13 index 49e41d685a..8452487766 100644 --- a/tools/docker/Dockerfile.test_gcc13 +++ b/tools/docker/Dockerfile.test_gcc13 @@ -47,7 +47,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -63,8 +62,7 @@ RUN ./install_cp2k_toolchain.sh \ --with-libxsmm=no \ --with-spglib=no \ --with-libvori=no \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_gcc14 b/tools/docker/Dockerfile.test_gcc14 index cfe938d554..99ac329c39 100644 --- a/tools/docker/Dockerfile.test_gcc14 +++ b/tools/docker/Dockerfile.test_gcc14 @@ -51,7 +51,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -67,8 +66,7 @@ RUN ./install_cp2k_toolchain.sh \ --with-libxsmm=no \ --with-spglib=no \ --with-libvori=no \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_gcc15 b/tools/docker/Dockerfile.test_gcc15 index 6b0d7d4177..170ec3cd84 100644 --- a/tools/docker/Dockerfile.test_gcc15 +++ b/tools/docker/Dockerfile.test_gcc15 @@ -51,7 +51,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -67,8 +66,7 @@ RUN ./install_cp2k_toolchain.sh \ --with-libxsmm=no \ --with-spglib=no \ --with-libvori=no \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_gcc8 b/tools/docker/Dockerfile.test_gcc8 index 0c661a7a0f..c3ebd4cf64 100644 --- a/tools/docker/Dockerfile.test_gcc8 +++ b/tools/docker/Dockerfile.test_gcc8 @@ -47,7 +47,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -63,8 +62,7 @@ RUN ./install_cp2k_toolchain.sh \ --with-libxsmm=no \ --with-spglib=no \ --with-libvori=no \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_gcc9 b/tools/docker/Dockerfile.test_gcc9 index c04d4db0cb..5a463f7f93 100644 --- a/tools/docker/Dockerfile.test_gcc9 +++ b/tools/docker/Dockerfile.test_gcc9 @@ -47,7 +47,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -63,8 +62,7 @@ RUN ./install_cp2k_toolchain.sh \ --with-libxsmm=no \ --with-spglib=no \ --with-libvori=no \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_generic_psmp b/tools/docker/Dockerfile.test_generic_psmp index 8525103a05..e19206698e 100644 --- a/tools/docker/Dockerfile.test_generic_psmp +++ b/tools/docker/Dockerfile.test_generic_psmp @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -27,8 +26,7 @@ RUN ./install_cp2k_toolchain.sh \ --with-dbcsr \ --with-gcc=system \ --target-cpu=generic \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_gromacs b/tools/docker/Dockerfile.test_gromacs index db04159230..b28b2abd0d 100644 --- a/tools/docker/Dockerfile.test_gromacs +++ b/tools/docker/Dockerfile.test_gromacs @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -26,8 +25,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=no \ --with-dbcsr \ --with-gcc=system \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_i-pi b/tools/docker/Dockerfile.test_i-pi index 4c57c4ea09..77f1f73eeb 100644 --- a/tools/docker/Dockerfile.test_i-pi +++ b/tools/docker/Dockerfile.test_i-pi @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -26,8 +25,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=no \ --with-dbcsr \ --with-gcc=system \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_intel-ifort-psmp b/tools/docker/Dockerfile.test_intel-ifort-psmp index 2e8ee3e1dc..8ecd6efe44 100644 --- a/tools/docker/Dockerfile.test_intel-ifort-psmp +++ b/tools/docker/Dockerfile.test_intel-ifort-psmp @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -29,8 +28,7 @@ RUN ./install_cp2k_toolchain.sh \ --with-libsmeagol \ --with-libtorch=no \ --with-deepmd=no \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_intel-ifort-ssmp b/tools/docker/Dockerfile.test_intel-ifort-ssmp index 1ccd9ab267..285b961a76 100644 --- a/tools/docker/Dockerfile.test_intel-ifort-ssmp +++ b/tools/docker/Dockerfile.test_intel-ifort-ssmp @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -29,8 +28,7 @@ RUN ./install_cp2k_toolchain.sh \ --with-libsmeagol \ --with-libtorch=no \ --with-deepmd=no \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_intel-ifx-psmp b/tools/docker/Dockerfile.test_intel-ifx-psmp index 5f3f04feec..095b1e330d 100644 --- a/tools/docker/Dockerfile.test_intel-ifx-psmp +++ b/tools/docker/Dockerfile.test_intel-ifx-psmp @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -29,8 +28,7 @@ RUN ./install_cp2k_toolchain.sh \ --with-libsmeagol \ --with-libtorch=no \ --with-deepmd=no \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_intel-ifx-ssmp b/tools/docker/Dockerfile.test_intel-ifx-ssmp index ddcd339782..ce08fd5570 100644 --- a/tools/docker/Dockerfile.test_intel-ifx-ssmp +++ b/tools/docker/Dockerfile.test_intel-ifx-ssmp @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -29,8 +28,7 @@ RUN ./install_cp2k_toolchain.sh \ --with-libsmeagol \ --with-libtorch=no \ --with-deepmd=no \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_manual b/tools/docker/Dockerfile.test_manual index 7b7937e941..ced42db274 100644 --- a/tools/docker/Dockerfile.test_manual +++ b/tools/docker/Dockerfile.test_manual @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -26,8 +25,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=mpich \ --with-dbcsr \ --with-gcc=system \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_minimal b/tools/docker/Dockerfile.test_minimal index ec76f657bc..f1359e0bf1 100644 --- a/tools/docker/Dockerfile.test_minimal +++ b/tools/docker/Dockerfile.test_minimal @@ -47,7 +47,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -63,8 +62,7 @@ RUN ./install_cp2k_toolchain.sh \ --with-libxsmm=no \ --with-spglib=no \ --with-libvori=no \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_openmpi-psmp b/tools/docker/Dockerfile.test_openmpi-psmp index 48ea7f8b2b..92a9ad4c6c 100644 --- a/tools/docker/Dockerfile.test_openmpi-psmp +++ b/tools/docker/Dockerfile.test_openmpi-psmp @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -26,8 +25,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=openmpi \ --with-dbcsr \ --with-gcc=system \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_pdbg b/tools/docker/Dockerfile.test_pdbg index c9a11599e6..ddb84fb556 100644 --- a/tools/docker/Dockerfile.test_pdbg +++ b/tools/docker/Dockerfile.test_pdbg @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -26,8 +25,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=mpich \ --with-dbcsr \ --with-gcc=system \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_performance b/tools/docker/Dockerfile.test_performance index 7e9293c0ad..f653bb5008 100644 --- a/tools/docker/Dockerfile.test_performance +++ b/tools/docker/Dockerfile.test_performance @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -26,8 +25,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=mpich \ --with-dbcsr \ --with-gcc=system \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_performance_cuda_A100 b/tools/docker/Dockerfile.test_performance_cuda_A100 index b9ba6f0479..a000de4c66 100644 --- a/tools/docker/Dockerfile.test_performance_cuda_A100 +++ b/tools/docker/Dockerfile.test_performance_cuda_A100 @@ -31,7 +31,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -39,8 +38,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=mpich \ --enable-cuda=yes \ --gpu-ver=A100 \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_performance_cuda_P100 b/tools/docker/Dockerfile.test_performance_cuda_P100 index a5810a29e2..3cc73ed6c9 100644 --- a/tools/docker/Dockerfile.test_performance_cuda_P100 +++ b/tools/docker/Dockerfile.test_performance_cuda_P100 @@ -31,7 +31,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -39,8 +38,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=mpich \ --enable-cuda=yes \ --gpu-ver=P100 \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_performance_cuda_V100 b/tools/docker/Dockerfile.test_performance_cuda_V100 index 1c847256ee..50767e48ad 100644 --- a/tools/docker/Dockerfile.test_performance_cuda_V100 +++ b/tools/docker/Dockerfile.test_performance_cuda_V100 @@ -31,7 +31,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -39,8 +38,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=mpich \ --enable-cuda=yes \ --gpu-ver=V100 \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_phonopy b/tools/docker/Dockerfile.test_phonopy index 5bd29b742b..d1e4b2721e 100644 --- a/tools/docker/Dockerfile.test_phonopy +++ b/tools/docker/Dockerfile.test_phonopy @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -26,8 +25,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=no \ --with-dbcsr \ --with-gcc=system \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_psmp b/tools/docker/Dockerfile.test_psmp index f01c15c567..42db2e9c8c 100644 --- a/tools/docker/Dockerfile.test_psmp +++ b/tools/docker/Dockerfile.test_psmp @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -26,8 +25,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=mpich \ --with-dbcsr \ --with-gcc=system \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_psmp_4ranks b/tools/docker/Dockerfile.test_psmp_4ranks index dd8ce6d2b2..217156bdd6 100644 --- a/tools/docker/Dockerfile.test_psmp_4ranks +++ b/tools/docker/Dockerfile.test_psmp_4ranks @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -26,8 +25,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=mpich \ --with-dbcsr \ --with-gcc=system \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_sdbg b/tools/docker/Dockerfile.test_sdbg index b9944f28ff..b2b0c3d9e9 100644 --- a/tools/docker/Dockerfile.test_sdbg +++ b/tools/docker/Dockerfile.test_sdbg @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -26,8 +25,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=no \ --with-dbcsr \ --with-gcc=system \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/Dockerfile.test_ssmp b/tools/docker/Dockerfile.test_ssmp index 4cef698ef4..2db0899b03 100644 --- a/tools/docker/Dockerfile.test_ssmp +++ b/tools/docker/Dockerfile.test_ssmp @@ -18,7 +18,6 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ @@ -26,8 +25,7 @@ RUN ./install_cp2k_toolchain.sh \ --mpi-mode=no \ --with-dbcsr \ --with-gcc=system \ - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/docker/generate_dockerfiles.py b/tools/docker/generate_dockerfiles.py index 09fd6394f4..4923b03600 100755 --- a/tools/docker/generate_dockerfiles.py +++ b/tools/docker/generate_dockerfiles.py @@ -654,13 +654,11 @@ COPY ./tools/toolchain/scripts/VERSION \ ./tools/toolchain/scripts/common_vars.sh \ ./tools/toolchain/scripts/signal_trap.sh \ ./tools/toolchain/scripts/get_openblas_arch.sh \ - ./tools/toolchain/scripts/generate_cmake_options.sh \ ./scripts/ COPY ./tools/toolchain/install_cp2k_toolchain.sh . RUN ./install_cp2k_toolchain.sh \ {install_args_str} - --dry-run \ - --list-cmake-options=no + --dry-run # Dry-run leaves behind config files for the followup install scripts. # This breaks up the lengthy installation into smaller build steps. diff --git a/tools/toolchain/README.md b/tools/toolchain/README.md index 1499201ec3..e65128edab 100644 --- a/tools/toolchain/README.md +++ b/tools/toolchain/README.md @@ -62,8 +62,7 @@ this behavior using `-j N` option, where `N` specifies the number of processors ### The script failed at a tarball downloading stage -Try run again with `--no-check-certificate` option. See the help section for this option for -details. +Simply try run again. The toolchain scripts will delete the broken tarball and re-download. ### I've used `--with-XYZ=system` but the XYZ library cannot be found diff --git a/tools/toolchain/build_cp2k.sh b/tools/toolchain/build_cp2k.sh new file mode 100755 index 0000000000..8fe2f915fb --- /dev/null +++ b/tools/toolchain/build_cp2k.sh @@ -0,0 +1,282 @@ +#!/bin/bash -e + +# shellcheck disable=all + +[ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0 +SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")" && pwd -P)" + +TOOLCHAIN_ROOTDIR="${PWD}" +# Exit this script if it is not called from the ./tools/toolchain directory +if [ "${TOOLCHAIN_ROOTDIR}" != "${SCRIPT_DIR}" ]; then + cat << EOF +ERROR: Incorrect execution location. +The absolute path of the build_cp2k.sh script is at: + ${SCRIPT_DIR} +Actual working directory where it is currently called: + ${TOOLCHAIN_ROOTDIR} +Please enter the absolute path above before executing the build_cp2k.sh script +so that subsequent scripts can be found and files can be placed correctly. +EOF + exit 1 +fi +TOOLCHAIN_SCRIPTS_DIR="${TOOLCHAIN_ROOTDIR}/scripts" +source "${TOOLCHAIN_ROOTDIR}/toolchain_settings" +source "${TOOLCHAIN_SCRIPTS_DIR}/tool_kit.sh" + +# ====================== Parameter parsing ====================== +CP2K_ROOT=$(cd "${TOOLCHAIN_ROOTDIR}/../.." && pwd) +CMAKE_INSTALL_PREFIX=${CP2K_ROOT}/install +CLEAN_BUILD="__FALSE__" +BUILD_JOBS="$(get_nprocs)" +BUILD_SHARED_LIBS="ON" +DRY_RUN="__FALSE__" + +show_help() { + cat << EOF +Usage: $(basename "$0") [OPTIONS] + +Generate CMake options from the toolchain configuration and build CP2K. + +Options: + -h, --help Show this help message and exit + -j N, -jN Number of parallel build jobs + --prefix Set CMAKE_INSTALL_PREFIX (default is ${CP2K_ROOT}/install) + --dry-run Show generated CMake options only and then exit + --clean Remove the build directory before configuring, which means + rebuilding CP2K entirely + --build-static Set -DBUILD_SHARED_LIBS=OFF (default is ON) +EOF +} + +while [ $# -ge 1 ]; do + case "$1" in + --dry-run) + DRY_RUN="__TRUE__" + ;; + --clean) + CLEAN_BUILD="__TRUE__" + ;; + -j) + BUILD_JOBS="$2" + shift + ;; + -j[0-9]*) + BUILD_JOBS="${1#-j}" + ;; + --prefix) + if [[ "${2}" != /* ]]; then + report_error "The path for --prefix must be an absolute path." + exit 1 + fi + CMAKE_INSTALL_PREFIX="${2}" + shift + ;; + --build-static) + BUILD_SHARED_LIBS="OFF" + ;; + -h | --help) + show_help + exit 0 + ;; + *) + echo "ERROR: Unknown option: $1" + show_help + exit 1 + ;; + esac + shift +done + +# ====================== Pre-checks ====================== +# Require complete source tree +# A minimum working environment for this script should be as follows (assuming out-of-tree build not required): +# cp2k <- variable ${CP2K_ROOT}; CMake option -S +# ├── CMakeLists.txt <- file to be parsed for generating cmake options +# ├── cmake <- directory containing CMake files +# ├── data <- CP2K data directory; CMake option -DCP2K_DATA_DIR\ +# ├── build <- to-be-created; CMake option -B +# ├── install <- to-be-created; CMake option -DCMAKE_INSTALL_PREFIX +# ├── src <- CP2K source code directory +# └── tools +# └── toolchain <- working directory; variable ${TOOLCHAIN_ROOTDIR} +# ├── build_cp2k.sh <- this script +# ├── install_cp2k_toolchain.sh <- script being executed before calling this script +# ├── scripts <- directory with toolchain scripts; ${TOOLCHAIN_SCRIPTS_DIR} +# │ └── tool_kit.sh +# └── install <- directory with installed dependencies; ${TOOLCHAIN_INSTALL_DIR} +# ├── setup <- * file to be used for building CP2K +# ├── toolchain.conf <- * file to be parsed for generating cmake options +# └── toolchain.env <- * file to be parsed for generating cmake options (MPI_F08) +# +if [ -d "${CP2K_ROOT}/src" ]; then + echo "Root directory of CP2K with source code is found as ${CP2K_ROOT}" + echo "(path is exported to variable \${CP2K_ROOT})." +else + report_error ${LINENO} "\${CP2K_ROOT} does not have subdirectory src." + exit 1 +fi +if [ -f "${CP2K_ROOT}/CMakeLists.txt" ] && [ -r "${CP2K_ROOT}/CMakeLists.txt" ]; then + echo "\${CP2K_ROOT}/CMakeLists.txt exists; will be parsed for CMake options." +else + report_error ${LINENO} "\${CP2K_ROOT}/CMakeLists.txt cannot be found or read." + exit 1 +fi +if [ -d "${CP2K_ROOT}/data" ]; then + echo "Data directory ${CP2K_ROOT}/data is found." +else + report_error ${LINENO} "Data directory \${CP2K_ROOT}/data cannot be found." + exit 1 +fi + +# Require finished toolchain +if [ ! -f "${TOOLCHAIN_INSTALL_DIR}/setup" ]; then + echo "Error: Toolchain is not installed. Please run ./install_cp2k_toolchain.sh first." + exit 1 +fi + +# Disallow combination of installing toolchain outside the source tree and CP2K under the source tree +if [ "${TOOLCHAIN_INSTALL_DIR}" != "${TOOLCHAIN_ROOTDIR}"/install ] && + [[ ${CMAKE_INSTALL_PREFIX} == ${CP2K_ROOT}/* ]]; then + echo + cat << EOF +ERROR: You toolchain installation is outside the source tree but the install +prefix of CP2K is under the source tree, which is disallowed by this script. +The script will now abort; please manually set "--prefix" to a proper path. +EOF + exit 1 +fi + +# Load toolchain environment (required for with_xxx variables) +source "${TOOLCHAIN_INSTALL_DIR}/setup" +source "${TOOLCHAIN_INSTALL_DIR}/toolchain.conf" + +printf "========================== %s =========================\n" \ + "Generating CMake options from toolchain" + +# Generate cmake options for compiling cp2k +CMAKE_OPTIONS="-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}" +if [[ ${CMAKE_INSTALL_PREFIX} == ${CP2K_ROOT}/* ]]; then + CMAKE_OPTIONS+=" -DCP2K_DATA_DIR=${CP2K_ROOT}/data" +fi +if [ -n "$(grep -- "--install-all" "${TOOLCHAIN_INSTALL_DIR}/setup")" ]; then + CMAKE_OPTIONS+=" -DCP2K_USE_EVERYTHING=ON -DCP2K_USE_DLAF=OFF -DCP2K_USE_PEXSI=OFF" + for toolchain_option in $(grep -i "dontuse" "${TOOLCHAIN_INSTALL_DIR}/toolchain.conf" | + grep -Evi "gcc|amd|intel" | cut -d'_' -f2 | cut -d'=' -f1); do + var_name="with_${toolchain_option}" + if [ "${!var_name}" != "__DONTUSE__" ]; then + ADDED_CMAKE_OPTION=$(sed -n '/option(/,/)/p' "${CP2K_ROOT}/CMakeLists.txt" | + grep -i "${toolchain_option}" | awk '{print $1}' | cut -d'(' -f2 | head -n 1) + # Use "if-then" below can avoid generating empty "-D=OFF" options + if [ -n "${ADDED_CMAKE_OPTION}" ]; then + CMAKE_OPTIONS+=" -D${ADDED_CMAKE_OPTION}=OFF" + fi + fi + done +else + # If MPI is used, set "CP2K_USE_MPI" to "ON" + if [ "${mpi_mode}" != "no" ]; then + CMAKE_OPTIONS+=" -DCP2K_USE_MPI=ON -DCP2K_USE_MPI_F08=ON" + fi + # Some options that should be specially considered: + # Intel MKL includes FFTW + if [ "${with_fftw}" != "__DONTUSE__" ] || [ "${MATH_MODE}" = "mkl" ]; then + CMAKE_OPTIONS+=" -DCP2K_USE_FFTW3=ON" + fi + # Mimic-MCL (MiMiC Communication Library) + if [ "${with_mcl}" != "__DONTUSE__" ]; then + CMAKE_OPTIONS+=" -DCP2K_USE_MIMIC=ON" + fi + # Detect if any other dependencies is used and add the proper cmake option + # Since "pugixml" and "gsl" are not mentioned in CMakeLists.txt, they will not be considered. + for toolchain_option in $(grep "with" "${TOOLCHAIN_INSTALL_DIR}"/toolchain.conf | + grep -Evi "dontuse|gcc|amd|intel|cmake|fftw|mkl|dbcsr" | cut -d'_' -f2 | cut -d'=' -f1); do + var_name="with_${toolchain_option}" + if [ "${!var_name}" != "__DONTUSE__" ]; then + ADDED_CMAKE_OPTION=$(sed -n '/option(/,/)/p' "${CP2K_ROOT}/CMakeLists.txt" | + grep -i "${toolchain_option}" | awk '{print $1}' | cut -d'(' -f2 | head -n 1) + # Use "if-then" below can avoid generating empty "-D=ON" options + if [ -n "${ADDED_CMAKE_OPTION}" ]; then + CMAKE_OPTIONS+=" -D${ADDED_CMAKE_OPTION}=ON" + fi + fi + done +fi +# If GPU acceleration is used, add the option about GPU acceleration +if [ "${enable_cuda}" = "__TRUE__" ]; then + CMAKE_OPTIONS+=" -DCP2K_USE_ACCEL=CUDA -DCP2K_WITH_GPU=${gpu_ver}" +elif [ "${enable_hip}" = "__TRUE__" ]; then + CMAKE_OPTIONS+=" -DCP2K_USE_ACCEL=HIP -DCP2K_WITH_GPU=${gpu_ver}" +elif [ "${enable_opencl}" = "__TRUE__" ]; then + CMAKE_OPTIONS+=" -DCP2K_USE_ACCEL=OPENCL" +fi + +# Set build directory +BUILD_DIR="${CP2K_ROOT}/build" + +# Show CMake options +echo "Generated CMake flags:" +for flag in ${CMAKE_OPTIONS}; do + echo " ${flag}" +done + +if [ "${DRY_RUN}" != "__TRUE__" ]; then + # ====================== Optional clean ====================== + if [ "${CLEAN_BUILD}" = "__TRUE__" ] && [ -d "${BUILD_DIR}" ]; then + echo "Removing existing build directory: ${BUILD_DIR}" + rm -rf "${BUILD_DIR}" + fi + + mkdir -p "${BUILD_DIR}" + + # ====================== Configure ====================== + echo "================== CMake configuration ===================" + echo "Source dir : ${CP2K_ROOT}" + echo "Build dir : ${BUILD_DIR}" + echo "Install dir: ${CMAKE_INSTALL_PREFIX}" + echo "Shared libs: ${BUILD_SHARED_LIBS}" + + echo -n "Configuring ... " + cmake -S "${CP2K_ROOT}" -B "${BUILD_DIR}" ${CMAKE_OPTIONS} > cmake.log 2>&1 || tail_excerpt cmake.log + echo "done." + echo "==========================================================" + + # ====================== Build ====================== + echo "==================== Building CP2K =======================" + echo "Parallel jobs: ${BUILD_JOBS}" + + echo -n "Building CP2K ... " + cmake --build "${BUILD_DIR}" --target install -j "${BUILD_JOBS}" > build.log 2>&1 || tail_excerpt build.log + echo "done." + echo "==========================================================" + + # Export variable for CMake options to cp2k_env file + cat << EOF > "${CMAKE_INSTALL_PREFIX}/cp2k_env" +#!/bin/bash +export CP2K_ROOT="${CP2K_ROOT}" +source ${TOOLCHAIN_INSTALL_DIR}/setup +prepend_path PATH "${CP2K_ROOT}/install/bin" +prepend_path LD_LIBRARY_PATH "${CP2K_ROOT}/install/lib" +prepend_path PKG_CONFIG_PATH "${CP2K_ROOT}/install/lib/pkgconfig" +EOF + cat << EOF +Done! Installed binaries are now available in: ${CP2K_ROOT}/install/bin + +It's suggested to run regtests after installation: + ${CP2K_ROOT}/tests/do_regtest.py ${CMAKE_INSTALL_PREFIX}/bin psmp +Run \`${CP2K_ROOT}/tests/do_regtest.py --help\` for help message. + +Please always source this script to load CP2K environment before running CP2K: + source ${CMAKE_INSTALL_PREFIX}/cp2k_env + +If you want to clean the build cache (except cached CMake files) after +installation, run: + cmake --build "${BUILD_DIR}" --target clean +EOF +else + cat << EOF +Since you run this script with \"--dry-run\", it now exits. +To build CP2K, drop off this flag and re-run this script. +EOF +fi + +#EOF diff --git a/tools/toolchain/install_cp2k_toolchain.sh b/tools/toolchain/install_cp2k_toolchain.sh index 99d13c8210..375cd4ea9a 100755 --- a/tools/toolchain/install_cp2k_toolchain.sh +++ b/tools/toolchain/install_cp2k_toolchain.sh @@ -1,8 +1,9 @@ #!/bin/bash -e # Disabled shellcheck items: SC1091 for external scripts, SC2034 for unused -# variables, SC2124 for concatenating toolchain options with $@ -# shellcheck disable=SC1091,SC2034,SC2124 +# variables, SC2124 for concatenating toolchain options with $@, SC2129 for +# individual redirects ">>". +# shellcheck disable=SC1091,SC2034,SC2124,SC2129 [ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0 SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")" && pwd -P)" @@ -32,6 +33,7 @@ export SCRIPTDIR="${ROOTDIR}/scripts" export BUILDDIR="${ROOTDIR}/build" export INSTALLDIR="${ROOTDIR}/install" export SETUPFILE="${INSTALLDIR}/setup" +export TOOLKIT_SCRIPT="${SCRIPTDIR}/tool_kit.sh" # ------------------------------------------------------------------------ # Make a copy of all options for $SETUPFILE @@ -85,6 +87,9 @@ OPTIONS: If omitted, the script will automatically try to determine the number of available processors and use all of them by default. + --install-dir Set the directory you want to installed toolchain + dependencies to. Default is the "install" directory + in current path. --no-check-certificate Bypass verification of server's certificate while downloading anything from internet via wget command. In case wget errors about "certificate verification" @@ -553,7 +558,6 @@ else fi # default enable options -list_cmake_options="__TRUE__" dry_run="__FALSE__" enable_tsan="__FALSE__" enable_opencl="__FALSE__" @@ -619,6 +623,16 @@ while [ $# -ge 1 ]; do -j[0-9]*) export NPROCS_OVERWRITE="${1#-j}" ;; + --install-dir=*) + if [[ "${1#--install-dir=}" != /* ]]; then + report_error "The path for --install-dir must be an absolute path." + exit 1 + fi + export INSTALLDIR="${1#--install-dir=}" + export SETUPFILE="${INSTALLDIR}/setup" + cp "${SCRIPTDIR}"/tool_kit.sh "${INSTALLDIR}"/ + export TOOLKIT_SCRIPT="${INSTALLDIR}/tool_kit.sh" + ;; --no-check-certificate) export DOWNLOADER_FLAGS="--no-check-certificate" ;; @@ -719,13 +733,6 @@ Otherwise use option no." --dry-run) dry_run="__TRUE__" ;; - --list-cmake-options*) - list_cmake_options=$(read_enable "${1}") - if [ "${list_cmake_options}" = "__INVALID__" ]; then - report_error "invalid value for --list-cmake-options, please use yes or no" - exit 1 - fi - ;; --enable-tsan*) enable_tsan=$(read_enable "${1}") if [ "${enable_tsan}" = "__INVALID__" ]; then @@ -1260,11 +1267,17 @@ fi # Installing tools required for building CP2K and associated libraries # ------------------------------------------------------------------------ +# Write toolchain configurations +cat << EOF > "${ROOTDIR}/toolchain_settings" +#!/bin/bash +export TOOLCHAIN_INSTALL_DIR="${INSTALLDIR}" +export CP2K_TOOLCHAIN_OPTIONS="${TOOLCHAIN_OPTIONS}" +EOF + # Write head of setup file cat << EOF > "$SETUPFILE" #!/bin/bash -source "${SCRIPTDIR}/tool_kit.sh" -export CP2K_TOOLCHAIN_OPTIONS="${TOOLCHAIN_OPTIONS}" +source "${TOOLKIT_SCRIPT}" EOF # Write toolchain environment @@ -1272,7 +1285,13 @@ write_toolchain_env "${INSTALLDIR}" # Write toolchain config echo "tool_list=\"${tool_list}\"" > "${INSTALLDIR}"/toolchain.conf -echo "dry_run=\"${dry_run}\"" >> "${INSTALLDIR}"/toolchain.conf +echo "mpi_mode=\"${MPI_MODE}\"" >> "${INSTALLDIR}"/toolchain.conf +echo "enable_cuda=\"${ENABLE_CUDA}\"" >> "${INSTALLDIR}"/toolchain.conf +echo "enable_hip=\"${ENABLE_HIP}\"" >> "${INSTALLDIR}"/toolchain.conf +echo "enable_opencl=\"${ENABLE_OPENCL}\"" >> "${INSTALLDIR}"/toolchain.conf +if [ "${ENABLE_CUDA}" == "__TRUE__" ] || [ "${ENABLE_HIP}" == "__TRUE__" ]; then + echo "gpu_ver=\"${GPUVER}\"" >> "${INSTALLDIR}"/toolchain.conf +fi for ii in ${package_list}; do install_mode=$(eval "echo \${with_${ii}}") echo "with_${ii}=\"${install_mode}\"" >> "${INSTALLDIR}"/toolchain.conf @@ -1314,9 +1333,18 @@ else "${SCRIPTDIR}"/stage7/install_stage7.sh "${SCRIPTDIR}"/stage8/install_stage8.sh "${SCRIPTDIR}"/stage9/install_stage9.sh + echo + cat << EOF +========================== Epilogue ========================= +Done! To build CP2K with dependencies you installed via toolchain, simply run +this script: + + ./build_cp2k.sh -j $(get_nprocs) + +It will source the file "install/setup", generate proper CMake flags based on +toolchain options, and then build and install CP2K. For available options +with the script, run "./build_cp2k.sh -h". +EOF fi -# Generate CMake options -if [ "${list_cmake_options}" = "__TRUE__" ]; then - "${SCRIPTDIR}"/generate_cmake_options.sh -fi +#EOF diff --git a/tools/toolchain/scripts/generate_cmake_options.sh b/tools/toolchain/scripts/generate_cmake_options.sh deleted file mode 100755 index 2f2894a5d4..0000000000 --- a/tools/toolchain/scripts/generate_cmake_options.sh +++ /dev/null @@ -1,240 +0,0 @@ -#!/bin/bash -e - -# TODO: Review and if possible fix shellcheck errors. -# shellcheck disable=all - -[ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0 -SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")" && pwd -P)" - -source "${SCRIPT_DIR}"/common_vars.sh -source "${SCRIPT_DIR}"/tool_kit.sh -source "${SCRIPT_DIR}"/signal_trap.sh -source "${INSTALLDIR}"/toolchain.conf -source "${INSTALLDIR}"/toolchain.env - -# This script assumes a working environment as follows: -# cp2k <- variable ${CP2K_ROOT}; CMake option -S -# ├── CMakeLists.txt <- * file to be parsed in this script -# ├── data <- CP2K data directory; CMake option -DCP2K_DATA_DIR -# ├── build <- to-be-created; CMake option -B -# ├── install <- to-be-created; CMake option -DCMAKE_INSTALL_PREFIX -# ├── src <- CP2K source code directory -# └── tools -# └── toolchain <- working directory; variable ${ROOTDIR} -# ├── install_cp2k_toolchain.sh <- script being executed calling this script -# ├── scripts <- variable ${SCRIPT_DIR} -# │ ├── common_vars.sh -# │ ├── tool_kit.sh -# │ └── generate_cmake_options.sh <- this script -# └── install <- variable ${INSTALLDIR} -# ├── setup <- * file to be parsed in this script -# ├── toolchain.conf <- * file to be parsed in this script -# └── toolchain.env <- * file to be parsed in this script -# -# First, validate completion of relevant upper-level directory and file -printf "\n========================== %s =========================\n" \ - "Generating CMake options for building CP2K" -CP2K_ROOT=$(cd "${ROOTDIR}/../.." && pwd) -if [ -d "${CP2K_ROOT}/src" ]; then - cat << EOF -Root directory of CP2K with source code is found as ${CP2K_ROOT} -(path is exported to variable \${CP2K_ROOT}). -Build directory will be \${CP2K_ROOT}/build. -Install directory will be \${CP2K_ROOT}/install. -EOF - CMAKE_OPTIONS="-DCMAKE_INSTALL_PREFIX=./install" -else - report_error ${LINENO} "\${CP2K_ROOT} does not have subdirectory src." - return 1 -fi -if [ -f "${CP2K_ROOT}/CMakeLists.txt" ] && [ -r "${CP2K_ROOT}/CMakeLists.txt" ]; then - echo "\${CP2K_ROOT}/CMakeLists.txt exists; will be parsed for CMake options." -else - report_error ${LINENO} "\${CP2K_ROOT}/CMakeLists.txt cannot be found or read." - return 1 -fi -if [ -d "${CP2K_ROOT}/data" ]; then - echo "Data directory ${CP2K_ROOT}/data is found and set as CP2K_DATA_DIR." - CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCP2K_DATA_DIR=${CP2K_ROOT}/data" -else - report_error ${LINENO} "Data directory \${CP2K_ROOT}/data cannot be found." -fi - -# ------------------------------------------------------------------------ -# generate cmake options for compiling cp2k -# ------------------------------------------------------------------------ -# Build the program in source tree for convenience -if [ -n "$(grep -- "--install-all" ${INSTALLDIR}/setup)" ]; then - CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCP2K_USE_EVERYTHING=ON -DCP2K_USE_DLAF=OFF -DCP2K_USE_PEXSI=OFF" - # Since "--install-all" can be used together with "--with-PKG=no", an extra safeguard is added here - for toolchain_option in $(grep -i "dontuse" ${INSTALLDIR}/toolchain.conf | grep -vi "gcc" | cut -d'_' -f2 | cut -d'=' -f1); do - if [ $(eval echo "$with_"'$toolchain_option') != "__DONTUSE__" ]; then - ADDED_CMAKE_OPTION=$(sed -n '/option(/,/)/p' ${CP2K_ROOT}/CMakeLists.txt | grep -i $toolchain_option | awk '{print $1}' | cut -d'(' -f2 | head -n 1) - # Use "if-then" below can avoid generating empty "-D=OFF" options - if [ -n "${ADDED_CMAKE_OPTION}" ]; then - CMAKE_OPTIONS="${CMAKE_OPTIONS} -D${ADDED_CMAKE_OPTION}=OFF" - fi - fi - done -else - # If MPI is used, set "CP2K_USE_MPI" to "ON" - if [ "${MPI_MODE}" != "no" ]; then - CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCP2K_USE_MPI=ON" - if [ -n "$(grep "MPI_F08" "${INSTALLDIR}"/toolchain.env)" ]; then - CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCP2K_USE_MPI_F08=ON" - fi - fi - # If GPU acceleration is used, add the option about GPU acceleration - if [ "${ENABLE_CUDA}" = "__TRUE__" ]; then - CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCP2K_USE_ACCEL=CUDA -DCP2K_WITH_GPU=${GPUVER}" - elif [ "${ENABLE_HIP}" = "__TRUE__" ]; then - CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCP2K_USE_ACCEL=HIP -DCP2K_WITH_GPU=${GPUVER}" - elif [ "${ENABLE_OPENCL}" = "__TRUE__" ]; then - CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCP2K_USE_ACCEL=OPENCL" - fi - # Some options that should be specially considered: - # Intel MKL includes FFTW - if [ "${with_fftw}" != "__DONTUSE__" ] || [ "${MATH_MODE}" = "mkl" ]; then - CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCP2K_USE_FFTW3=ON" - fi - # There is only MCL (MiMiC Communication Library) and no MiMiC that can be installed via toolchain, but if one chooses to install MCL then MiMiC should have been installed? - if [ "${with_mcl}" != "__DONTUSE__" ]; then - CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCP2K_USE_MIMIC=ON" - fi - # Detect if any other dependencies is used and add the proper cmake option. Since "pugixml" and "gsl" are not mentioned in CMakeLists.txt, they will not be considered. - for toolchain_option in $(grep -vi "dry\|list\|dontuse\|gcc\|cmake\|fftw\|mkl\|dbcsr" ${INSTALLDIR}/toolchain.conf | cut -d'_' -f2 | cut -d'=' -f1); do - if [ $(eval echo "$with_"'$toolchain_option') != "__DONTUSE__" ]; then - ADDED_CMAKE_OPTION=$(sed -n '/option(/,/)/p' ${CP2K_ROOT}/CMakeLists.txt | grep -i $toolchain_option | awk '{print $1}' | cut -d'(' -f2 | head -n 1) - # Use "if-then" below can avoid generating empty "-D=ON" options - if [ -n "${ADDED_CMAKE_OPTION}" ]; then - CMAKE_OPTIONS="${CMAKE_OPTIONS} -D${ADDED_CMAKE_OPTION}=ON" - fi - fi - done -fi - -# Export variable for CMake options to setup file -cat << EOF >> "${SETUPFILE}" -# ==================== Setup for CP2K ==================== # -export CP2K_ROOT="${CP2K_ROOT}" -export CP2K_CMAKE_OPTIONS="${CMAKE_OPTIONS}" -prepend_path PATH "${CP2K_ROOT}/install/bin" -prepend_path LD_LIBRARY_PATH "${CP2K_ROOT}/install/lib" -prepend_path PKG_CONFIG_PATH "${CP2K_ROOT}/install/lib/pkgconfig" -EOF -if [ "${dry_run}" = "__TRUE__" ]; then - cat << EOF - -Suggested cmake command if toolchain is built with your options: - - cmake ${CMAKE_OPTIONS} -EOF -else - cat << EOF - -Suggested CMake options are collected in the variable \${CP2K_CMAKE_OPTIONS} that is -exported at the end of setup file ${SETUPFILE}. -EOF -fi - -# ------------------------- -# print out user instructions -# ------------------------- -if [ "${dry_run}" != "__TRUE__" ]; then - echo - cat << EOF -========================== Epilogue ========================= -Toolchain is now ready for building CP2K! - -To use the installed tools and libraries and cp2k version compiled with it you -will first need to execute at the prompt: - - source ${SETUPFILE} - -Then it's recommended for you to build and install CP2K with following commands: - - cd ${CP2K_ROOT} - cmake -S . -B build ${CMAKE_OPTIONS} - cmake --build build --target install -j $(get_nprocs) - -For more information about available build options, see: -https://manual.cp2k.org/trunk/getting-started/build-from-source.html - -For detailed explanation of above steps of building CP2K, see: -${INSTALLDIR}/cp2k_installation_guide.md - -EOF - cat << EOF > ${INSTALLDIR}/cp2k_installation_guide.md -## Building CP2K with dependencies installed in toolchain - -Here is a detailed instruction of building CP2K with dependencies installed via toolchain. - -### Required - commands you must execute or the building fails - -1. Source setup file to activate toolchain-configured dependencies: - -\`\`\`bash -source ${SETUPFILE} -\`\`\` - -This setup file **MUST** also be sourced whenever CP2K built with this toolchain is executed. -If modules have been used to estabilish environment variables and paths, remember to load -these modules prior to sourcing setup file. - -2. Go to root directory of CP2K and configure CMake with corresponding options: - -\`\`\`bash -cd ${CP2K_ROOT} -cmake -S . -B build ${CMAKE_OPTIONS} -\`\`\` - -Other commands from \`${CP2K_ROOT}/CMakeLists.txt\` can also be added. For more information -about available build options, see documentation: -. - -Alternative to copy-paste long lines in terminal is to use a variable from setup file for -CMake options, which is not to be quoted so that whitespace delimiters allow it to expand -to command options in shell: - -\`\`\`bash -cmake -S . -B build \${CP2K_CMAKE_OPTIONS} -\`\`\` - -3. Build and install CP2K with command: - -\`\`\`bash -cmake --build build --target install -j $(get_nprocs) -\`\`\` - -It may be helpful to also save a copy of command line messages to log files: - -\`\`\`bash -cmake --build build --target install -j $(get_nprocs) 2>&1 | tee install.log -\`\`\` - -If you want another build of CP2K without changing toolchain configuration, simply change -the building directory set by \`-B \` in the cmake command above. - -### Optional but recommended - -At the ending of the output of step 3, CP2K will give you a command that can be used to -do regtests, which can further ensure if you have built CP2K correctly. You can perform -the regtests with that command. You can run -\`${CP2K_ROOT}/tests/do_regtest.py --help\` -to see available options. For a detailed instruction of how to run regtests (especially -on HPC clusters), see: -. - -### Other optional behaviors - -Both for toolchain buildings and CP2K building: once build is completed, the \`build\` -directory can be safely deleted. However, you **MUST** keep the \`install\` directory -as is. - -Especially, if you want to save disk space but at the same time keep the cached CMake -files, you can run \`cmake --build build --target clean\` alternatively after installing -successfully. -EOF -fi - -#EOF diff --git a/tools/toolchain/scripts/stage9/install_dbcsr.sh b/tools/toolchain/scripts/stage9/install_dbcsr.sh index db9d595865..d941a61900 100755 --- a/tools/toolchain/scripts/stage9/install_dbcsr.sh +++ b/tools/toolchain/scripts/stage9/install_dbcsr.sh @@ -44,10 +44,7 @@ case "${with_dbcsr}" in if [ "${MPI_MODE}" == "no" ]; then CMAKE_OPTIONS="${CMAKE_OPTIONS} -DUSE_MPI=OFF" else - CMAKE_OPTIONS="${CMAKE_OPTIONS} -DUSE_MPI=ON" - if [ -n "$(grep "MPI_F08" "${INSTALLDIR}"/toolchain.env)" ]; then - CMAKE_OPTIONS="${CMAKE_OPTIONS} -DUSE_MPI_F08=ON" - fi + CMAKE_OPTIONS="${CMAKE_OPTIONS} -DUSE_MPI=ON -DUSE_MPI_F08=ON" fi cmake \ -DCMAKE_INSTALL_PREFIX=${pkg_install_dir} \