mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-21 14:35:15 -04:00
Compare commits
3 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b3fd3beb9 | ||
|
|
67126483bc | ||
|
|
6608d10a9a |
4564 changed files with 134579 additions and 567542 deletions
|
|
@ -1,7 +1,6 @@
|
|||
exe
|
||||
lib
|
||||
obj
|
||||
build
|
||||
regtesting
|
||||
tools/toolchain/install
|
||||
tools/toolchain/build
|
||||
|
|
@ -10,6 +9,3 @@ docs/CP2K_INPUT
|
|||
.git*
|
||||
*~
|
||||
\#*\#
|
||||
/install
|
||||
/spack
|
||||
/spack_cache
|
||||
|
|
|
|||
5
.gitattributes
vendored
5
.gitattributes
vendored
|
|
@ -1,4 +1,5 @@
|
|||
CODEOWNERS export-ignore
|
||||
.gitattributes export-ignore
|
||||
.git-blame-ignore-revs export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.pre-commit-config.yaml export-ignore
|
||||
.github/** export-ignore
|
||||
|
|
|
|||
20
.gitignore
vendored
20
.gitignore
vendored
|
|
@ -1,16 +1,18 @@
|
|||
# base directory structure
|
||||
/bin/
|
||||
/build*/
|
||||
/doxygen/
|
||||
/exe/
|
||||
/install*/
|
||||
/lib/
|
||||
/obj/
|
||||
/bin/
|
||||
/doxygen/
|
||||
/regtesting/
|
||||
/install/
|
||||
|
||||
# ignore former git submodules
|
||||
/tools/prettify/fprettify
|
||||
|
||||
# ignore local arch files not meant to be shared
|
||||
/arch/local*
|
||||
|
||||
# ensure people are not accidentally committing an old .svnignore when copying their stuff
|
||||
.svnignore
|
||||
|
||||
|
|
@ -97,8 +99,6 @@ build*/
|
|||
|
||||
# Spack
|
||||
build-*
|
||||
.spack_patched
|
||||
/spack*/
|
||||
|
||||
### CMake Patch ###
|
||||
# External projects
|
||||
|
|
@ -183,8 +183,6 @@ flycheck_*.el
|
|||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
# venv
|
||||
docs_venv/
|
||||
|
||||
# C extensions
|
||||
|
||||
|
|
@ -257,7 +255,6 @@ docs/bibliography.md
|
|||
docs/cp2k_input.xml
|
||||
docs/references.html
|
||||
docs/units.html
|
||||
docs/units.md
|
||||
|
||||
# PyBuilder
|
||||
.pybuilder/
|
||||
|
|
@ -315,7 +312,6 @@ venv/
|
|||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
.envrc
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
|
|
@ -374,7 +370,3 @@ tags
|
|||
# End of https://www.gitignore.io/api/python,fortran,c,c++,cuda,emacs,vim,cmake
|
||||
|
||||
!tools/fedora/cp2k.spec
|
||||
|
||||
# CLion directories
|
||||
/.idea/
|
||||
/cmake-build-*
|
||||
|
|
|
|||
4
.gitmodules
vendored
Normal file
4
.gitmodules
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
[submodule "exts/dbcsr"]
|
||||
path = exts/dbcsr
|
||||
url = https://github.com/cp2k/dbcsr
|
||||
branch = master
|
||||
|
|
@ -20,6 +20,7 @@ test_command:
|
|||
default_identifier: smoke
|
||||
|
||||
targets:
|
||||
# TODO: Match F40 release
|
||||
- fedora-development-x86_64
|
||||
- fedora-development-aarch64
|
||||
- fedora-latest-x86_64
|
||||
|
|
@ -35,6 +36,7 @@ jobs:
|
|||
trigger: commit
|
||||
branch: master
|
||||
project: nightly
|
||||
update_release: true
|
||||
- &tests
|
||||
job: tests
|
||||
trigger: commit
|
||||
|
|
|
|||
1373
CMakeLists.txt
1373
CMakeLists.txt
File diff suppressed because it is too large
Load diff
73
CODEOWNERS
73
CODEOWNERS
|
|
@ -1,73 +0,0 @@
|
|||
# Top-level files
|
||||
/* @cp2k/cp2k-admins
|
||||
|
||||
# Data
|
||||
/data/ @mkrack @juerghutter
|
||||
|
||||
# CMake
|
||||
/cmake/ @mkrack @mtaillefumier @RMeli
|
||||
/CMakeLists.txt @mkrack @mtaillefumier @RMeli
|
||||
|
||||
# Spack
|
||||
/tools/spack/ @mkrack @mtaillefumier @RMeli
|
||||
/make_cp2k.sh @mkrack @mtaillefumier @RMeli
|
||||
|
||||
# Toolchain
|
||||
/tools/toolchain/ @mkrack @oschuett
|
||||
|
||||
# Testing + Conventions
|
||||
/tools/conventions/ @mkrack @oschuett
|
||||
/tools/precommit/ @mkrack @oschuett
|
||||
/tools/dashboard/ @mkrack @oschuett
|
||||
/tools/docker/ @mkrack @oschuett
|
||||
|
||||
# Load bearing APIs and files
|
||||
/src/fm/ @fstein93 @oschuett
|
||||
/src/pw/ @fstein93 @oschuett
|
||||
/src/pw_env/ @fstein93 @oschuett
|
||||
/src/mpiwrap/ @fstein93 @oschuett
|
||||
/src/dbm/ @fstein93 @oschuett
|
||||
/src/dbt/ @fstein93 @oschuett
|
||||
/src/dbx/ @fstein93 @oschuett
|
||||
/src/base/ @fstein93 @oschuett
|
||||
/src/start/ @fstein93 @oschuett
|
||||
/src/f77_interface.F @fstein93 @oschuett
|
||||
/tests/do_regtest.py @fstein93 @oschuett
|
||||
/tests/matcher_classes.py @fstein93 @oschuett
|
||||
|
||||
# Offload + Grid
|
||||
/src/offload/ @mtaillefumier @oschuett
|
||||
/src/grid/ @mtaillefumier @oschuett
|
||||
|
||||
# SIRIUS
|
||||
/src/sirius_interface.F @mtaillefumier @RMeli
|
||||
/src/*pwdft* @mtaillefumier @RMeli
|
||||
|
||||
# DLA-Future
|
||||
/src/fm/*dlaf* @RMeli @mtaillefumier
|
||||
|
||||
# PAO
|
||||
/src/pao_* @oschuett
|
||||
/tools/pao-ml/ @oschuett
|
||||
|
||||
# Path integrals and NNP
|
||||
/src/motion/pint_* @hforbert
|
||||
/src/motion/helium_* @hforbert
|
||||
/src/nnp_* @hforbert
|
||||
|
||||
# Dispersion + tblite
|
||||
/src/qs_dispersion_* @jpoto
|
||||
/src/tblite_* @jpoto
|
||||
|
||||
# NEGF
|
||||
/src/negf_* @dryndyk
|
||||
|
||||
# Post Hartree-Fock
|
||||
/src/mp2_* @JWilhelm @fstein93
|
||||
/src/rpa_* @JWilhelm @fstein93
|
||||
/src/gw_* @JWilhelm @fstein93
|
||||
|
||||
# Post SCF
|
||||
/src/qs_scf_post_* @marci73 @juerghutter
|
||||
|
||||
#EOF
|
||||
|
|
@ -1 +0,0 @@
|
|||
./docs/development/onboarding.md
|
||||
628
INSTALL.md
628
INSTALL.md
|
|
@ -10,33 +10,8 @@ For more details on downloading CP2K, see <https://www.cp2k.org/download>.
|
|||
|
||||
## 2. Install prerequisites
|
||||
|
||||
### Method 1: make_cp2k.sh
|
||||
|
||||
The easiest way to build CP2K with its dependencies is via the `make_cp2k.sh` script, which builds
|
||||
CP2K using Spack and CMake locally within the CP2K_ROOT folder.
|
||||
|
||||
The script can either be sourced with:
|
||||
|
||||
```shell
|
||||
source ./make_cp2k.sh
|
||||
```
|
||||
|
||||
or run in a subshell with:
|
||||
|
||||
```shell
|
||||
./make_cp2k.sh
|
||||
```
|
||||
|
||||
You can run the following command to get information about how to use this script:
|
||||
|
||||
```shell
|
||||
./make_cp2k.sh --help
|
||||
```
|
||||
|
||||
Note: it is recommended to install podman to take advantage of a spack cache. This will accelerate
|
||||
the build of the CP2K dependencies with Spack significantly.
|
||||
|
||||
### Method 2: Toolchain
|
||||
The easiest way to build CP2K with all its dependencies is as a
|
||||
[Docker container](./tools/docker/README.md).
|
||||
|
||||
Alternatively, the [toolchain script](./tools/toolchain/install_cp2k_toolchain.sh) can also be run
|
||||
directly.
|
||||
|
|
@ -52,45 +27,598 @@ cd tools/toolchain/
|
|||
./install_cp2k_toolchain.sh --help
|
||||
```
|
||||
|
||||
CP2K supports GPU acceleration via CUDA (for NVIDIA GPUs), HIP/ROCm (for AMD GPUs), and OpenCL (for
|
||||
a range of devices). If you wish to build with GPU support, please see the
|
||||
[manual](https://manual.cp2k.org/trunk/technologies/accelerators/index.html).
|
||||
|
||||
- Launch toolchain script (example option choice for NVIDIA/CUDA):
|
||||
- Launch toolchain script (example option choice)
|
||||
|
||||
```shell
|
||||
./install_cp2k_toolchain.sh --with-libxsmm=install --with-openblas=system \
|
||||
--with-fftw=system --enable-cuda
|
||||
--with-fftw=system --with-reflapack=no --enable-cuda
|
||||
```
|
||||
|
||||
- For AMD/ROCm/HIP support, use:
|
||||
- Once the script has completed successfully, follow the instructions given at the end of its
|
||||
output. Note that the pre-built arch files provided by the toolchain are for the GNU compiler,
|
||||
users must adapt them for other compilers. It is possible to use the provided [arch files](./arch)
|
||||
as guidance.
|
||||
|
||||
There are [arch files](./arch) for a few specific platforms (e.g.
|
||||
[Linux-gnu-x86_64](./arch/Linux-gnu-x86_64.psmp),
|
||||
[Linux-intel-x86_64](./arch/Linux-intel-x86_64.psmp)) which include a toolchain build. Sourcing such
|
||||
an arch file in the cp2k folder launches a toolchain build, e.g.
|
||||
|
||||
```
|
||||
source ./arch/Linux-gnu-x86_64.psmp
|
||||
```
|
||||
|
||||
After a successful toolchain build, run one of the suggested `make` commands
|
||||
|
||||
```
|
||||
make -j ARCH=Linux-gnu-x86_64 VERSION=psmp
|
||||
```
|
||||
|
||||
Check also the corresponding [HowTos](https://www.cp2k.org/howto/) for
|
||||
[Apple M1 (macOS)](https://www.cp2k.org/howto:compile_on_macos/) and
|
||||
[Cray XC40/50 (Piz Daint, CSCS)](https://www.cp2k.org/howto:compile_on_cray_cscs/).
|
||||
|
||||
Sub-points here discuss prerequisites needed to build CP2K. Copies of the recommended versions of
|
||||
3rd party software can be downloaded from <https://www.cp2k.org/static/downloads/>.
|
||||
|
||||
Generally, CP2K supports only one version for each of its dependencies. These are defined by the
|
||||
[toolchain scripts](./tools/toolchain/scripts/). Other versions might work too, but we don't test
|
||||
them. So, your mileage may vary.
|
||||
|
||||
### 2a. GNU make (required, build system)
|
||||
|
||||
GNU make should be on your system (gmake or make on linux) and used for the build, go to
|
||||
<https://www.gnu.org/software/make/make.html> download from <https://ftp.gnu.org/pub/gnu/make/>.
|
||||
|
||||
### 2b. Python (required, build system)
|
||||
|
||||
Python 3.5+ is needed to run the dependency generator. On most system Python is already installed.
|
||||
For more information visit: <https://www.python.org>
|
||||
|
||||
### 2c. Fortran and C Compiler (required, build system)
|
||||
|
||||
A Fortran 2008 compiler and matching C99 compiler should be installed on your system. We have good
|
||||
experience with gcc/gfortran (gcc >=4.6 works, later version recommended). Be aware that some
|
||||
compilers have bugs that might cause them to fail (internal compiler errors, segfaults) or, worse,
|
||||
yield a mis-compiled CP2K. Report bugs to compiler vendors; they (and we) have an interest in fixing
|
||||
them. A list of tested compiler can be found [here](https://www.cp2k.org/dev:compiler_support).
|
||||
Always run a `make -j test` (See point 5.) after compilation to identify these problems.
|
||||
|
||||
### 2d. BLAS and LAPACK (required, base functionality)
|
||||
|
||||
BLAS and LAPACK should be installed. Using vendor-provided libraries can make a very significant
|
||||
difference (up to 100%, e.g., ACML, MKL, ESSL), not all optimized libraries are bug free. Use the
|
||||
latest versions available, use the interfaces matching your compiler, and download all patches!
|
||||
|
||||
- The canonical BLAS and LAPACK can be obtained from the Netlib repository:
|
||||
- <http://www.netlib.org/blas/>
|
||||
- <http://www.netlib.org/lapack/> and see also
|
||||
- <http://www.netlib.org/lapack-dev/>
|
||||
- Open fast alternatives, include:
|
||||
- <http://www.openblas.net>
|
||||
- <http://math-atlas.sourceforge.net>
|
||||
- <https://www.tacc.utexas.edu/research-development/tacc-software/gotoblas2>
|
||||
|
||||
Please note that the BLAS/LAPACK implementation used by CP2K needs to be thread-safe (OpenMP).
|
||||
Examples are the sequential variant of the Intel MKL, the Cray libsci, the OpenBLAS OpenMP variant
|
||||
and the reference BLAS/LAPACK packages. If compiling with MKL, users must define `-D__MKL` to ensure
|
||||
the code is thread-safe. MKL with multiple OpenMP threads in CP2K requires that CP2K was compiled
|
||||
with the Intel compiler. If the `cpp` precompiler is used in a separate precompilation step in
|
||||
combination with the Intel Fortran compiler, `-D__INTEL_COMPILER` must be added explicitly (the
|
||||
Intel compiler sets `__INTEL_COMPILER` otherwise automatically).
|
||||
|
||||
On the Mac, BLAS and LAPACK may be provided by Apple's Accelerate framework. If using this
|
||||
framework, `-D__ACCELERATE` must be defined to account for some interface incompatibilities between
|
||||
Accelerate and reference BLAS/LAPACK.
|
||||
|
||||
When building on/for Windows using the Minimalist GNU for Windows (MinGW) environment, you must set
|
||||
`-D__MINGW`, `-D__NO_STATM_ACCESS` and `-D__NO_SOCKETS` to avoid undefined references during
|
||||
linking, respectively errors while printing the statistics.
|
||||
|
||||
### 2e. MPI and ScaLAPACK (optional, required for MPI parallel builds)
|
||||
|
||||
MPI (version 3) and SCALAPACK are needed for parallel code. (Use the latest versions available and
|
||||
download all patches!).
|
||||
|
||||
:warning: Note that your MPI installation must match the used Fortran compiler. If your computing
|
||||
platform does not provide MPI, there are several freely available alternatives:
|
||||
|
||||
- MPICH2 MPI: <http://www-unix.mcs.anl.gov/mpi/mpich/> (may require `-fallow-argument-mismatch` when
|
||||
building with GCC 10)
|
||||
- OpenMPI MPI: <http://www.open-mpi.org/>
|
||||
- ScaLAPACK:
|
||||
- <http://www.netlib.org/scalapack/>
|
||||
- <http://www.netlib.org/lapack-dev/>
|
||||
- ScaLAPACK can be part of ACML or cluster MKL. These libraries are recommended if available.
|
||||
- Recently a [ScaLAPACK installer](http://www.netlib.org/scalapack/scalapack_installer.tgz) has
|
||||
been added that simplifies the installation.
|
||||
|
||||
CP2K assumes that the MPI library implements MPI version 3. Older versions of MPI (e.g., MPI 2.0)
|
||||
are not supported and the old flag `-D__MPI_VERSION` in the arch file will be ignored. CP2K can make
|
||||
use of the mpi_f08 module. If its use is requested, set the flag `-D__MPI_F08`.
|
||||
|
||||
### 2f. FFTW (optional, improved performance of FFTs)
|
||||
|
||||
FFTW can be used to improve FFT speed on a wide range of architectures. It is strongly recommended
|
||||
to install and use FFTW3. The current version of CP2K works with FFTW 3.X (use `-D__FFTW3`). It can
|
||||
be downloaded from <http://www.fftw.org>
|
||||
|
||||
FFTW is also provided by MKL. Use `-D__FFTW3_MKL` to use the correct import path.
|
||||
|
||||
:warning: Note that FFTW must know the Fortran compiler you will use in order to install properly
|
||||
(e.g., `export F77=gfortran` before configure if you intend to use gfortran).
|
||||
|
||||
:warning: Note that on machines and compilers which support SSE you can configure FFTW3 with
|
||||
`--enable-sse2`. Compilers/systems that do not align memory (NAG f95, Intel IA32/gfortran) should
|
||||
either not use `--enable-sse2` or otherwise set the define `-D__FFTW3_UNALIGNED` in the arch file.
|
||||
Since CP2K is OpenMP parallelized, the FFTW3 threading library libfftw3_threads (or libfftw3_omp) is
|
||||
required.
|
||||
|
||||
### 2g. LIBINT (optional, enables methods including HF exchange)
|
||||
|
||||
- Hartree-Fock exchange (optional, use `-D__LIBINT`) requires the LIBINT package to be installed.
|
||||
- Recommended way to build LIBINT: Download a CP2K-configured LIBINT library from
|
||||
[libint-cp2k](https://github.com/cp2k/libint-cp2k). Build and install LIBINT by following the
|
||||
instructions provided there. Note that using a library configured for higher maximum angular
|
||||
momentum will increase build time and binary size of CP2K executable (assuming static linking).
|
||||
- CP2K is not hardwired to these provided libraries and any other LIBINT library (version >= 2.5.0)
|
||||
should be compatible as long as it was compiled with `--enable-eri=1` and default ordering.
|
||||
- Avoid debugging information (`-g` flag) for compiling LIBINT since this will increase library size
|
||||
by a large factor.
|
||||
- In the arch file of CP2K: add `-D__LIBINT` to the `DFLAGS`. Add
|
||||
`-L$(LIBINT_DIR)/lib -lint2 -lstdc++` to `LIBS` and `-I$(LIBINT_DIR)/include` to `FCFLAGS`.
|
||||
`lstdc++` is needed if you use the GNU C++ compiler.
|
||||
- Libint 1 is no longer supported and the previously needed flags `-D__LIBINT_MAX_AM` and
|
||||
`-D__LIBDERIV_MAX_AM1` are ignored.
|
||||
- `-D__MAX_CONTR=4` (default=2) can be used to compile efficient contraction kernels up to l=4, but
|
||||
the build time will increase accordingly.
|
||||
|
||||
### 2h. LIBXSMM (optional, improved performance for matrix multiplication)
|
||||
|
||||
- A library for matrix operations and deep learning primitives: <https://github.com/hfp/libxsmm/>.
|
||||
- Add `-D__LIBXSMM` to enable it, with suitable include and library paths, e.g.,
|
||||
`FCFLAGS += -I${LIBXSMM_DIR}/include -D__LIBXSMM` and
|
||||
`LIBS += -L${LIBXSMM_DIR}/lib -lxsmmf -lxsmm -ldl`
|
||||
- LIBSMM is not used if LIBXSMM is enabled.
|
||||
|
||||
### 2i. CUDA (optional, improved performance on GPU systems)
|
||||
|
||||
- Specify OFFLOAD_CC (e.g., `OFFLOAD_CC = nvcc`) and OFFLOAD_FLAGS (e.g.,
|
||||
`OFFLOAD_FLAGS = -O3 -g -w --std=c++11`) variables. Remember to include the support for the C++11
|
||||
standard.
|
||||
- Use `-D__OFFLOAD_CUDA` to generally enable support for Nvidia GPUs
|
||||
- Use the `-D__DBCSR_ACC` and `OFFLOAD_TARGET = cuda` to enable accelerator support for matrix
|
||||
multiplications.
|
||||
- Add `-lstdc++ -lcudart -lnvrtc -lcuda -lcublas` to LIBS.
|
||||
- Specify the GPU type (e.g., `GPUVER = P100`), possible values are K20X, K40, K80, P100, V100,
|
||||
A100, H100, A40.
|
||||
- Specify the C++ compiler (e.g., `CXX = g++`) and the CXXFLAGS to support the C++11 standard.
|
||||
- CUFFT 7.0 has a known bug and is therefore disabled by default. NVIDIA's webpage list a patch (an
|
||||
upgraded version cufft i.e. >= 7.0.35) - use this together with `-D__HAS_PATCHED_CUFFT_70`.
|
||||
- Use `-D__OFFLOAD_PROFILING` to turn on Nvidia Tools Extensions. It requires to link
|
||||
`-lnvToolsExt`.
|
||||
- Link to a BLAS/ScaLAPACK library that accelerates large DGEMMs (e.g., libsci_acc)
|
||||
- Use `-D__NO_OFFLOAD_GRID` to disable the GPU backend of the grid library.
|
||||
- Use `-D__NO_OFFLOAD_DBM` to disable the GPU backend of the sparse tensor library.
|
||||
- Use `-D__NO_OFFLOAD_PW` to disable the GPU backend of FFTs and associated gather/scatter
|
||||
operations.
|
||||
|
||||
### 2j. LIBXC (optional, wider choice of xc functionals)
|
||||
|
||||
- The version 5.1.0 (or later) of LIBXC can be downloaded from
|
||||
<https://www.tddft.org/programs/libxc>
|
||||
- CP2K does not make use of fourth derivates such that LIBXC may be configured with './configure
|
||||
--disable-lxc \<other LIBXC configuration flags>'.
|
||||
- During the installation, the directories `$(LIBXC_DIR)/lib` and `$(LIBXC_DIR)/include` are
|
||||
created.
|
||||
- Add `-D__LIBXC` to DFLAGS, `-I$(LIBXC_DIR)/include` to FCFLAGS and
|
||||
`-L$(LIBXC_DIR)/lib -lxcf03 -lxc` to LIBS.
|
||||
- :warning: Note that the deprecated flags `-D__LIBXC2` and `-D__LIBXC3` are ignored.
|
||||
|
||||
### 2k. ELPA (optional, improved performance for diagonalization)
|
||||
|
||||
Library ELPA for the solution of the eigenvalue problem
|
||||
|
||||
- ELPA replaces the ScaLAPACK `SYEVD` to improve the performance of the diagonalization
|
||||
- A version of ELPA can be downloaded from <http://elpa.rzg.mpg.de/software>.
|
||||
- During the installation the `libelpa_openmp.a` is created.
|
||||
- Minimal supported version of ELPA is 2018.05.001.
|
||||
- Add `-D__ELPA` to `DFLAGS`
|
||||
- Add `-D__ELPA_NVIDIA_GPU`, `-D__ELPA_AMD_GPU`, or `-D__ELPA_INTEL_GPU` to `DFLAGS` to enable GPU
|
||||
support for the respective vendor.
|
||||
- Add `-I$(ELPA_INCLUDE_DIR)/modules` to `FCFLAGS`
|
||||
- Add `-I$(ELPA_INCLUDE_DIR)/elpa` to `FCFLAGS`
|
||||
- Add `-L$(ELPA_DIR)` to `LDFLAGS`
|
||||
- Add `-lelpa` to `LIBS`
|
||||
- For specific architectures it can be better to install specifically optimized kernels (see BG)
|
||||
and/or employ a higher optimization level to compile it.
|
||||
|
||||
### 2l. cuSOLVERMp (experimental, improved performance for diagonalization on Nvidia GPUs)
|
||||
|
||||
NVIDIA cuSOLVERMp is a high-performance, distributed-memory, GPU-accelerated library that provides
|
||||
tools for the solution of dense linear systems and eigenvalue problems.
|
||||
|
||||
- cuSOLVERMp replaces the ScaLAPACK `SYEVD` to improve the performance of the diagonalization
|
||||
- A version of cuSOLVERMp can be downloaded from <https://docs.nvidia.com/hpc-sdk/cusolvermp>.
|
||||
- Add `-D__CUSOLVERMP` to `DFLAGS`
|
||||
- Add `-lcusolverMp -lcusolver -lcal -lnvidia-ml` to `LIBS`
|
||||
|
||||
### 2m. DLA-Future (optional, experimental, improved performance for diagonalization on Nvidia and AMD GPUs)
|
||||
|
||||
[DLA-Future](https://github.com/eth-cscs/DLA-Future) is a high-performance, distributed-memory,
|
||||
GPU-accelerated library that provides tools for the solution of eigenvalue problems, based on the
|
||||
[pika](https://pikacpp.org/) runtime.
|
||||
|
||||
- DLA-Future replaces the ScaLAPACK `SYEVD` to improve performance of the diagonalization
|
||||
- DLA-Future is available at <https://github.com/eth-cscs/DLA-Future>
|
||||
- DLA-Future is available via the [Spack](https://packages.spack.io/package.html?name=dla-future)
|
||||
package manager
|
||||
- `-D__DLAF` is defined by CMake when `-DCP2K_USE_DLAF=ON`
|
||||
|
||||
### 2n. PEXSI (optional, low scaling SCF method)
|
||||
|
||||
The Pole EXpansion and Selected Inversion (PEXSI) method requires the PEXSI library and two
|
||||
dependencies (ParMETIS or PT-Scotch and SuperLU_DIST).
|
||||
|
||||
- Download PEXSI (www.pexsi.org) and install it and its dependencies by following its README.md.
|
||||
- PEXSI versions 0.10.x have been tested with CP2K. Older versions are not supported.
|
||||
- PEXSI needs to be built with `make finstall`.
|
||||
|
||||
In the arch file of CP2K:
|
||||
|
||||
- Add `-lpexsi_${SUFFIX} -llapack -lblas -lsuperlu_dist_3.3 -lparmetis -lmetis`, and their paths
|
||||
(with `-L$(LIB_DIR)`) to LIBS.
|
||||
- It is important that a copy of LAPACK and BLAS is placed before and after these libraries (replace
|
||||
`-llapack` and `-lblas` with the optimized versions as needed).
|
||||
- In order to link in PT-Scotch instead of ParMETIS replace `-lparmetis -lmetis` with:
|
||||
`-lptscotchparmetis -lptscotch -lptscotcherr -lscotchmetis -lscotch -lscotcherr`
|
||||
- Add `-I$(PEXSI_DIR)/fortran/` to FCFLAGS.
|
||||
- Add `-D__LIBPEXSI` to DFLAGS.
|
||||
|
||||
Below are some additional hints that may help in the compilation process:
|
||||
|
||||
- For building PT-Scotch, the flag `-DSCOTCH_METIS_PREFIX` in `Makefile.inc` must not be set and the
|
||||
flag `-DSCOTCH_PTHREAD` must be removed.
|
||||
- For building SuperLU_DIST with PT-Scotch, you must set the following in `make.inc`:
|
||||
|
||||
```shell
|
||||
./install_cp2k_toolchain.sh --with-libxsmm=install --with-openblas=system \
|
||||
--with-fftw=system --enable-hip
|
||||
METISLIB = -lscotchmetis -lscotch -lscotcherr
|
||||
PARMETISLIB = -lptscotchparmetis -lptscotch -lptscotcherr
|
||||
```
|
||||
|
||||
- Build and install CP2K with prepared toolchain environment:
|
||||
### 2o. QUIP (optional, wider range of interaction potentials)
|
||||
|
||||
```shell
|
||||
./build_cp2k.sh
|
||||
```
|
||||
QUIP - QUantum mechanics and Interatomic Potentials Support for QUIP can be enabled via the flag
|
||||
`-D__QUIP`.
|
||||
|
||||
It is also available to make installed program and dependencies outside the source tree:
|
||||
For more information see <http://www.libatoms.org>.
|
||||
|
||||
```shell
|
||||
./install_cp2k_toolchain.sh --install-dir=/opt/cp2k/toolchain
|
||||
./build_cp2k.sh --prefix /opt/cp2k
|
||||
```
|
||||
### 2p. PLUMED (optional, enables various enhanced sampling methods)
|
||||
|
||||
CP2K can be compiled with PLUMED 2.x (`-D__PLUMED2`).
|
||||
|
||||
See <https://cp2k.org/howto:install_with_plumed> for full instructions.
|
||||
|
||||
### 2q. spglib (optional, crystal symmetries tools)
|
||||
|
||||
A library for finding and handling crystal symmetries
|
||||
|
||||
- The spglib can be downloaded from <https://github.com/atztogo/spglib>
|
||||
- For building CP2K with the spglib add `-D__SPGLIB` to DFLAGS
|
||||
|
||||
### 2r. SIRIUS (optional, plane wave calculations)
|
||||
|
||||
SIRIUS is a domain specific library for electronic structure calculations.
|
||||
|
||||
- The code is available at <https://github.com/electronic-structure/SIRIUS>
|
||||
- For building CP2K with SIRIUS add `-D__SIRIUS` to DFLAGS.
|
||||
- Add `-D__LIBVDWXC` if support is activated in SIRIUS.
|
||||
- See <https://electronic-structure.github.io/SIRIUS-doc/> for more information.
|
||||
|
||||
### 2s. FPGA (optional, plane wave FFT calculations)
|
||||
|
||||
- Use `-D__PW_FPGA` to enable FPGA support for PW (fft) calculations. Currently tested only for
|
||||
Intel Stratix 10 and Arria 10 GX1150 FPGAs.
|
||||
- Supports single precision and double precision fft calculations with the use of dedicated APIs.
|
||||
- Double precision is the default API chosen when set using the `-D__PW_FPGA` flag.
|
||||
- Single precision can be set using an additional `-D__PW_FPGA_SP` flag along with the `-D__PW_FPGA`
|
||||
flag.
|
||||
- Kernel code must be synthesized separately and copied to a specific location.
|
||||
- See <https://github.com/pc2/fft3d-fpga/> for the kernel code and instructions for synthesis.
|
||||
- Read `src/pw/fpga/README.md` for information on the specific location to copy the binaries to.
|
||||
- Currently supported FFT3d sizes - 16^3, 32^3, 64^3.
|
||||
- Include aocl compile flags and `-D__PW_FPGA -D__PW_FPGA_SP` to `CFLAGS`, aocl linker flags to
|
||||
`LDFLAGS` and aocl libs to `LIBS`.
|
||||
- When building FPGA and OFFLOAD together then `-D__NO_OFFLOAD_PW` must be used.
|
||||
|
||||
### 2t. COSMA (Distributed Communication-Optimal Matrix-Matrix Multiplication Algorithm)
|
||||
|
||||
- COSMA is an alternative for the pdgemm routine included in ScaLAPACK. The library supports both
|
||||
CPU and GPUs.
|
||||
- Add `-D__COSMA` to the DFLAGS to enable support for COSMA.
|
||||
- See <https://github.com/eth-cscs/COSMA> for more information.
|
||||
|
||||
### 2u. LibVori (Voronoi Integration for Electrostatic Properties from Electron Density)
|
||||
|
||||
- LibVori is a library which enables the calculation of electrostatic properties (charge, dipole
|
||||
vector, quadrupole tensor, etc.) via integration of the total electron density in the Voronoi cell
|
||||
of each atom.
|
||||
- Add `-D__LIBVORI` to the DFLAGS to enable support for LibVori.
|
||||
- See <https://brehm-research.de/libvori> for more information.
|
||||
- LibVori also enables support for the BQB file format for compressed trajectories, please see
|
||||
<https://brehm-research.de/bqb> for more information as well as the `bqbtool` to inspect BQB
|
||||
files.
|
||||
|
||||
### 2v. Torch (Machine Learning Framework needed for NequIP)
|
||||
|
||||
- The C++ API of PyTorch can be downloaded from https://pytorch.org/get-started/locally/.
|
||||
- Add `-D__LIBTORCH` to the DFLAGS to enable support for libtorch.
|
||||
|
||||
### 2w. ROCM/HIP (Support for AMD GPU)
|
||||
|
||||
The code for the HIP based grid backend was developed and tested on Mi100 but should work out of the
|
||||
box on Nvidia hardware as well.
|
||||
|
||||
- Use `-D__OFFLOAD_HIP` to generally enable support for AMD GPUs
|
||||
- Use `-D__NO_OFFLOAD_GRID` to disable the GPU backend of the grid library.
|
||||
- Use `-D__NO_OFFLOAD_DBM` to disable the GPU backend of the sparse tensor library.
|
||||
- Use `-D__NO_OFFLOAD_PW` to disable the GPU backend of FFTs and associated gather/scatter
|
||||
operations.
|
||||
- Add `-D__OFFLOAD_UNIFIED_MEMORY` to enable unified memory support (experimental and only supports
|
||||
Mi250X and above)
|
||||
- Add `GPUVER=Mi50, Mi60, Mi100, Mi250`
|
||||
- Add `OFFLOAD_CC = hipcc`
|
||||
- Add `-lamdhip64` to the `LIBS` variable
|
||||
- Add
|
||||
`OFFLOAD_FLAGS = '-munsafe-fp-atomics -fopenmp -m64 -pthread -fPIC -D__GRID_HIP -O2 --offload-arch=gfx908 --rocm-path=$(ROCM_PATH)'`
|
||||
where `ROCM_PATH` is the path where the rocm sdk resides. Architectures Mi300(A,X) (gfx1103),
|
||||
Mi250 (gfx90a), Mi100 (gfx908), Mi50 (gfx906) the hip backend for the grid library supports nvidia
|
||||
hardware as well. It uses the same code and can be used to validate the backend in case of access
|
||||
to Nvidia hardware only. To get the compilation working, follow the steps above and set the
|
||||
`OFFLOAD_FLAGS` with right `nvcc` parameters (see the cuda section of this document). The
|
||||
environment variable `HIP_PLATFORM` should be set to `HIP_PLATFORM=nvidia` to indicate to hipcc to
|
||||
use the nvcc compiler instead.
|
||||
- Specify the C++ compiler (e.g., `CXX = g++`). Remember to set the CXXFLAGS flags to support C++11
|
||||
standard and OpenMP.
|
||||
- When the HIP backend is enabled for DBCSR using `-D__DBCSR_ACC`, then add `-D__HIP_PLATFORM_AMD__`
|
||||
to `CXXFLAGS` and set `OFFLOAD_TARGET = hip`.
|
||||
- Use `-D__OFFLOAD_PROFILING` to turn on the AMD ROC TX and Tracer libray. It requires to link
|
||||
`-lroctx64 -lroctracer64`.
|
||||
|
||||
### 2x. OpenCL Devices
|
||||
|
||||
OpenCL devices are currently supported for DBCSR and DBM/DBT, and can cover GPUs and other devices.
|
||||
Kernels can be automatically tuned.
|
||||
|
||||
Note: the OpenCL backend uses some functionality from LIBXSMM (dependency). CP2K's offload-library
|
||||
serving DBM/DBT and other libraries depends on DBCSR's OpenCL backend.
|
||||
|
||||
- Installing OpenCL and preparing the runtime environment
|
||||
- Installing an OpenCL runtime depends on the operating system and the device vendor. Debian for
|
||||
instance brings two packages called `opencl-headers` and `ocl-icd-opencl-dev` which can be
|
||||
present in addition to a vendor-specific installation. The OpenCL header files are only
|
||||
necessary if CP2K/DBCSR is compiled from source. Please note, some implementations ship with
|
||||
outdated OpenCL headers which can prevent using latest features (if an application discovers
|
||||
such features only at compile-time). When building from source, for instance `libOpenCL.so` is
|
||||
sufficient at link-time (ICD loader). However, an Installable Client Driver (ICD) is finally
|
||||
necessary at runtime.
|
||||
- Nvidia CUDA, AMD HIP, and Intel OneAPI are fully equipped with an OpenCL runtime (if
|
||||
`opencl-headers` package is not installed, CPATH can be needed to point into the former
|
||||
installation, similarly `LIBRARY_PATH` for finding `libOpenCL.so` at link-time). Installing a
|
||||
minimal or stand-alone OpenCL is also possible, e.g., following the instructions for Debian (or
|
||||
Ubuntu) as given for every [release](https://github.com/intel/compute-runtime/releases) of the
|
||||
[Intel Compute Runtime](https://github.com/intel/compute-runtime).
|
||||
- The environment variable `ACC_OPENCL_VERBOSE` prints information at runtime of CP2K about
|
||||
kernels generated (`ACC_OPENCL_VERBOSE=2`) or executed (`ACC_OPENCL_VERBOSE=3`) which can be
|
||||
used to check an installation.
|
||||
- Building CP2K with OpenCL-based DBCSR
|
||||
- CP2K's toolchain supports `--enable-opencl` to select DBCSR's OpenCL backend. This can be
|
||||
combined with `--enable-cuda` (`--gpu-ver` is then imposed) to use a GPU for CP2K's GRID and PW
|
||||
components (no OpenCL support yet) with DBM's CUDA implementation to be preferred.
|
||||
- For manually writing an ARCH-file, add `-D__OPENCL` and `-D__DBCSR_ACC` to `CFLAGS` and add
|
||||
`-lOpenCL` to the `LIBS` variable, i.e., `OFFLOAD_CC` and `OFFLOAD_FLAGS` can duplicate `CC` and
|
||||
`CFLAGS` (no special offload compiler needed). Please also set `OFFLOAD_TARGET = opencl` to
|
||||
enable the OpenCL backend in DBCSR. For OpenCL, it is not necessary to specify a GPU version
|
||||
(e.g., `GPUVER = V100` would map/limit to
|
||||
`exts/dbcsr/src/acc/opencl/smm/params/tune_multiply_V100.csv`). In fact, `GPUVER` limits tuned
|
||||
parameters to the specified GPU, whereas by default all tuned parameters are embedded
|
||||
(`exts/dbcsr/src/acc/opencl/smm/params/*.csv`) and applied at runtime. If auto-tuned parameters
|
||||
are not available for DBCSR, well-chosen defaults will be used to populate kernels at runtime.
|
||||
- Auto-tuned parameters are embedded into the binary, i.e., CP2K does not rely on a hard-coded
|
||||
location. Setting `OPENCL_LIBSMM_SMM_PARAMS=/path/to/csv-file` environment variable can supply
|
||||
parameters for an already built application, or `OPENCL_LIBSMM_SMM_PARAMS=0` can disable using
|
||||
tuned parameters. Refer to <https://cp2k.github.io/dbcsr/> on how to tune kernels (parameters).
|
||||
- Building CP2K with OpenCL-based DBM library
|
||||
- For manually writing an ARCH-file, add `-D__OFFLOAD_OPENCL` to `CFLAGS` in addition to following
|
||||
above instructions for "Building CP2K with OpenCL-based DBCSR". An additional Makefile rule can
|
||||
be necessary to transform OpenCL code into a ressource header file.
|
||||
|
||||
### 2y. matrix-matrix multiplication offloading on GPU using SPLA
|
||||
|
||||
The SPLA library is a hard dependency of SIRIUS but can also be used as a standalone library. It
|
||||
provides a generic interface to the blas gemm family with offloading on GPU. Offloading supports
|
||||
both CUDA and ROCM.
|
||||
|
||||
To make the functionality available, add the flag `-D__SPLA -D__OFFLOAD_GEMM` to the `DFLAGS`
|
||||
variable and compile SPLA with Fortran interface and GPU support. Please note that only the
|
||||
functions replacing the dgemm calls with `offload_dgemm` will eventually be offloaded to the GPU.
|
||||
The SPLA library has internal criteria to decide if it is worth to do the operation on GPU or not.
|
||||
Calls to `offload_dgemm` also accept pointers on GPU or a combination of them.
|
||||
|
||||
### 2y. libgrpp (optional, enables calculations with ECPs)
|
||||
|
||||
- libgrpp is a library for the calculation of integrals with GTOs and ECPs
|
||||
- The libgrpp library can be found under <https://github.com/aoleynichenko/libgrpp>
|
||||
- During the installation, the directories `$(LIBGRPP_DIR)/lib` and `$(LIBGRPP_DIR)/include` are
|
||||
created.
|
||||
- Add `-D__LIBGRPP` to DFLAGS, `-I$(LIBGRPP_DIR)/include` to FCFLAGS and
|
||||
`-L$(LIBGRPP_DIR)/lib -llibgrpp` to LIBS
|
||||
|
||||
<!---
|
||||
### 2y. LibMaxwell (External Maxwell Solver)
|
||||
|
||||
- LibMaxwell is a library to solve the time-dependent Maxwell equations
|
||||
and use the resulting electric field in MD runs or real-time propagation.
|
||||
- Add `-D__LIBMAXWELL` to DFLAGS to enable support for LibMaxwell.
|
||||
- See <https://brehm-research.de> for more information.
|
||||
-->
|
||||
|
||||
### 2y. DeePMD-kit (optional, wider range of interaction potentials)
|
||||
|
||||
DeePMD-kit - Deep Potential Molecular Dyanmics. Support for DeePMD-kit can be enabled via the flag
|
||||
`-D__DEEPMD`.
|
||||
|
||||
- DeePMD-kit C interface can be downloaded from
|
||||
<https://docs.deepmodeling.com/projects/deepmd/en/master/install/install-from-c-library.html>
|
||||
- For more information see <https://github.com/deepmodeling/deepmd-kit.git>.
|
||||
|
||||
### 2z. DFTD4 (optional, dispersion correction)
|
||||
|
||||
- dftd4 - Generally Applicable Atomic-Charge Dependent London Dispersion Correction.
|
||||
- For more information see <https://github.com/dftd4/dftd4>
|
||||
- Add `-D__DFTD4` to DFLAGS, `-ldftd4 -lmstore -lmulticharge -lmctc-lib` to LIBS and
|
||||
`-I'${DFTD4_DFTD4}/../..' -I'${DFTD4_DFTD4}' -I'${DFTD4_MCTC}'` to CFLAGS
|
||||
|
||||
## 3. Compile
|
||||
|
||||
This section has been moved to the
|
||||
[manual](https://manual.cp2k.org/trunk/getting-started/build-from-source.html).
|
||||
### 3a. ARCH files
|
||||
|
||||
The location of compiler and libraries needs to be specified. Examples for several common
|
||||
architectures can be found in [arch folder](./arch/). The names of these files match
|
||||
`architecture.version` e.g., [Linux-x86-64-gfortran.sopt](./arch/Linux-x86-64-gfortran.sopt).
|
||||
Alternatively, <https://dashboard.cp2k.org> provides sample arch files as part of the testing
|
||||
reports (click on the status field, search for 'ARCH-file').
|
||||
|
||||
Conventionally, there are six versions:
|
||||
|
||||
| Acronym | Meaning |
|
||||
| ------- | -------------------------------- |
|
||||
| sdbg | OpenMP + debug settings |
|
||||
| sopt | OpenMP + OMP_NUM_THREADS=1 |
|
||||
| ssmp | OpenMP |
|
||||
| pdbg | MPI + OpenMP + debug settings |
|
||||
| popt | MPI + OpenMP + OMP_NUM_THREADS=1 |
|
||||
| psmp | MPI + OpenMP |
|
||||
|
||||
You'll need to modify one of these files to match your system's settings.
|
||||
|
||||
You can now build CP2K using these settings (where -j N allows for a parallel build using N
|
||||
processes):
|
||||
|
||||
```shell
|
||||
make -j N ARCH=architecture VERSION=version
|
||||
```
|
||||
|
||||
e.g.
|
||||
|
||||
```shell
|
||||
make -j N ARCH=Linux-x86-64-gfortran VERSION=sopt
|
||||
```
|
||||
|
||||
as a short-cut, you can build several version of the code at once
|
||||
|
||||
```shell
|
||||
make -j N ARCH=Linux-x86-64-gfortran VERSION="sopt popt ssmp psmp"
|
||||
```
|
||||
|
||||
An executable should appear in the `./exe/` folder.
|
||||
|
||||
All compiled files, libraries, executables, etc. of all architectures and versions can be removed
|
||||
with
|
||||
|
||||
```shell
|
||||
make distclean
|
||||
```
|
||||
|
||||
To remove only objects and mod files (i.e., keep exe) for a given ARCH/VERSION use, e.g.,
|
||||
|
||||
```shell
|
||||
make ARCH=Linux-x86-64-gfortran VERSION=sopt clean
|
||||
```
|
||||
|
||||
to remove everything for a given ARCH/VERSION use, e.g.,
|
||||
|
||||
```shell
|
||||
make ARCH=Linux-x86-64-gfortran VERSION=sopt realclean
|
||||
```
|
||||
|
||||
### 3b. Compilation Flags
|
||||
|
||||
The following flags should be present (or not) in the arch file, partially depending on installed
|
||||
libraries (see 2.)
|
||||
|
||||
- `-D__parallel` builds an MPI parallel CP2K binary (implies the use and thus the availabiltity of
|
||||
the ScaLAPACK/BLACS libraries)
|
||||
- `-D__LIBINT` use LIBINT (needed for HF exchange)
|
||||
- `-D__LIBXC` use LIBXC
|
||||
- `-D__LIBGRPP` use libgrpp (for calculations with ECPs)
|
||||
- `-D__ELPA` use ELPA in place of SYEVD to solve the eigenvalue problem
|
||||
- `-D__FFTW3` FFTW version 3 is recommended
|
||||
- `-D__MKL` link the MKL library for linear algebra and/or FFT
|
||||
- `-D__GRID_CORE=X` (with X=1..6) specific optimized core routines can be selected. Reasonable
|
||||
defaults are [provided](./src/grid/collocate_fast.f90) but trial-and-error might yield (a small
|
||||
~10%) speedup.
|
||||
- `-D__PILAENV_BLOCKSIZE`: can be used to specify the blocksize (e.g.,
|
||||
`-D__PILAENV_BLOCKSIZE=1024`), which is a hack to overwrite (if the linker allows this) the
|
||||
PILAENV function provided by ScaLAPACK. This can lead to much improved PDGEMM performance. The
|
||||
optimal value depends on hardware (GPU?) and precise problem. Alternatively, Cray provides an
|
||||
environment variable to this effect (e.g., `export LIBSCI_ACC_PILAENV=4000`)
|
||||
- `-D__STATM_RESIDENT` or `-D__STATM_TOTAL` toggles memory usage reporting between resident memory
|
||||
and total memory
|
||||
- `-D__CRAY_PM_ACCEL_ENERGY` or `-D__CRAY_PM_ENERGY` switch on energy profiling on Cray systems
|
||||
- `-D__NO_ABORT` to avoid calling abort, but STOP instead (useful for coverage testing, and to avoid
|
||||
core dumps on some systems)
|
||||
- `-D__HDF5` enables hdf5 support. This is a hard dependency for SIRIUS, but can also be used by
|
||||
itself to allow read/write functionalities of QCSchema files in the active space module.
|
||||
|
||||
Features useful to deal with legacy systems
|
||||
|
||||
- `-D__NO_MPI_THREAD_SUPPORT_CHECK` - Workaround for MPI libraries that do not declare they are
|
||||
thread safe (serialized).
|
||||
- `-D__NO_SOCKETS` disables the socket interface in case of troubles compiling on systems that do
|
||||
not support POSIX sockets.
|
||||
- `-D__HAS_IEEE_EXCEPTIONS` disables trapping temporarily for libraries like ScaLAPACK.
|
||||
- The Makefile automatically compiles in the path to the data directory via the flag `-D__DATA_DIR`.
|
||||
If you want to compile in a different path, set the variable `DATA_DIR` in your arch-file.
|
||||
- `-D__NO_STATM_ACCESS` - Do not try to read from /proc/self/statm to get memory usage information.
|
||||
This is otherwise attempted on several. Linux-based architectures or using with the NAG, gfortran,
|
||||
compilers.
|
||||
- `-D__CHECK_DIAG` Debug option which activates an orthonormality check of the eigenvectors
|
||||
calculated by the selected eigensolver
|
||||
|
||||
### 3c. Building CP2K as a library
|
||||
|
||||
You can build CP2K for use as a library by adding `libcp2k` as an option to your `make` command,
|
||||
e.g.
|
||||
|
||||
```shell
|
||||
make -j N ARCH=Linux-x86-64-gfortran VERSION=sopt libcp2k
|
||||
```
|
||||
|
||||
This will create `libcp2k.a` in the relevant subdirectory of `./lib/`. You will need to add this
|
||||
subdirectory to the library search path of your compiler (typically via the `LD_LIBRARY_PATH`
|
||||
environment variable or the `-L` option to your compiler) and link to the library itself with
|
||||
`-lcp2k`.
|
||||
|
||||
In order to use the functions in the library you will also require the `libcp2k.h` header file. This
|
||||
can be found in `./src/start/` directory. You should add this directory to the header search path of
|
||||
your compiler (typically via the `CPATH` environment variable or the `-I` option to your compiler).
|
||||
|
||||
For Fortran users, you will require the module interface file (`.mod` file) for every MODULE
|
||||
encountered in the source. These are compiler specific and are to be found in the subdirectory of
|
||||
`./obj/` that corresponds to your build, e.g.,
|
||||
|
||||
```shell
|
||||
./obj/Linux-x86-64-gfortran/sopt/
|
||||
```
|
||||
|
||||
In order for your compiler to find these, you will need to indicate their location to the compiler
|
||||
as is done for header files (typically via the `CPATH` environment variable or the `-I` option to
|
||||
your compiler).
|
||||
|
||||
## 4. If it doesn't work
|
||||
|
||||
If things fail, take a break... go back to step 2.
|
||||
If things fail, take a break... go back to 2a (or skip to step 6).
|
||||
|
||||
## 5. Regtesting
|
||||
|
||||
|
|
@ -98,7 +626,7 @@ If compilation works fine, it is recommended to test the generated binary, to ex
|
|||
libraries, or miscompilations, etc.
|
||||
|
||||
```shell
|
||||
./tests/do_regtest.py ./build/bin/ ${VERSION}
|
||||
make -j ARCH=... VERSION=... test
|
||||
```
|
||||
|
||||
should work if you can locally execute CP2K without the need for, e.g., batch submission.
|
||||
|
|
@ -114,7 +642,7 @@ In any case please tell us your comments, praise, criticism, thanks, etc. see
|
|||
## 7. Manual
|
||||
|
||||
A reference manual of CP2K can be found on the web: <https://manual.cp2k.org> or can be generated
|
||||
using the cp2k binary, see <https://manual.cp2k.org/trunk/generate_manual_howto.html>
|
||||
using the cp2k executable, see <https://manual.cp2k.org/trunk/generate_manual_howto.html>
|
||||
|
||||
## 8. Happy computing
|
||||
|
||||
|
|
|
|||
571
Makefile
Normal file
571
Makefile
Normal file
|
|
@ -0,0 +1,571 @@
|
|||
#
|
||||
# make -j 16 ssmp psmp
|
||||
#
|
||||
# will now perform a parallel build of 4 cp2k executables
|
||||
#
|
||||
SHELL = /bin/sh
|
||||
#
|
||||
# the home dir is taken from the current directory.
|
||||
ifeq ($(CP2KHOME),)
|
||||
CP2KHOME := $(abspath $(shell pwd))
|
||||
export CP2KHOME
|
||||
endif
|
||||
|
||||
ARCH := local
|
||||
export VERSION=ssmp
|
||||
|
||||
MAKEFILE := $(CP2KHOME)/Makefile
|
||||
ARCHDIR := $(CP2KHOME)/arch
|
||||
DATA_DIR := $(CP2KHOME)/data
|
||||
MAINEXEDIR := $(CP2KHOME)/exe
|
||||
MAINLIBDIR := $(CP2KHOME)/lib
|
||||
MAINOBJDIR := $(CP2KHOME)/obj
|
||||
MAINTSTDIR := $(CP2KHOME)/regtesting
|
||||
PRECOMMITDIR := $(CP2KHOME)/obj/precommit
|
||||
PRETTYOBJDIR := $(CP2KHOME)/obj/prettified
|
||||
DOXIFYOBJDIR := $(CP2KHOME)/obj/doxified
|
||||
TOOLSRC := $(CP2KHOME)/tools
|
||||
SRCDIR := $(CP2KHOME)/src
|
||||
EXEDIR := $(MAINEXEDIR)/$(ARCH)
|
||||
REVISION := $(shell $(CP2KHOME)/tools/build_utils/get_revision_number $(SRCDIR))
|
||||
|
||||
EXTSDIR := exts
|
||||
EXTSHOME := $(CP2KHOME)/$(EXTSDIR)
|
||||
EXTSPACKAGES := $(shell cd $(EXTSHOME) ; find * -maxdepth 0 -type d | grep -v build_ )
|
||||
|
||||
PYTHON := /usr/bin/env python3
|
||||
|
||||
# Common Targets ============================================================
|
||||
default_target: all
|
||||
|
||||
# Discover programs =========================================================
|
||||
ifeq ($(ALL_EXE_FILES),)
|
||||
export ALL_EXE_FILES := $(sort $(shell $(TOOLSRC)/build_utils/discover_programs.py $(SRCDIR)))
|
||||
endif
|
||||
EXE_NAMES := $(basename $(notdir $(ALL_EXE_FILES)))
|
||||
|
||||
# Once we are down to a single version ======================================
|
||||
# this only happens on stage 3 and 4
|
||||
ifneq ($(ONEVERSION),)
|
||||
MODDEPS = "lower"
|
||||
include $(ARCHDIR)/$(ARCH).$(ONEVERSION)
|
||||
LIBDIR := $(MAINLIBDIR)/$(ARCH)/$(ONEVERSION)
|
||||
PKGCONFIGDIR := $(LIBDIR)/pkgconfig
|
||||
PKGCONFIG := $(PKGCONFIGDIR)/libcp2k.pc
|
||||
LIBEXTSDIR := $(LIBDIR)/$(EXTSDIR)
|
||||
OBJDIR := $(MAINOBJDIR)/$(ARCH)/$(ONEVERSION)
|
||||
OBJEXTSDIR := $(OBJDIR)/$(EXTSDIR)
|
||||
OBJEXTSINCL := $(foreach dir,$(EXTSPACKAGES),-I'$(OBJEXTSDIR)/$(dir)')
|
||||
TSTDIR := $(MAINTSTDIR)/$(ARCH)/$(ONEVERSION)
|
||||
ifneq ($(LD_SHARED),)
|
||||
ARCHIVE_EXT := .so
|
||||
else
|
||||
ARCHIVE_EXT := .a
|
||||
endif
|
||||
include $(EXTSHOME)/Makefile.inc
|
||||
endif
|
||||
|
||||
# Declare PHONY targets =====================================================
|
||||
.PHONY: $(VERSION) $(EXE_NAMES) \
|
||||
dirs makedep default_target all \
|
||||
toolversions exts extversions extclean \
|
||||
libcp2k cp2k_shell pkgconfig python-bindings \
|
||||
pre-commit pre-commit-clean \
|
||||
pretty precommit precommitclean doxygenclean doxygen \
|
||||
fpretty fprettyclean \
|
||||
doxify doxifyclean \
|
||||
install clean realclean distclean help \
|
||||
test testbg testclean \
|
||||
data \
|
||||
$(EXTSPACKAGES)
|
||||
|
||||
# Discover files and directories ============================================
|
||||
#
|
||||
# File type is derived from name. Only the following extensions are supported:
|
||||
# .F -> Fortran
|
||||
# .c -> C
|
||||
# .h -> C header
|
||||
# .cu -> CUDA or HIP kernel
|
||||
|
||||
ALL_SRC_DIRS := $(shell find $(SRCDIR) -type d | awk '{printf("%s:",$$1)}')
|
||||
ALL_PKG_FILES = $(shell find $(SRCDIR) -name "PACKAGE")
|
||||
OBJ_SRC_FILES = $(shell cd $(SRCDIR); find . -name "*.F")
|
||||
OBJ_SRC_FILES += $(shell cd $(SRCDIR); find . -name "*.c")
|
||||
|
||||
ifneq ($(filter nvcc hipcc, $(notdir $(OFFLOAD_CC))),)
|
||||
OBJ_SRC_FILES += $(shell cd $(SRCDIR); find . -name "*.cu")
|
||||
endif
|
||||
|
||||
# Begrudgingly tolerated because PyTorch has no C API.
|
||||
OBJ_SRC_FILES += $(SRCDIR)/torch_c_api.cpp
|
||||
|
||||
# Included files used by Fypp preprocessor
|
||||
INCLUDED_SRC_FILES = $(notdir $(shell find $(SRCDIR) -name "*.fypp"))
|
||||
|
||||
# Include also source files which won't compile into an object file
|
||||
ALL_SRC_FILES = $(strip $(subst $(NULL) .,$(NULL) $(SRCDIR),$(NULL) $(OBJ_SRC_FILES)))
|
||||
ALL_SRC_FILES += $(shell find $(SRCDIR) -name "*.h")
|
||||
|
||||
ALL_OBJECTS = $(addsuffix .o, $(basename $(notdir $(OBJ_SRC_FILES))))
|
||||
ALL_EXE_OBJECTS = $(addsuffix .o, $(EXE_NAMES))
|
||||
ALL_NONEXE_OBJECTS = $(filter-out $(ALL_EXE_OBJECTS), $(ALL_OBJECTS))
|
||||
|
||||
# stage 1: Call make recursively with each element in $(VERSION) as a target,
|
||||
# The actual target is stored in ORIG_TARGET.
|
||||
# Make can then parallelize over multiple versions targets.
|
||||
ifeq ($(ONEVERSION),)
|
||||
ORIG_TARGET = default_target
|
||||
|
||||
fes:
|
||||
@+$(MAKE) --no-print-directory -f $(MAKEFILE) $(VERSION) ORIG_TARGET=graph
|
||||
|
||||
$(EXE_NAMES) all toolversions extversions extclean libcp2k cp2k_shell exts $(EXTSPACKAGES) python-bindings test testbg:
|
||||
@+$(MAKE) --no-print-directory -f $(MAKEFILE) $(VERSION) ORIG_TARGET=$@
|
||||
|
||||
# stage 2: Store the version target in $(ONEVERSION),
|
||||
# Call make recursively with $(ORIG_TARGET) as target.
|
||||
$(filter-out sopt, popt, $(VERSION)):
|
||||
@+$(MAKE) --no-print-directory -f $(MAKEFILE) $(ORIG_TARGET) ORIG_TARGET="" VERSION="" ONEVERSION=$@
|
||||
|
||||
sopt:
|
||||
@+echo "Version sopt is now an alias for ssmp with OMP_NUM_THREADS=1."
|
||||
@+$(MAKE) --no-print-directory -f $(MAKEFILE) $(ORIG_TARGET) ORIG_TARGET="" VERSION="" ONEVERSION="ssmp"
|
||||
popt:
|
||||
@+echo "Version popt is now an alias for psmp with OMP_NUM_THREADS=1."
|
||||
@+$(MAKE) --no-print-directory -f $(MAKEFILE) $(ORIG_TARGET) ORIG_TARGET="" VERSION="" ONEVERSION="psmp"
|
||||
|
||||
else
|
||||
|
||||
# stage 3: Include arch-file, create dirs, and run makedep.py for given $(ONEVERSION).
|
||||
# Afterwards, call make recursively again with -C $(OBJDIR) and INCLUDE_DEPS=true
|
||||
ifeq ($(INCLUDE_DEPS),)
|
||||
$(EXE_NAMES): makedep | dirs exts
|
||||
@+$(MAKE) --no-print-directory -C $(OBJDIR) -f $(MAKEFILE) $(EXEDIR)/$@.$(ONEVERSION) INCLUDE_DEPS=true
|
||||
|
||||
all: makedep | dirs exts
|
||||
@+$(MAKE) --no-print-directory -C $(OBJDIR) -f $(MAKEFILE) all INCLUDE_DEPS=true
|
||||
|
||||
# compilation for testing happens here
|
||||
test: dirs makedep all
|
||||
@$(TOOLSRC)/regtesting/print_environment.sh $(ARCH) $(ONEVERSION)
|
||||
@+$(MAKE) --no-print-directory -C $(TSTDIR) -f $(MAKEFILE) test INCLUDE_DEPS=true
|
||||
|
||||
testbg: dirs makedep all
|
||||
@+$(MAKE) --no-print-directory -C $(TSTDIR) -f $(MAKEFILE) testbg INCLUDE_DEPS=true
|
||||
|
||||
libcp2k: pkgconfig makedep | dirs exts
|
||||
@+$(MAKE) --no-print-directory -C $(OBJDIR) -f $(MAKEFILE) $(LIBDIR)/libcp2k$(ARCHIVE_EXT) INCLUDE_DEPS=true
|
||||
|
||||
python-bindings: libcp2k
|
||||
@cd $(SRCDIR)/start/python ; \
|
||||
env CC='$(CC)' LDSHARED='$(LD) -shared' CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS) $(LDFLAGS_C) $(LIBS)' \
|
||||
$(PYTHON) setup.py build_ext \
|
||||
--build-temp="$(OBJDIR)/python" \
|
||||
--build-lib="$(LIBDIR)/python" \
|
||||
--library-dirs="$(LIBDIR)" \
|
||||
--libraries="$(patsubst -l%,%,$(filter -l%,$(LIBS)))"
|
||||
|
||||
exts: $(EXTSPACKAGES)
|
||||
|
||||
dirs:
|
||||
@mkdir -p $(OBJDIR)
|
||||
@mkdir -p $(OBJEXTSDIR)
|
||||
@mkdir -p $(LIBDIR)
|
||||
@mkdir -p $(PKGCONFIGDIR)
|
||||
@mkdir -p $(LIBEXTSDIR)
|
||||
@mkdir -p $(EXEDIR)
|
||||
@mkdir -p $(TSTDIR)
|
||||
|
||||
pkgconfig: dirs
|
||||
@echo "Writing pkg-config $(PKGCONFIG)"
|
||||
@echo "Name: libcp2k" > $(PKGCONFIG)
|
||||
@echo "Description: CP2K as a library" >> $(PKGCONFIG)
|
||||
@echo "URL: https://www.cp2k.org" >> $(PKGCONFIG)
|
||||
@echo "Version: $(REVISION)" >> $(PKGCONFIG)
|
||||
@echo "includedir=$(SRCDIR)/start" >> $(PKGCONFIG)
|
||||
@echo "Cflags: -I\$${includedir}" >> $(PKGCONFIG)
|
||||
@echo "libdir=$(LIBDIR)" >> $(PKGCONFIG)
|
||||
@echo "Libs: -L\$${libdir} -Wl,-rpath=\$${libdir} -lcp2k $(LDFLAGS) $(LIBS)" >> $(PKGCONFIG)
|
||||
|
||||
toolversions:
|
||||
ifneq ($(FC),)
|
||||
@echo "=========== FC ($(ONEVERSION)) ==========="
|
||||
ifeq (Cray,$(shell $(CC) -V 2>&1 | head -n1 | cut -d' ' -f1))
|
||||
$(FC) -V
|
||||
else ifeq (IBM,$(shell $(CC) -qversion 2>&1 | head -n1 | cut -d' ' -f1))
|
||||
$(FC) -qversion
|
||||
else
|
||||
$(FC) --version
|
||||
endif
|
||||
endif
|
||||
ifneq ($(CC),)
|
||||
@echo "=========== CC ($(ONEVERSION)) ==========="
|
||||
ifeq (Cray,$(shell $(CC) -V 2>&1 | head -n1 | cut -d' ' -f1))
|
||||
$(CC) -V
|
||||
else ifeq (IBM,$(shell $(CC) -qversion 2>&1 | head -n1 | cut -d' ' -f1))
|
||||
$(CC) -qversion
|
||||
else
|
||||
$(CC) --version
|
||||
endif
|
||||
endif
|
||||
ifneq ($(OFFLOAD_CC),)
|
||||
@echo "========== OFFLOAD_CC ($(ONEVERSION)) =========="
|
||||
$(OFFLOAD_CC) --version
|
||||
@echo ""
|
||||
endif
|
||||
ifneq ($(AR),)
|
||||
ifeq (Linux,$(shell uname -s))
|
||||
@echo "=========== AR ($(ONEVERSION)) ==========="
|
||||
$(firstword $(AR)) V
|
||||
@echo ""
|
||||
endif
|
||||
endif
|
||||
@echo "========== Make ($(ONEVERSION)) =========="
|
||||
$(MAKE) --version
|
||||
@echo ""
|
||||
@echo "========= Python ($(ONEVERSION)) ========="
|
||||
$(PYTHON) --version
|
||||
|
||||
else
|
||||
|
||||
# Force CP2K recompilations if exts are updated
|
||||
$(ALL_OBJECTS): $(EXTSDEPS_MOD)
|
||||
$(ALL_EXE_OBJECTS): $(EXTSDEPS_LIB)
|
||||
|
||||
# stage 4: Include $(OBJDIR)/all.dep, expand target all and libcp2k, and perform actual build.
|
||||
|
||||
ifeq ("$(ONEVERSION)","psmp")
|
||||
all: $(foreach e, $(EXE_NAMES) cp2k_shell, $(EXEDIR)/$(e).$(ONEVERSION)) $(EXEDIR)/cp2k.popt
|
||||
else ifeq ("$(ONEVERSION)","ssmp")
|
||||
all: $(foreach e, $(EXE_NAMES) cp2k_shell, $(EXEDIR)/$(e).$(ONEVERSION)) $(EXEDIR)/cp2k.sopt
|
||||
else
|
||||
all: $(foreach e, $(EXE_NAMES) cp2k_shell, $(EXEDIR)/$(e).$(ONEVERSION))
|
||||
endif
|
||||
$(LIBDIR)/libcp2k$(ARCHIVE_EXT) : $(ALL_NONEXE_OBJECTS)
|
||||
|
||||
# Create always a cp2k.[ps]opt soft link for each cp2k.[ps]smp executable
|
||||
$(EXEDIR)/cp2k.sopt: $(EXEDIR)/cp2k.ssmp
|
||||
cd $(EXEDIR); ln -sf cp2k.ssmp cp2k.sopt
|
||||
$(EXEDIR)/cp2k.popt: $(EXEDIR)/cp2k.psmp
|
||||
cd $(EXEDIR); ln -sf cp2k.psmp cp2k.popt
|
||||
|
||||
$(EXEDIR)/cp2k_shell.$(ONEVERSION): $(EXEDIR)/cp2k.$(ONEVERSION)
|
||||
cd $(EXEDIR); ln -sf cp2k.$(ONEVERSION) cp2k_shell.$(ONEVERSION)
|
||||
|
||||
test:
|
||||
@$(CP2KHOME)/tests/do_regtest.py $(ARCH) $(ONEVERSION) $(TESTOPTS)
|
||||
|
||||
testbg:
|
||||
@echo "testing: $(ONEVERSION) : full log in $(TSTDIR)/regtest.log "
|
||||
@$(CP2KHOME)/tests/do_regtest.py $(ARCH) $(ONEVERSION) $(TESTOPTS) > $(TSTDIR)/regtest.log 2>&1
|
||||
@grep -e "Summary:" -e "Status:" $(TSTDIR)/regtest.log
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
OTHER_HELP += "test : run the regression tests"
|
||||
OTHER_HELP += "testbg : run the regression tests in background"
|
||||
|
||||
OTHER_HELP += "toolversions : Print versions of build tools"
|
||||
|
||||
OTHER_HELP += "extversions : Print versions of external modules"
|
||||
OTHER_HELP += "extclean : Clean build of external modules"
|
||||
|
||||
# extract help text from doxygen "\brief"-tag
|
||||
help:
|
||||
@echo "=================== Binaries ===================="
|
||||
@echo "all Builds all executables (default target)"
|
||||
@for i in $(ALL_EXE_FILES); do \
|
||||
basename $$i | sed 's/^\(.*\)\..*/\1/' | awk '{printf "%-28s", $$1}'; \
|
||||
grep "brief" $$i | head -n 1 | sed 's/^.*\\brief\s*//'; \
|
||||
done
|
||||
@echo "libcp2k Builds CP2K as a single library archive"
|
||||
@echo "cp2k_shell Creates symlink for backward compatibility"
|
||||
@echo ""
|
||||
@echo "===================== Tools ====================="
|
||||
@printf "%s\n" $(TOOL_HELP) | awk -F ':' '{printf "%-28s%s\n", $$1, $$2}'
|
||||
@echo ""
|
||||
@echo "================= Other Targets ================="
|
||||
@printf "%s\n" $(OTHER_HELP) | awk -F ':' '{printf "%-28s%s\n", $$1, $$2}'
|
||||
@echo "help Print this help text"
|
||||
|
||||
#
|
||||
# so far CP2K does not install, but give a hint to the user
|
||||
#
|
||||
install:
|
||||
@echo ""
|
||||
@echo "The CP2K executable is $(foreach v, $(VERSION), $(EXEDIR)/cp2k.$(v))"
|
||||
@echo ""
|
||||
OTHER_HELP += "install : Print installation help"
|
||||
|
||||
#
|
||||
# delete the intermediate files, but not the libraries and executables, or created directories.
|
||||
# Most useful to save space on the disk or e.g. for recompiles with PGO that still needs the .gcda files in the objdir
|
||||
#
|
||||
# To avoid printing out all non-gcda files within a directory with 'make clean',
|
||||
# a list of all non-gcda file extensions within a directory is first created with the get_extensions macro,
|
||||
# and a wildcard expression is then used to remove the appropriate files
|
||||
# cleaning stuff ============================================================
|
||||
define get_extensions
|
||||
$(shell test -d $(1) && find $(1) -type f -name "*.*" ! -name "*.gcda" | sed 's|.*\.||' | sort -u)
|
||||
endef
|
||||
clean:
|
||||
@echo rm -rf $(foreach v, $(VERSION), $(MAINOBJDIR)/$(ARCH)/$(v))
|
||||
@$(foreach v, $(VERSION), $(foreach ext, $(call get_extensions, $(MAINOBJDIR)/$(ARCH)/$(v)/), $(shell rm -rf $(MAINOBJDIR)/$(ARCH)/$(v)/*.$(ext))))
|
||||
rm -rf $(foreach v, $(VERSION), $(MAINLIBDIR)/$(ARCH)/$(v))
|
||||
OTHER_HELP += "clean : Remove intermediate object and mod files, but not the libraries and executables, for given ARCH and VERSION"
|
||||
|
||||
# The Intel compiler creates a corresponding .dbg file for each executable when static linking of the Intel MPI library is requested (flag -static_mpi)
|
||||
# and also potential soft links (.popt and .sopt files) have to be cleaned
|
||||
execlean:
|
||||
rm -rf $(foreach v, $(VERSION), $(EXEDIR)/*.$(v) $(EXEDIR)/*.$(v).dbg) $(EXEDIR)/cp2k.[ps]opt
|
||||
OTHER_HELP += "execlean : Remove the executables, for given ARCH and VERSION"
|
||||
|
||||
#
|
||||
# delete the intermediate files, the programs and libraries and anything that might be in the objdir or libdir directory
|
||||
# Use this if you want to fully rebuild an executable (for a given compiler and or VERSION)
|
||||
#
|
||||
realclean: extclean clean execlean
|
||||
rm -rf $(foreach v, $(VERSION), $(MAINOBJDIR)/$(ARCH)/$(v))
|
||||
rm -rf $(foreach v, $(VERSION), $(MAINLIBDIR)/$(ARCH)/$(v))
|
||||
OTHER_HELP += "realclean : Remove all files for given ARCH and VERSION"
|
||||
|
||||
testclean:
|
||||
rm -rf $(foreach v, $(VERSION), $(MAINTSTDIR)/$(ARCH)/$(v)/TEST-*)
|
||||
OTHER_HELP += "testclean : Remove all TEST-* files for given ARCH and VERSION"
|
||||
|
||||
#
|
||||
# Remove all files from previous builds
|
||||
#
|
||||
distclean: precommitclean fprettyclean doxifyclean
|
||||
rm -rf $(DOXYGENDIR) $(MAINEXEDIR) $(MAINOBJDIR) $(MAINLIBDIR) $(MAINTSTDIR)
|
||||
OTHER_HELP += "distclean : Remove all files from previous builds"
|
||||
|
||||
# Prettyfier stuff ==========================================================
|
||||
vpath %.pretty $(PRETTYOBJDIR)
|
||||
|
||||
fpretty: $(addprefix $(PRETTYOBJDIR)/, $(ALL_OBJECTS:.o=.pretty)) $(addprefix $(PRETTYOBJDIR)/, $(INCLUDED_SRC_FILES:.f90=.pretty_included))
|
||||
TOOL_HELP += "fpretty : Reformat all Fortran source files in a pretty way."
|
||||
|
||||
fprettyclean:
|
||||
-rm -rf $(PRETTYOBJDIR)
|
||||
TOOL_HELP += "fprettyclean : Remove prettify marker files and preprettify directories"
|
||||
|
||||
$(PRETTYOBJDIR)/%.pretty: %.F $(DOXIFYOBJDIR)/%.doxified
|
||||
@mkdir -p $(PRETTYOBJDIR)
|
||||
cd $(dir $<); $(TOOLSRC)/precommit/format_fortran.py --do-backup --backup-dir=$(PRETTYOBJDIR) $(notdir $<)
|
||||
@touch $@
|
||||
|
||||
$(PRETTYOBJDIR)/%.pretty_included: %.f90 $(DOXIFYOBJDIR)/%.doxified_included
|
||||
@mkdir -p $(PRETTYOBJDIR)
|
||||
cd $(dir $<); $(TOOLSRC)/precommit/format_fortran.py --do-backup --backup-dir=$(PRETTYOBJDIR) $(notdir $<)
|
||||
@touch $@
|
||||
|
||||
$(PRETTYOBJDIR)/%.pretty: %.c $(DOXIFYOBJDIR)/%.doxified
|
||||
# TODO: call indent here?
|
||||
@mkdir -p $(PRETTYOBJDIR)
|
||||
@touch $@
|
||||
|
||||
$(PRETTYOBJDIR)/%.pretty: %.cpp $(DOXIFYOBJDIR)/%.doxified
|
||||
# TODO: call indent here?
|
||||
@mkdir -p $(PRETTYOBJDIR)
|
||||
@touch $@
|
||||
|
||||
# Doxyifier stuff ===========================================================
|
||||
vpath %.doxified $(DOXIFYOBJDIR)
|
||||
|
||||
doxify: $(addprefix $(DOXIFYOBJDIR)/, $(ALL_OBJECTS:.o=.doxified)) $(addprefix $(DOXIFYOBJDIR)/, $(INCLUDED_SRC_FILES:.f90=.doxified_included))
|
||||
TOOL_HELP += "doxify : Autogenerate doxygen headers for subroutines"
|
||||
|
||||
doxifyclean:
|
||||
-rm -rf $(DOXIFYOBJDIR)
|
||||
TOOL_HELP += "doxifyclean : Remove doxify marker files"
|
||||
|
||||
$(DOXIFYOBJDIR)/%.doxified: %.F
|
||||
$(TOOLSRC)/doxify/doxify.sh $<
|
||||
@mkdir -p $(DOXIFYOBJDIR)
|
||||
@touch $@
|
||||
|
||||
$(DOXIFYOBJDIR)/%.doxified_included: %.f90
|
||||
$(TOOLSRC)/doxify/doxify.sh $<
|
||||
@mkdir -p $(DOXIFYOBJDIR)
|
||||
@touch $@
|
||||
|
||||
$(DOXIFYOBJDIR)/%.doxified: %.c
|
||||
@mkdir -p $(DOXIFYOBJDIR)
|
||||
@touch $@
|
||||
|
||||
$(DOXIFYOBJDIR)/%.doxified: %.cpp
|
||||
@mkdir -p $(DOXIFYOBJDIR)
|
||||
@touch $@
|
||||
|
||||
# doxygen stuff =============================================================
|
||||
doxygenclean:
|
||||
-rm -rf $(CP2KHOME)/doxygen
|
||||
TOOL_HELP += "doxygenclean : Remove the generated doxygen documentation"
|
||||
|
||||
doxygen: doxygenclean
|
||||
$(TOOLSRC)/doxify/generate_doxygen.sh
|
||||
TOOL_HELP += "doxygen : Generate the doxygen documentation"
|
||||
|
||||
# Precommit stuff ===========================================================
|
||||
pretty: precommit
|
||||
TOOL_HELP += "pretty : Alias for precommit."
|
||||
|
||||
precommit:
|
||||
$(TOOLSRC)/precommit/precommit.py --allow-modifications
|
||||
TOOL_HELP += "precommit : Run precommit checks."
|
||||
|
||||
precommitclean:
|
||||
-rm -rf $(PRECOMMITDIR)
|
||||
TOOL_HELP += "precommitclean : Remove temporary files from precommit checks."
|
||||
|
||||
# pre-commit script for manual execution ====================================
|
||||
|
||||
pre-commit:
|
||||
@$(TOOLSRC)/pre-commit-install.sh
|
||||
@$(CP2KHOME)/.pre-commit-env/bin/pre-commit run -a
|
||||
|
||||
TOOL_HELP += "pre-commit : Install pre-commit tools, register git hooks and run a full pre-commit check"
|
||||
|
||||
pre-commit-clean:
|
||||
-@$(CP2KHOME)/.pre-commit-env/bin/pre-commit uninstall
|
||||
-@$(CP2KHOME)/.pre-commit-env/bin/pre-commit clean
|
||||
-rm -rf $(CP2KHOME)/.pre-commit-env
|
||||
TOOL_HELP += "pre-commit-clean : Uninstall git hooks, drop the pre-commit tool cache and remove its environment"
|
||||
|
||||
# data stuff ================================================================
|
||||
data: data/POTENTIAL
|
||||
@:
|
||||
|
||||
data/POTENTIAL: data/GTH_POTENTIALS data/HF_POTENTIALS data/NLCC_POTENTIALS data/ALL_POTENTIALS
|
||||
@echo "(re-)generating $@ ..."
|
||||
@cat $^ > $@
|
||||
|
||||
OTHER_HELP += "data : (re-)generate merged data files (e.g. data/POTENTIALS)"
|
||||
|
||||
# automatic dependency generation ===========================================
|
||||
MAKEDEPMODE = "normal"
|
||||
ifeq ($(HACKDEP),yes)
|
||||
MAKEDEPMODE = "hackdep"
|
||||
else
|
||||
ifneq ($(MC),)
|
||||
MAKEDEPMODE = "mod_compiler"
|
||||
endif
|
||||
endif
|
||||
|
||||
# this happens on stage 3
|
||||
makedep: $(ALL_SRC_FILES) $(ALL_PKG_FILES) dirs
|
||||
ifeq ($(LD_SHARED),)
|
||||
@echo "Removing stale archives for $(ONEVERSION) ... "
|
||||
@$(TOOLSRC)/build_utils/check_archives.py $(firstword $(AR)) $(SRCDIR) $(LIBDIR)
|
||||
endif
|
||||
@echo "Resolving dependencies for $(ONEVERSION) ... "
|
||||
@$(TOOLSRC)/build_utils/makedep.py $(OBJDIR)/all.dep cp2k $(MODDEPS) $(MAKEDEPMODE) $(ARCHIVE_EXT) $(SRCDIR) $(OBJ_SRC_FILES)
|
||||
|
||||
# on stage 4, load the rules generated by makedep.py
|
||||
ifeq ($(INCLUDE_DEPS), true)
|
||||
include $(OBJDIR)/all.dep
|
||||
endif
|
||||
|
||||
|
||||
# ================= Stuff need for compiling (stage 4) ======================
|
||||
# These rules are executed in a recursive call to make -C $(OBJDIR)
|
||||
# The change of $(CURDIR) allows to find targets without abs paths and vpaths.
|
||||
|
||||
|
||||
### Slave rules ###
|
||||
vpath %.F $(ALL_SRC_DIRS)
|
||||
vpath %.h $(ALL_SRC_DIRS)
|
||||
vpath %.f90 $(ALL_SRC_DIRS)
|
||||
vpath %.cu $(ALL_SRC_DIRS)
|
||||
vpath %.c $(ALL_SRC_DIRS)
|
||||
vpath %.cpp $(ALL_SRC_DIRS)
|
||||
|
||||
#
|
||||
# Add additional dependency of cp2k_info.F to git-HEAD.
|
||||
# Ensuring that cp2k prints the correct source code revision number in its banner.
|
||||
#
|
||||
GIT_REF := ${MAINOBJDIR}/git-ref
|
||||
|
||||
# use a force (fake) target to always rebuild this file but have Make consider this updated
|
||||
# iff it was actually rewritten (a .PHONY target is always considered new)
|
||||
$(GIT_REF): FORCE
|
||||
echo $(REVISION) > "$@.tmp"
|
||||
@cmp "$@.tmp" "$@" || mv -f "$@.tmp" "$@"
|
||||
|
||||
FORCE: ;
|
||||
|
||||
cp2k_info.o: $(GIT_REF)
|
||||
|
||||
# Add some practical metadata about the build.
|
||||
FCFLAGS += -D__COMPILE_ARCH="\"$(ARCH)\""\
|
||||
-D__COMPILE_DATE="\"$(shell date)\""\
|
||||
-D__COMPILE_HOST="\"$(shell hostname 2>/dev/null || hostnamectl --transient)\""\
|
||||
-D__COMPILE_REVISION="\"$(strip $(REVISION))\""\
|
||||
-D__DATA_DIR="\"$(DATA_DIR)\""
|
||||
|
||||
# $(FCLOGPIPE) can be used to store compiler output, e.g. warnings, for each F-file separately.
|
||||
# This is used e.g. by the convention checker.
|
||||
|
||||
FYPPFLAGS ?= -n
|
||||
|
||||
%.o: %.F
|
||||
$(TOOLSRC)/build_utils/fypp $(FYPPFLAGS) $< $*.F90
|
||||
$(FC) -c $(FCFLAGS) -D__SHORT_FILE__="\"$(subst $(SRCDIR)/,,$<)\"" -I'$(dir $<)' $(OBJEXTSINCL) $*.F90 $(FCLOGPIPE)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -c $(CFLAGS) $<
|
||||
|
||||
%.o: %.cu
|
||||
$(OFFLOAD_CC) -c $(OFFLOAD_FLAGS) $<
|
||||
|
||||
# Disable built-in rules for C++.
|
||||
%.o: %.cc
|
||||
@echo "Error: C++ is not supported: $<"; false
|
||||
|
||||
%.o: %.cpp
|
||||
@echo "Error: C++ is not supported: $<"; false
|
||||
|
||||
%.o: %.C
|
||||
@echo "Error: C++ is not supported: $<"; false
|
||||
|
||||
# Begrudgingly tolerated because PyTorch has no C API.
|
||||
torch_c_api.o: torch_c_api.cpp
|
||||
$(CXX) -c $(CXXFLAGS) $<
|
||||
|
||||
ifneq ($(LIBDIR),)
|
||||
$(LIBDIR)/%:
|
||||
ifneq ($(LD_SHARED),)
|
||||
@echo "Creating shared library $@"
|
||||
@$(LD_SHARED) $(LDFLAGS) -o $(@:.a=.so) $^ $(LIBS)
|
||||
else
|
||||
@echo "Updating archive $@"
|
||||
@$(AR) $@ $?
|
||||
endif
|
||||
ifneq ($(RANLIB),)
|
||||
@$(RANLIB) $@
|
||||
endif
|
||||
endif
|
||||
|
||||
# module compiler magic =====================================================
|
||||
ifeq ($(MC),)
|
||||
#
|
||||
# here we cheat... this tells make that .mod can be generated from .o (this holds in CP2K) by doing nothing
|
||||
# it avoids recompilation if .o is more recent than .F, but .mod is older than .F
|
||||
# (because it didn't change, as e.g. g95 can do)
|
||||
#
|
||||
# this is problematic if the module names are uppercase e.g. KINDS.mod (because this rule expands to kinds.mod)
|
||||
#
|
||||
%.mod: %.o
|
||||
@true
|
||||
else
|
||||
#
|
||||
# if MC is defined, it is our 'module compiler' which generates the .mod file from the source file
|
||||
# it is useful in a two-stage compile.
|
||||
#
|
||||
%.mod: %.F
|
||||
$(MC) -c $(FCFLAGS) -D__SHORT_FILE__="\"$(subst $(SRCDIR)/,,$<)\"" $<
|
||||
endif
|
||||
|
||||
#EOF
|
||||
36
README.md
36
README.md
|
|
@ -2,8 +2,9 @@
|
|||
|
||||
[![Release Status][release-badge]][release-link] [![Debian Status][debian-badge]][debian-link]
|
||||
[![Fedora Status][fedora-badge]][fedora-link] [![Ubuntu Status][ubuntu-badge]][ubuntu-link]
|
||||
[![Homebrew Status][homebrew-badge]][homebrew-link] [![Docker Status][docker-badge]][docker-link]
|
||||
[![Spack Status][spack-badge]][spack-link] [![Conda Status][conda-badge]][conda-link]
|
||||
[![Arch Status][arch-badge]][arch-link] [![Homebrew Status][homebrew-badge]][homebrew-link]
|
||||
[![Docker Status][docker-badge]][docker-link] [![Spack Status][spack-badge]][spack-link]
|
||||
[![Conda Status][conda-badge]][conda-link]
|
||||
|
||||
CP2K is a quantum chemistry and solid state physics software package that can perform atomistic
|
||||
simulations of solid state, liquid, molecular, periodic, material, crystal, and biological systems.
|
||||
|
|
@ -15,17 +16,18 @@ Monte Carlo, Ehrenfest dynamics, vibrational analysis, core level spectroscopy,
|
|||
and transition state optimization using NEB or dimer method.
|
||||
|
||||
CP2K is written in Fortran 2008 and can be run efficiently in parallel using a combination of
|
||||
multi-threading, MPI, and GPU acceleration (CUDA for NVIDIA GPUs, HIP/ROCm for AMD GPUs, and
|
||||
OpenCL).
|
||||
multi-threading, MPI, and CUDA.
|
||||
|
||||
## Downloading CP2K source code
|
||||
|
||||
To clone the current master (development version):
|
||||
|
||||
```shell
|
||||
git clone https://github.com/cp2k/cp2k.git cp2k
|
||||
git clone --recursive https://github.com/cp2k/cp2k.git cp2k
|
||||
```
|
||||
|
||||
Note the `--recursive` flag that is needed because CP2K uses git submodules.
|
||||
|
||||
To clone a release version v*x.y*:
|
||||
|
||||
```shell
|
||||
|
|
@ -37,14 +39,10 @@ help on git, see [Git Tips & Tricks](https://github.com/cp2k/cp2k/wiki/Git-Tips-
|
|||
|
||||
## Install CP2K
|
||||
|
||||
CP2K manual provides installation instructions for below available methods:
|
||||
The easiest way to build CP2K with all of its dependencies is as a
|
||||
[Docker container](./tools/docker/README.md).
|
||||
|
||||
- [Build from Source](https://manual.cp2k.org/trunk/getting-started/build-from-source.html)
|
||||
- [Build with Spack](https://manual.cp2k.org/trunk/getting-started/build-with-spack.html)
|
||||
- [Install from Distribution](https://manual.cp2k.org/trunk/getting-started/distributions.html)
|
||||
|
||||
For building CP2K from scratch, including GPU acceleration for NVIDIA (CUDA), AMD (HIP/ROCm), or
|
||||
OpenCL devices, also see the [installation instructions](./INSTALL.md).
|
||||
For building CP2K from scratch see the [installation instructions](./INSTALL.md).
|
||||
|
||||
## Links
|
||||
|
||||
|
|
@ -61,12 +59,22 @@ OpenCL devices, also see the [installation instructions](./INSTALL.md).
|
|||
|
||||
## Directory organization
|
||||
|
||||
- [`src`](./src): The source code
|
||||
- [`arch`](./arch): Collection of definitions for different architectures and compilers
|
||||
- [`benchmarks`](./benchmarks): Inputs for benchmarks
|
||||
- [`data`](./data): Simulation parameters e.g. basis sets and pseudopotentials
|
||||
- [`exts`](./exts): Access to external libraries via GIT submodules
|
||||
- [`src`](./src): The source code
|
||||
- [`tests`](./tests): Inputs for tests and regression tests
|
||||
- [`tools`](./tools): Mixed collection of useful scripts related to cp2k
|
||||
- [`benchmarks`](./benchmarks): Inputs for benchmarks
|
||||
|
||||
Additional directories created during build process:
|
||||
|
||||
- `lib`: Libraries built during compilation
|
||||
- `obj`: Objects and other intermediate compilation-time files
|
||||
- `exe`: Where the executables will be located
|
||||
|
||||
[arch-badge]: https://img.shields.io/aur/version/cp2k
|
||||
[arch-link]: https://aur.archlinux.org/packages/cp2k
|
||||
[conda-badge]: https://img.shields.io/conda/vn/conda-forge/cp2k
|
||||
[conda-link]: https://anaconda.org/conda-forge/cp2k
|
||||
[debian-badge]: https://img.shields.io/debian/v/cp2k
|
||||
|
|
|
|||
1
REVISION
Normal file
1
REVISION
Normal file
|
|
@ -0,0 +1 @@
|
|||
git:6712648
|
||||
18
arch/Darwin-gfortran.psmp
Normal file
18
arch/Darwin-gfortran.psmp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# With GCC 4.9 or later, for gcc and gfortran
|
||||
# With a recent OpenMPI and scalapack installed
|
||||
# libxc is installed in LIBXC_INCLUDE_DIR / LIBXC_LIB_DIR
|
||||
# libint is installed in LIBINT_INCLUDE_DIR / LIBINT_LIB_DIR
|
||||
CC = gcc
|
||||
FC = mpifort
|
||||
LD = mpifort
|
||||
AR = ar -r
|
||||
RANLIB = ranlib
|
||||
CFLAGS = -O2 -fopenmp -g
|
||||
DFLAGS = -D__parallel \
|
||||
-D__NO_STATM_ACCESS -D__ACCELERATE -D__LIBXC -D__LIBINT
|
||||
FCFLAGS = -I $(LIBXC_INCLUDE_DIR) -I $(LIBINT_INCLUDE_DIR) -fopenmp -O2 -g \
|
||||
-funroll-loops -ftree-vectorize -ffree-form $(DFLAGS)
|
||||
LDFLAGS = $(FCFLAGS)
|
||||
LIBS = -framework Accelerate -lscalapack \
|
||||
-L$(LIBXC_LIB_DIR) -lxcf03 -lxc \
|
||||
-L$(LIBINT_LIB_DIR) -lint2 -lstdc++
|
||||
16
arch/Darwin-gfortran.ssmp
Normal file
16
arch/Darwin-gfortran.ssmp
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# With GCC 4.9 or later, for gcc and gfortran
|
||||
# libxc is installed in LIBXC_INCLUDE_DIR / LIBXC_LIB_DIR
|
||||
# libint is installed in LIBINT_INCLUDE_DIR / LIBINT_LIB_DIR
|
||||
CC = gcc
|
||||
FC = gfortran
|
||||
LD = gfortran
|
||||
AR = ar -r
|
||||
RANLIB = ranlib
|
||||
CFLAGS = -O2 -fopenmp -g
|
||||
DFLAGS = -D__NO_STATM_ACCESS -D__ACCELERATE -D__LIBXC -D__LIBINT
|
||||
FCFLAGS = -I $(LIBXC_INCLUDE_DIR) -I $(LIBINT_INCLUDE_DIR) -fopenmp -funroll-loops \
|
||||
-ftree-vectorize -ffree-form -O2 -g $(DFLAGS)
|
||||
LDFLAGS = $(FCFLAGS)
|
||||
LIBS = -framework Accelerate \
|
||||
-L$(LIBXC_LIB_DIR) -lxcf03 -lxc \
|
||||
-L$(LIBINT_LIB_DIR) -lint2 -lstdc++
|
||||
280
arch/Darwin-gnu-arm64.psmp
Normal file
280
arch/Darwin-gnu-arm64.psmp
Normal file
|
|
@ -0,0 +1,280 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# CP2K Darwin arch file for a parallel arm64 binary
|
||||
# (https://www.cp2k.org/howto:compile_on_macos)
|
||||
#
|
||||
# Tested with: GNU 14.1.0, OpenMPI 5.0.5,,
|
||||
# ScaLAPACK 2.2.1, OpenBLAS 0.3.27,
|
||||
# FFTW 3.3.10, HDF5 1.14.3,
|
||||
# LIBINT 2.6.0, LIBXC 6.2.2,
|
||||
# SPGLIB 2.3.1, PLUMED 2.9.0,
|
||||
# LIBVORI 220621, GSL 2.7.1,
|
||||
# COSMA 2.6.6, SIRIUS 7.5.2,
|
||||
# LIBGRPP 20231225, DFTD4 3.6.0,
|
||||
# SPFFT 1.1.0, SPLA 1.6.1
|
||||
# on an Apple M1 (macOS 14.6 Sonoma)
|
||||
#
|
||||
# Usage: Source this arch file and then run make as instructed.
|
||||
# Ensure the links in /opt/homebrew/bin to the gcc version
|
||||
# and "brew unlink openmpi" (or mpich) if installed.
|
||||
#
|
||||
# Last update: 04.08.2024
|
||||
#
|
||||
# \
|
||||
if [[ "${0}" == "${BASH_SOURCE}" ]]; then \
|
||||
echo "ERROR: Script ${0##*/} must be sourced"; \
|
||||
echo "Usage: source ${0##*/}"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
this_file=${BASH_SOURCE##*/}; \
|
||||
cd tools/toolchain; \
|
||||
rm -rf build; \
|
||||
[[ -z "${mpi_implementation}" ]] && mpi_implementation="openmpi"; \
|
||||
[[ -z "${target_cpu}" ]] && target_cpu="native"; \
|
||||
if $(command -v brew >/dev/null 2>&1); then \
|
||||
brew install cmake; \
|
||||
brew install coreutils; \
|
||||
brew install fftw; \
|
||||
brew install gcc; \
|
||||
brew install gsed; \
|
||||
brew install gsl; \
|
||||
brew install hdf5; \
|
||||
brew install libxc; \
|
||||
brew install openblas; \
|
||||
brew install pkg-config; \
|
||||
brew install wget; \
|
||||
else \
|
||||
echo "ERROR: Homebrew installation not found"; \
|
||||
echo ' Run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'; \
|
||||
cd ../..; \
|
||||
return 1; \
|
||||
fi; \
|
||||
./install_cp2k_toolchain.sh --install-all -j${maxtasks} --no-arch-files --target-cpu=${target_cpu} \
|
||||
--with-cmake=$(brew --prefix cmake) --with-elpa=no --with-fftw=$(brew --prefix fftw) --with-gcc=system \
|
||||
--with-gsl=$(brew --prefix gsl) --with-hdf5=$(brew --prefix hdf5) --with-libxc=$(brew --prefix libxc) \
|
||||
--with-libxsmm=no --with-openblas=$(brew --prefix openblas) --with-${mpi_implementation} \
|
||||
--with-pexsi=no --with-quip=no; \
|
||||
source ./install/setup; \
|
||||
cd ../..; \
|
||||
echo; \
|
||||
echo "Check the output above for error messages and consistency!"; \
|
||||
echo; \
|
||||
echo "If everything is OK, you can build a CP2K production binary with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.}"; \
|
||||
echo; \
|
||||
echo "Alternatively, you can add further checks, e.g. for regression testing, with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.} DO_CHECKS=yes"; \
|
||||
echo; \
|
||||
echo "Run always the following command before using the CP2K binary"; \
|
||||
echo " source ${PWD}/tools/toolchain/install/setup"; \
|
||||
echo; \
|
||||
return
|
||||
|
||||
# Set options
|
||||
DO_CHECKS := no
|
||||
TARGET_CPU := native
|
||||
GNU_VER := $(shell gcc -dumpfullversion)
|
||||
USE_COSMA := 2.6.6
|
||||
USE_DFTD4 := 3.6.0
|
||||
USE_LIBGRPP := 20231225
|
||||
USE_LIBINT := 2.6.0
|
||||
USE_LIBVORI := 220621
|
||||
USE_PLUMED := 2.9.0
|
||||
USE_SCALAPACK := 2.2.1
|
||||
USE_SIRIUS := 7.5.2
|
||||
USE_SPFFT := 1.1.0
|
||||
USE_SPGLIB := 2.3.1
|
||||
USE_SPLA := 1.6.1
|
||||
# Only needed for SIRIUS
|
||||
LIBVDWXC_VER := 0.4.0
|
||||
|
||||
LMAX := 5
|
||||
MAX_CONTR := 4
|
||||
|
||||
CC := mpicc
|
||||
FC := mpifort
|
||||
LD := mpifort
|
||||
AR := ar -r -s
|
||||
|
||||
CFLAGS := -O2 -fopenmp -fopenmp-simd -ftree-vectorize -funroll-loops -g -mtune=$(TARGET_CPU)
|
||||
|
||||
DFLAGS := -D__parallel
|
||||
DFLAGS += -D__ACCELERATE
|
||||
DFLAGS += -D__MPI_F08
|
||||
DFLAGS += -D__HAS_IEEE_EXCEPTIONS
|
||||
DFLAGS += -D__MAX_CONTR=$(strip $(MAX_CONTR))
|
||||
DFLAGS += -D__NO_STATM_ACCESS
|
||||
|
||||
INSTALL_PATH := $(PWD)/tools/toolchain/install
|
||||
|
||||
# Settings for regression testing
|
||||
ifeq ($(DO_CHECKS), yes)
|
||||
DFLAGS += -D__CHECK_DIAG
|
||||
FCFLAGS_DEBUG := -fcheck=bounds,do,recursion,pointer
|
||||
FCFLAGS_DEBUG += -fcheck=all,no-array-temps
|
||||
# FCFLAGS_DEBUG += -ffpe-trap=invalid,overflow,zero
|
||||
FCFLAGS_DEBUG += -fimplicit-none
|
||||
FCFLAGS_DEBUG += -finit-derived
|
||||
FCFLAGS_DEBUG += -finit-real=snan
|
||||
FCFLAGS_DEBUG += -finit-integer=-42
|
||||
FCFLAGS_DEBUG += -finline-matmul-limit=0
|
||||
WFLAGS := -Werror=aliasing
|
||||
WFLAGS += -Werror=ampersand
|
||||
WFLAGS += -Werror=c-binding-type
|
||||
WFLAGS += -Werror=conversion
|
||||
WFLAGS += -Werror=intrinsic-shadow
|
||||
WFLAGS += -Werror=intrinsics-std
|
||||
WFLAGS += -Werror=line-truncation
|
||||
WFLAGS += -Wrealloc-lhs
|
||||
WFLAGS += -Werror=tabs
|
||||
WFLAGS += -Werror=target-lifetime
|
||||
WFLAGS += -Werror=underflow
|
||||
WFLAGS += -Werror=unused-but-set-variable
|
||||
WFLAGS += -Werror=unused-dummy-argument
|
||||
WFLAGS += -Werror=unused-variable
|
||||
endif
|
||||
|
||||
ifneq ($(USE_PLUMED),)
|
||||
USE_GSL := 2.7
|
||||
USE_PLUMED := $(strip $(USE_PLUMED))
|
||||
PLUMED_LIB := $(INSTALL_PATH)/plumed-$(USE_PLUMED)/lib
|
||||
DFLAGS += -D__PLUMED2
|
||||
LIBS += $(PLUMED_LIB)/libplumed.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBVORI),)
|
||||
USE_LIBVORI := $(strip $(USE_LIBVORI))
|
||||
LIBVORI_LIB := $(INSTALL_PATH)/libvori-$(USE_LIBVORI)/lib
|
||||
DFLAGS += -D__LIBVORI
|
||||
LIBS += $(LIBVORI_LIB)/libvori.a
|
||||
endif
|
||||
|
||||
LIBXC_HOME := $(shell brew --prefix libxc)
|
||||
CFLAGS += -I$(LIBXC_HOME)/include
|
||||
DFLAGS += -D__LIBXC
|
||||
LIBS += -Wl,-rpath,$(LIBXC_HOME)/lib -L$(LIBXC_HOME)/lib -lxcf03 -lxc
|
||||
|
||||
ifneq ($(USE_DFTD4),)
|
||||
USE_DFTD4 := $(strip $(USE_DFTD4))
|
||||
DFTD4_INC := $(INSTALL_PATH)/dftd4-$(USE_DFTD4)/include
|
||||
DFTD4_LIB := $(INSTALL_PATH)/dftd4-$(USE_DFTD4)/lib
|
||||
CFLAGS += -I$(DFTD4_INC)/dftd4/GNU-$(GNU_VER)
|
||||
DFLAGS += -D__DFTD4
|
||||
LIBS += -L$(DFTD4_LIB) -ldftd4 -lmstore -lmulticharge -lmctc-lib
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBGRPP),)
|
||||
USE_LIBGRPP := $(strip $(USE_LIBGRPP))
|
||||
LIBGRPP_INC := $(INSTALL_PATH)/libgrpp-main-$(USE_LIBGRPP)/include
|
||||
LIBGRPP_LIB := $(INSTALL_PATH)/libgrpp-main-$(USE_LIBGRPP)/lib
|
||||
CFLAGS += -I$(LIBGRPP_INC)
|
||||
DFLAGS += -D__LIBGRPP
|
||||
LIBS += $(LIBGRPP_LIB)/liblibgrpp.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBINT),)
|
||||
USE_LIBINT := $(strip $(USE_LIBINT))
|
||||
LMAX := $(strip $(LMAX))
|
||||
LIBINT_INC := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/include
|
||||
LIBINT_LIB := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/lib
|
||||
CFLAGS += -I$(LIBINT_INC)
|
||||
DFLAGS += -D__LIBINT
|
||||
LIBS += $(LIBINT_LIB)/libint2.a
|
||||
LIBS += $(LIBINT_LIB)/libint2.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPGLIB),)
|
||||
USE_SPGLIB := $(strip $(USE_SPGLIB))
|
||||
SPGLIB_INC := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/include
|
||||
SPGLIB_LIB := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/lib
|
||||
CFLAGS += -I$(SPGLIB_INC)
|
||||
DFLAGS += -D__SPGLIB
|
||||
LIBS += $(SPGLIB_LIB)/libsymspg.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SIRIUS),)
|
||||
USE_SIRIUS := $(strip $(USE_SIRIUS))
|
||||
LIBVDWXC_VER := $(strip $(LIBVDWXC_VER))
|
||||
LIBVDWXC_INC := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/include
|
||||
LIBVDWXC_LIB := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/lib
|
||||
SIRIUS_INC := $(INSTALL_PATH)/sirius-$(USE_SIRIUS)/include
|
||||
SIRIUS_LIB := $(INSTALL_PATH)/sirius-$(USE_SIRIUS)/lib
|
||||
CFLAGS += -I$(LIBVDWXC_INC)
|
||||
CFLAGS += -I$(SIRIUS_INC)
|
||||
DFLAGS += -D__LIBVDWXC
|
||||
DFLAGS += -D__SIRIUS
|
||||
LIBS += $(SIRIUS_LIB)/libsirius.a
|
||||
LIBS += $(LIBVDWXC_LIB)/libvdwxc.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPFFT),)
|
||||
USE_SPFFT := $(strip $(USE_SPFFT))
|
||||
SPFFT_INC := $(INSTALL_PATH)/SpFFT-$(USE_SPFFT)/include
|
||||
SPFFT_LIB := $(INSTALL_PATH)/SpFFT-$(USE_SPFFT)/lib
|
||||
CFLAGS += -I$(SPFFT_INC)
|
||||
DFLAGS += -D__SPFFT
|
||||
LIBS += $(SPFFT_LIB)/libspfft.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPLA),)
|
||||
USE_SPLA := $(strip $(USE_SPLA))
|
||||
SPLA_INC := $(INSTALL_PATH)/SpLA-$(USE_SPLA)/include/spla
|
||||
SPLA_LIB := $(INSTALL_PATH)/SpLA-$(USE_SPLA)/lib
|
||||
CFLAGS += -I$(SPLA_INC)
|
||||
DFLAGS += -D__SPLA
|
||||
LIBS += $(SPLA_LIB)/libspla.a
|
||||
endif
|
||||
|
||||
HDF5_HOME := $(shell brew --prefix hdf5)
|
||||
CFLAGS += -I$(HDF5_HOME)/include
|
||||
DFLAGS += -D__HDF5
|
||||
LIBS += $(HDF5_HOME)/lib/libhdf5_fortran.a
|
||||
LIBS += $(HDF5_HOME)/lib/libhdf5_f90cstub.a
|
||||
LIBS += $(HDF5_HOME)/lib/libhdf5.a
|
||||
LIBS += $(shell brew --prefix libaec)/lib/libsz.a
|
||||
|
||||
ifneq ($(USE_COSMA),)
|
||||
USE_COSMA := $(strip $(USE_COSMA))
|
||||
COSMA_INC := $(INSTALL_PATH)/COSMA-$(USE_COSMA)/include
|
||||
COSMA_LIB := $(INSTALL_PATH)/COSMA-$(USE_COSMA)/lib
|
||||
CFLAGS += -I$(COSMA_INC)
|
||||
DFLAGS += -D__COSMA
|
||||
LIBS += $(COSMA_LIB)/libcosma_prefixed_pxgemm.a
|
||||
LIBS += $(COSMA_LIB)/libcosma.a
|
||||
LIBS += $(COSMA_LIB)/libcosta.a
|
||||
endif
|
||||
|
||||
FFTW_HOME := $(shell brew --prefix fftw)
|
||||
CFLAGS += -I$(FFTW_HOME)/include
|
||||
DFLAGS += -D__FFTW3
|
||||
LIBS += $(FFTW_HOME)/lib/libfftw3_mpi.a
|
||||
LIBS += $(FFTW_HOME)/lib/libfftw3_omp.a
|
||||
LIBS += $(FFTW_HOME)/lib/libfftw3.a
|
||||
|
||||
USE_SCALAPACK := $(strip $(USE_SCALAPACK))
|
||||
LIBS += $(INSTALL_PATH)/scalapack-$(USE_SCALAPACK)/lib/libscalapack.a
|
||||
|
||||
GSL_HOME := $(shell brew --prefix gsl)
|
||||
CFLAGS += -I$(GSL_HOME)/include
|
||||
DFLAGS += -D__GSL
|
||||
LIBS += $(GSL_HOME)/lib/libgsl.a
|
||||
|
||||
OPENBLAS_HOME := $(shell brew --prefix openblas)
|
||||
CFLAGS += -I$(OPENBLAS_HOME)/include
|
||||
LIBS += $(OPENBLAS_HOME)/lib/libopenblas.a
|
||||
|
||||
CFLAGS += $(DFLAGS)
|
||||
|
||||
FCFLAGS := $(CFLAGS) $(FCFLAGS_DEBUG) $(WFLAGS)
|
||||
FCFLAGS += -fallow-argument-mismatch
|
||||
FCFLAGS += -fbacktrace
|
||||
FCFLAGS += -ffree-form
|
||||
FCFLAGS += -ffree-line-length-none
|
||||
FCFLAGS += -fno-omit-frame-pointer
|
||||
FCFLAGS += -std=f2008
|
||||
|
||||
LDFLAGS += $(FCFLAGS) -ld_classic
|
||||
|
||||
LIBS += -lz -ldl -lstdc++
|
||||
|
||||
# End
|
||||
187
arch/Darwin-gnu-arm64.ssmp
Normal file
187
arch/Darwin-gnu-arm64.ssmp
Normal file
|
|
@ -0,0 +1,187 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# CP2K Darwin arch file for a serial arm64 binary
|
||||
# (https://www.cp2k.org/howto:compile_on_macos)
|
||||
#
|
||||
# Tested with: GNU 14.1.0, FFTW 3.3.10, LIBINT 2.6.0, LIBVORI 220621,
|
||||
# LIBXC 6.2.2, OpenBLAS 0.3.27, SPGLIB 2.3.1,
|
||||
# LIBGRPP 20231225, DFTD4 3.6.0,
|
||||
# on an Apple M1 (macOS 14.6 Sonoma)
|
||||
#
|
||||
# Usage: Source this arch file and then run make as instructed.
|
||||
# Ensure the links in /opt/homebrew/bin to the gcc version.
|
||||
#
|
||||
# Last update: 04.08.2024
|
||||
#
|
||||
# \
|
||||
if [[ "${0}" == "${BASH_SOURCE}" ]]; then \
|
||||
echo "ERROR: Script ${0##*/} must be sourced"; \
|
||||
echo "Usage: source ${0##*/}"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
this_file=${BASH_SOURCE##*/}; \
|
||||
cd tools/toolchain; \
|
||||
rm -rf build; \
|
||||
[[ -z "${target_cpu}" ]] && target_cpu="native"; \
|
||||
if $(command -v brew >/dev/null 2>&1); then \
|
||||
brew install cmake; \
|
||||
brew install coreutils; \
|
||||
brew install fftw; \
|
||||
brew install gcc; \
|
||||
brew install libxc; \
|
||||
brew install openblas; \
|
||||
brew install pkg-config; \
|
||||
brew install wget; \
|
||||
else \
|
||||
echo "ERROR: Homebrew installation not found"; \
|
||||
echo ' Run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'; \
|
||||
cd ../..; \
|
||||
return 1; \
|
||||
fi; \
|
||||
./install_cp2k_toolchain.sh -j${maxtasks} --mpi-mode=no --no-arch-files --target-cpu=${target_cpu} \
|
||||
--with-cmake=$(brew --prefix cmake) --with-fftw=$(brew --prefix fftw) --with-gcc=system \
|
||||
--with-libxc=$(brew --prefix libxc) --with-libxsmm=no --with-openblas=$(brew --prefix openblas); \
|
||||
source ./install/setup; \
|
||||
cd ../..; \
|
||||
echo; \
|
||||
echo "Check the output above for error messages and consistency!"; \
|
||||
echo; \
|
||||
echo "If everything is OK, you can build a CP2K production binary with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.}"; \
|
||||
echo; \
|
||||
echo "Alternatively, you can add further checks, e.g. for regression testing, with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.} DO_CHECKS=yes"; \
|
||||
echo; \
|
||||
echo "Run always the following command before using the CP2K binary"; \
|
||||
echo " source ${PWD}/tools/toolchain/install/setup"; \
|
||||
echo; \
|
||||
return
|
||||
|
||||
# Set options
|
||||
DO_CHECKS := no
|
||||
TARGET_CPU := native
|
||||
USE_DFTD4 := 3.6.0
|
||||
USE_LIBGRPP := 20231225
|
||||
USE_LIBINT := 2.6.0
|
||||
USE_LIBVORI := 220621
|
||||
USE_SPGLIB := 2.3.1
|
||||
|
||||
LMAX := 5
|
||||
MAX_CONTR := 4
|
||||
|
||||
CC := gcc
|
||||
CXX := g++
|
||||
FC := gfortran
|
||||
LD := gfortran
|
||||
AR := ar -r -s
|
||||
|
||||
CFLAGS := -O2 -fopenmp -fopenmp-simd -ftree-vectorize -funroll-loops -g -mtune=$(TARGET_CPU)
|
||||
|
||||
DFLAGS += -D__ACCELERATE
|
||||
DFLAGS += -D__MAX_CONTR=$(strip $(MAX_CONTR))
|
||||
DFLAGS += -D__NO_STATM_ACCESS
|
||||
|
||||
INSTALL_PATH := $(PWD)/tools/toolchain/install
|
||||
|
||||
# Settings for regression testing
|
||||
ifeq ($(DO_CHECKS), yes)
|
||||
DFLAGS += -D__CHECK_DIAG
|
||||
FCFLAGS_DEBUG := -fcheck=bounds,do,recursion,pointer
|
||||
FCFLAGS_DEBUG += -fcheck=all,no-array-temps
|
||||
# FCFLAGS_DEBUG += -ffpe-trap=invalid,overflow,zero
|
||||
FCFLAGS_DEBUG += -fimplicit-none
|
||||
FCFLAGS_DEBUG += -finit-derived
|
||||
FCFLAGS_DEBUG += -finit-real=snan
|
||||
FCFLAGS_DEBUG += -finit-integer=-42
|
||||
FCFLAGS_DEBUG += -finline-matmul-limit=0
|
||||
WFLAGS := -Werror=aliasing
|
||||
WFLAGS += -Werror=ampersand
|
||||
WFLAGS += -Werror=c-binding-type
|
||||
WFLAGS += -Werror=conversion
|
||||
WFLAGS += -Werror=intrinsic-shadow
|
||||
WFLAGS += -Werror=intrinsics-std
|
||||
WFLAGS += -Werror=line-truncation
|
||||
WFLAGS += -Wrealloc-lhs
|
||||
WFLAGS += -Werror=tabs
|
||||
WFLAGS += -Werror=target-lifetime
|
||||
WFLAGS += -Werror=underflow
|
||||
WFLAGS += -Werror=unused-but-set-variable
|
||||
WFLAGS += -Werror=unused-dummy-argument
|
||||
WFLAGS += -Werror=unused-variable
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBVORI),)
|
||||
USE_LIBVORI := $(strip $(USE_LIBVORI))
|
||||
LIBVORI_LIB := $(INSTALL_PATH)/libvori-$(USE_LIBVORI)/lib
|
||||
DFLAGS += -D__LIBVORI
|
||||
LIBS += $(LIBVORI_LIB)/libvori.a
|
||||
endif
|
||||
|
||||
LIBXC_HOME := $(shell brew --prefix libxc)
|
||||
CFLAGS += -I$(LIBXC_HOME)/include
|
||||
DFLAGS += -D__LIBXC
|
||||
LIBS += -Wl,-rpath,$(LIBXC_HOME)/lib -L$(LIBXC_HOME)/lib -lxcf03 -lxc
|
||||
|
||||
ifneq ($(USE_DFTD4),)
|
||||
USE_DFTD4 := $(strip $(USE_DFTD4))
|
||||
DFTD4_INC := $(INSTALL_PATH)/dftd4-$(USE_DFTD4)/include
|
||||
DFTD4_LIB := $(INSTALL_PATH)/dftd4-$(USE_DFTD4)/lib
|
||||
CFLAGS += -I$(DFTD4_INC)/dftd4/GNU-$(GNU_VER)
|
||||
DFLAGS += -D__DFTD4
|
||||
LIBS += -L$(DFTD4_LIB) -ldftd4 -lmstore -lmulticharge -lmctc-lib
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBGRPP),)
|
||||
USE_LIBGRPP := $(strip $(USE_LIBGRPP))
|
||||
LIBGRPP_INC := $(INSTALL_PATH)/libgrpp-main-$(USE_LIBGRPP)/include
|
||||
LIBGRPP_LIB := $(INSTALL_PATH)/libgrpp-main-$(USE_LIBGRPP)/lib
|
||||
CFLAGS += -I$(LIBGRPP_INC)
|
||||
DFLAGS += -D__LIBGRPP
|
||||
LIBS += $(LIBGRPP_LIB)/liblibgrpp.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBINT),)
|
||||
USE_LIBINT := $(strip $(USE_LIBINT))
|
||||
LMAX := $(strip $(LMAX))
|
||||
LIBINT_INC := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/include
|
||||
LIBINT_LIB := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/lib
|
||||
CFLAGS += -I$(LIBINT_INC)
|
||||
DFLAGS += -D__LIBINT
|
||||
LIBS += $(LIBINT_LIB)/libint2.a
|
||||
LIBS += $(LIBINT_LIB)/libint2.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPGLIB),)
|
||||
USE_SPGLIB := $(strip $(USE_SPGLIB))
|
||||
SPGLIB_INC := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/include
|
||||
SPGLIB_LIB := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/lib
|
||||
CFLAGS += -I$(SPGLIB_INC)
|
||||
DFLAGS += -D__SPGLIB
|
||||
LIBS += $(SPGLIB_LIB)/libsymspg.a
|
||||
endif
|
||||
|
||||
FFTW_HOME := $(shell brew --prefix fftw)
|
||||
CFLAGS += -I$(FFTW_HOME)/include
|
||||
DFLAGS += -D__FFTW3
|
||||
LIBS += $(FFTW_HOME)/lib/libfftw3_omp.a
|
||||
LIBS += $(FFTW_HOME)/lib/libfftw3.a
|
||||
|
||||
OPENBLAS_HOME := $(shell brew --prefix openblas)
|
||||
CFLAGS += -I$(OPENBLAS_HOME)/include
|
||||
LIBS += $(OPENBLAS_HOME)/lib/libopenblas.a
|
||||
|
||||
CFLAGS += $(DFLAGS)
|
||||
|
||||
FCFLAGS := $(CFLAGS) $(FCFLAGS_DEBUG) $(WFLAGS)
|
||||
FCFLAGS += -fallow-argument-mismatch
|
||||
FCFLAGS += -fbacktrace
|
||||
FCFLAGS += -ffree-form
|
||||
FCFLAGS += -ffree-line-length-none
|
||||
FCFLAGS += -fno-omit-frame-pointer
|
||||
FCFLAGS += -std=f2008
|
||||
|
||||
LDFLAGS += $(FCFLAGS) -ld_classic
|
||||
|
||||
LIBS += -ldl -lstdc++
|
||||
|
||||
# End
|
||||
137
arch/Eiger-gfortran.psmp
Normal file
137
arch/Eiger-gfortran.psmp
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
# === For the CSCS HPE Cray EX System Alps (Eiger) ====
|
||||
# Uses only libraries provided by CSCS in the cpeGNU environment.
|
||||
#
|
||||
# USAGE:
|
||||
# 1. source this arch file to load the required modules:
|
||||
# source arch/Eiger-gfortran.psmp
|
||||
# 2. follow the printed instructions
|
||||
# 3. Optionally: use some of the options below to tune the installation
|
||||
# 4. To run a calculation: no module has to be loaded
|
||||
#
|
||||
# \
|
||||
module load cray/21.12 ; \
|
||||
module load cpeGNU/21.12 ; \
|
||||
module load \
|
||||
cray-fftw \
|
||||
ELPA/2021.11.001 \
|
||||
libxsmm/1.17 \
|
||||
libxc/5.1.7 \
|
||||
Libint-CP2K/2.6.0 \
|
||||
SIRIUS/7.3.1 \
|
||||
spglib/1.16.3 \
|
||||
libvori/210412 \
|
||||
PLUMED/2.7.3 \
|
||||
cray-mpich/8.1.12 \
|
||||
; \
|
||||
module list ; \
|
||||
module save cp2k_gfortran_psmp ; \
|
||||
echo "Please check the output above for error messages!" ; \
|
||||
echo "If everything is OK, build CP2K with:" ; \
|
||||
echo " make -j ARCH=Eiger-gfortran VERSION=psmp" ; \
|
||||
echo "" ; \
|
||||
echo "To load the required modules in your sbatch script, use:" ; \
|
||||
echo " module restore cp2k_gfortran_psmp" ; \
|
||||
/usr/bin/test _`echo is_csh 2>/dev/null` != _is_csh && exit ; \
|
||||
return
|
||||
|
||||
# === OPTIONS ===
|
||||
# To disable/enable them add them to the make call:
|
||||
# ex.: make -j ARCH=Eiger-gfortran VERSION=psmp USE_ELPA=0
|
||||
|
||||
# NOTES:
|
||||
# Current versions of ELPA, SIRIUS, LIBVORI and PLUMED provided by CSCS on Eiger are too old to run
|
||||
# with the current development version of CP2K. The user should install these via the toolchain,
|
||||
# in case they should need these libraries.
|
||||
|
||||
WITH_MKL=0
|
||||
|
||||
USE_ELPA=0
|
||||
USE_LIBINT=1
|
||||
USE_SIRIUS=0
|
||||
USE_SPGLIB=1
|
||||
USE_LIBVORI=0
|
||||
USE_PLUMED=0
|
||||
|
||||
CHECKS=0
|
||||
|
||||
# === PRE-PROCESSOR FLAGS (base) ===
|
||||
DFLAGS = -D__parallel \
|
||||
-D__FFTW3 \
|
||||
-D__LIBXSMM \
|
||||
-D__LIBXC
|
||||
|
||||
# === LIBRARIES and MODULES ===
|
||||
|
||||
LIBS += -lfftw3 -lfftw3_omp
|
||||
|
||||
LIBS += -lxcf03 -lxc
|
||||
INCS += -I$(EBROOTLIBXC)/include
|
||||
|
||||
LIBS += -lxsmmf -lxsmm -ldl
|
||||
INCS += -I$(EBROOTLIBXSMM)/include
|
||||
|
||||
ifeq ($(USE_ELPA),1)
|
||||
DFLAGS += -D__ELPA
|
||||
LIBS += -lelpa_openmp
|
||||
INCS += -I$(ELPA_INCLUDE_DIR)/modules
|
||||
endif
|
||||
|
||||
ifeq ($(USE_LIBINT),1)
|
||||
DFLAGS += -D__LIBINT -D__MAX_CONTR=4
|
||||
LIBS += -lint2 -lstdc++
|
||||
INCS += -I$(EBROOTLIBINTMINCP2K)/include
|
||||
endif
|
||||
|
||||
ifeq ($(USE_SIRIUS),1)
|
||||
DFLAGS += -D__SIRIUS
|
||||
LIBS += -lsirius
|
||||
INCS += -I$(EBROOTSIRIUS)/include/sirius
|
||||
endif
|
||||
|
||||
ifeq ($(USE_SPGLIB),1)
|
||||
DFLAGS += -D__SPGLIB
|
||||
LIBS += -lsymspg
|
||||
INCS += -I$(EBROOTSPGLIB)/include
|
||||
endif
|
||||
|
||||
ifeq ($(USE_LIBVORI),1)
|
||||
DFLAGS += -D__LIBVORI
|
||||
LIBS += $(EBROOTLIBVORI)/lib/libvori.a
|
||||
endif
|
||||
|
||||
ifeq ($(USE_PLUMED),1)
|
||||
DFLAGS += -D__PLUMED2
|
||||
LIBS += -lplumed
|
||||
endif
|
||||
|
||||
ifeq ($(WITH_MKL),1)
|
||||
LIBS += -L/opt/intel/mkl/lib/intel64 -Wl,-rpath=/opt/intel/mkl/lib/intel64 \
|
||||
-lmkl_scalapack_lp64 \
|
||||
-Wl,--start-group \
|
||||
-lmkl_gf_lp64 \
|
||||
-lmkl_sequential \
|
||||
-lmkl_core \
|
||||
-lmkl_blacs_intelmpi_lp64 \
|
||||
-Wl,--end-group
|
||||
INCS += -I/opt/intel/mkl/include
|
||||
endif
|
||||
|
||||
# === BINARIES (COMPILER, LINKER, ...) ===
|
||||
CC = cc
|
||||
CXX = CC
|
||||
FC = ftn
|
||||
LD = ftn
|
||||
AR = ar -r
|
||||
|
||||
# === COMPILER FLAGS ===
|
||||
AFLAGS = $(DFLAGS) $(INCS) -g1 -fopenmp -O3 -funroll-loops
|
||||
FCFLAGS = $(AFLAGS) -ffree-form -ffree-line-length-512 -fallow-argument-mismatch
|
||||
CFLAGS = $(AFLAGS)
|
||||
CXXFLAGS = $(AFLAGS)
|
||||
LDFLAGS = $(FCFLAGS)
|
||||
|
||||
# -fallow-argument-mismatch: needed for (Cray-)MPICH and tightened interface requirements introduced in GCC-10
|
||||
|
||||
ifeq ($(CHECKS),1)
|
||||
FCFLAGS += -g -fcheck=bounds,do,recursion,pointer -Wconversion -fbacktrace
|
||||
endif
|
||||
383
arch/Eiger-mc-gnu.psmp
Normal file
383
arch/Eiger-mc-gnu.psmp
Normal file
|
|
@ -0,0 +1,383 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# CP2K (GNU x86_64) arch file for the Alps/Eiger (AMD Zen 2) multi-core (mc) cluster at CSCS
|
||||
#
|
||||
# Tested with: GNU 12.3.0, Cray-MPICH 8.1.28, Cray-libsci 23.12.5,
|
||||
# LIBINT 2.6.0, LIBXC 6.2.2, ELPA 2024.03.001,
|
||||
# PLUMED 2.9.0, SPGLIB 2.3.1, LIBVORI 220621,
|
||||
# GSL 2.7, COSMA 2.6.6, HDF5 1.14.2, SIRIUS 7.5.2,
|
||||
# LIBGRPP 20231225, SPFFT 1.1.0, SPLA 1.6.1,
|
||||
# DFTD4 3.6.0, QUIP 0.9.10
|
||||
# on the Alps/Eiger (CSCS)
|
||||
#
|
||||
# Usage: Source this arch file and then run make as instructed.
|
||||
# Replace or adapt the "module load" commands below if needed.
|
||||
#
|
||||
# Last update: 04.08.2024
|
||||
#
|
||||
# \
|
||||
if [[ "${0}" == "${BASH_SOURCE}" ]]; then \
|
||||
echo "ERROR: Script ${0##*/} must be sourced"; \
|
||||
echo "Usage: source ${0##*/}"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
this_file=${BASH_SOURCE##*/}; \
|
||||
cd tools/toolchain; \
|
||||
rm -rf build; \
|
||||
module load cray; \
|
||||
module load cpeGNU; \
|
||||
module load cray-fftw; \
|
||||
module list; \
|
||||
export CRAY_LIBSCI_PREFIX_DIR=${CRAY_PE_LIBSCI_PREFIX_DIR}; \
|
||||
export CPATH=${CPATH}:${CRAY_PE_LIBSCI_PREFIX_DIR}/include; \
|
||||
export COSMA_SCALAPACK_LINK_LIBRARIES=${CRAY_PE_LIBSCI_PREFIX_DIR}; \
|
||||
[[ -z "${TARGET_CPU}" ]] && export TARGET_CPU="native"; \
|
||||
./install_cp2k_toolchain.sh -j32 --enable-cray --no-arch-files --target-cpu=${TARGET_CPU} --with-dftd4 --with-fftw --with-libtorch=no --with-libvdwxc --with-libxsmm --with-pexsi --with-plumed --with-quip; \
|
||||
source ./install/setup; \
|
||||
cd ../..; \
|
||||
echo; \
|
||||
echo "Check the output above for error messages and consistency!"; \
|
||||
echo; \
|
||||
echo "If everything is OK, you can build a CP2K production binary with"; \
|
||||
echo " make -j32 ARCH=${this_file%.*} VERSION=${this_file##*.} TARGET_CPU=${TARGET_CPU}"; \
|
||||
echo; \
|
||||
echo "Alternatively, you can add further checks, e.g. for regression testing, with"; \
|
||||
echo " make -j32 ARCH=${this_file%.*} VERSION=${this_file##*.} TARGET_CPU=${TARGET_CPU} DO_CHECKS=yes"; \
|
||||
echo; \
|
||||
return
|
||||
|
||||
# Set options
|
||||
DO_CHECKS := no
|
||||
SHARED := no
|
||||
TARGET_CPU := native
|
||||
USE_COSMA := 2.6.6
|
||||
USE_DFTD4 := 3.6.0
|
||||
USE_ELPA := 2024.03.001
|
||||
USE_HDF5 := 1.14.2
|
||||
USE_LIBGRPP := 20231225
|
||||
USE_LIBINT := 2.6.0
|
||||
USE_LIBPEXSI := 1.2.0
|
||||
#USE_LIBTORCH := 1.12.1
|
||||
USE_LIBVORI := 220621
|
||||
USE_LIBXC := 6.2.2
|
||||
#USE_LIBXSMM := 1.17
|
||||
USE_PLUMED := 2.9.0
|
||||
USE_QUIP := 0.9.10
|
||||
USE_SIRIUS := 7.5.2
|
||||
USE_SPFFT := 1.1.0
|
||||
USE_SPGLIB := 2.3.1
|
||||
USE_SPLA := 1.6.1
|
||||
# Only needed for SIRIUS
|
||||
LIBVDWXC_VER := 0.4.0
|
||||
# Only needed for LIBPEXSI
|
||||
SCOTCH_VER := 6.0.0
|
||||
SUPERLU_VER := 6.1.0
|
||||
|
||||
CC := cc
|
||||
CXX := CC
|
||||
FC := ftn
|
||||
LD := ftn
|
||||
AR := ar -r
|
||||
|
||||
GNU_VER := $(shell $(CC) -dumpfullversion)
|
||||
|
||||
LMAX := 5
|
||||
MAX_CONTR := 4
|
||||
|
||||
ifeq ($(TARGET_CPU), generic)
|
||||
CFLAGS := -O2 -fopenmp -fopenmp-simd -ftree-vectorize -funroll-loops -g -mtune=$(TARGET_CPU)
|
||||
else
|
||||
CFLAGS := -O2 -fopenmp -fopenmp-simd -ftree-vectorize -funroll-loops -g -march=$(TARGET_CPU) -mtune=$(TARGET_CPU)
|
||||
endif
|
||||
|
||||
DFLAGS := -D__parallel
|
||||
DFLAGS += -D__FFTW3
|
||||
DFLAGS += -D__HAS_IEEE_EXCEPTIONS
|
||||
DFLAGS += -D__MAX_CONTR=$(strip $(MAX_CONTR))
|
||||
|
||||
INSTALL_PATH := $(PWD)/tools/toolchain/install
|
||||
|
||||
ifeq ($(SHARED), yes)
|
||||
LD_SHARED := $(FC) -shared
|
||||
CFLAGS += -fPIC
|
||||
LDFLAGS := -Wl,--enable-new-dtags
|
||||
CP2K_LIB := $(PWD)/lib/$(ARCH)/$(ONEVERSION)
|
||||
LDFLAGS += -Wl,-rpath=$(CP2K_LIB)
|
||||
LDFLAGS += -Wl,-rpath=$(CP2K_LIB)/exts/dbcsr
|
||||
endif
|
||||
|
||||
# Settings for regression testing
|
||||
ifeq ($(DO_CHECKS), yes)
|
||||
DFLAGS += -D__CHECK_DIAG
|
||||
endif
|
||||
|
||||
ifneq ($(USE_PLUMED),)
|
||||
USE_PLUMED := $(strip $(USE_PLUMED))
|
||||
PLUMED_LIB := $(INSTALL_PATH)/plumed-$(USE_PLUMED)/lib
|
||||
DFLAGS += -D__PLUMED2
|
||||
USE_GSL := 2.7
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(PLUMED_LIB) -L$(PLUMED_LIB) -lplumed -lplumedKernel
|
||||
else
|
||||
LIBS += $(PLUMED_LIB)/libplumed.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_ELPA),)
|
||||
USE_ELPA := $(strip $(USE_ELPA))
|
||||
ELPA_INC := $(INSTALL_PATH)/elpa-$(USE_ELPA)/cpu/include/elpa_openmp-$(USE_ELPA)
|
||||
ELPA_LIB := $(INSTALL_PATH)/elpa-$(USE_ELPA)/cpu/lib
|
||||
CFLAGS += -I$(ELPA_INC)/elpa -I$(ELPA_INC)/modules
|
||||
DFLAGS += -D__ELPA
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(ELPA_LIB) -L$(ELPA_LIB) -lelpa_openmp
|
||||
else
|
||||
LIBS += $(ELPA_LIB)/libelpa_openmp.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_QUIP),)
|
||||
USE_QUIP := $(strip $(USE_QUIP))
|
||||
QUIP_INC := $(INSTALL_PATH)/quip-$(USE_QUIP)/include
|
||||
QUIP_LIB := $(INSTALL_PATH)/quip-$(USE_QUIP)/lib
|
||||
CFLAGS += -I$(QUIP_INC)
|
||||
DFLAGS += -D__QUIP
|
||||
LIBS += $(QUIP_LIB)/libquip_core.a
|
||||
LIBS += $(QUIP_LIB)/libatoms.a
|
||||
LIBS += $(QUIP_LIB)/libFoX_sax.a
|
||||
LIBS += $(QUIP_LIB)/libFoX_common.a
|
||||
LIBS += $(QUIP_LIB)/libFoX_utils.a
|
||||
LIBS += $(QUIP_LIB)/libFoX_fsys.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBPEXSI),)
|
||||
USE_LIBPEXSI := $(strip $(USE_LIBPEXSI))
|
||||
SCOTCH_VER := $(strip $(SCOTCH_VER))
|
||||
SUPERLU_VER := $(strip $(SUPERLU_VER))
|
||||
LIBPEXSI_INC := $(INSTALL_PATH)/pexsi-$(USE_LIBPEXSI)/include
|
||||
LIBPEXSI_LIB := $(INSTALL_PATH)/pexsi-$(USE_LIBPEXSI)/lib
|
||||
SCOTCH_INC := $(INSTALL_PATH)/scotch-$(SCOTCH_VER)/include
|
||||
SCOTCH_LIB := $(INSTALL_PATH)/scotch-$(SCOTCH_VER)/lib
|
||||
SUPERLU_INC := $(INSTALL_PATH)/superlu_dist-$(SUPERLU_VER)/include
|
||||
SUPERLU_LIB := $(INSTALL_PATH)/superlu_dist-$(SUPERLU_VER)/lib
|
||||
CFLAGS += -I$(LIBPEXSI_INC) -I$(SCOTCH_INC) -I$(SUPERLU_INC)
|
||||
DFLAGS += -D__LIBPEXSI
|
||||
LIBS += $(LIBPEXSI_LIB)/libpexsi.a
|
||||
LIBS += $(SUPERLU_LIB)/libsuperlu_dist.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotchparmetis.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotch.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotcherr.a
|
||||
LIBS += $(SCOTCH_LIB)/libscotchmetis.a
|
||||
LIBS += $(SCOTCH_LIB)/libscotch.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBVORI),)
|
||||
USE_LIBVORI := $(strip $(USE_LIBVORI))
|
||||
LIBVORI_LIB := $(INSTALL_PATH)/libvori-$(USE_LIBVORI)/lib
|
||||
DFLAGS += -D__LIBVORI
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBVORI_LIB) -L$(LIBVORI_LIB) -lvori
|
||||
else
|
||||
LIBS += $(LIBVORI_LIB)/libvori.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBXC),)
|
||||
USE_LIBXC := $(strip $(USE_LIBXC))
|
||||
LIBXC_INC := $(INSTALL_PATH)/libxc-$(USE_LIBXC)/include
|
||||
LIBXC_LIB := $(INSTALL_PATH)/libxc-$(USE_LIBXC)/lib
|
||||
CFLAGS += -I$(LIBXC_INC)
|
||||
DFLAGS += -D__LIBXC
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBXC_LIB) -L$(LIBXC_LIB) -lxcf03 -lxc
|
||||
else
|
||||
LIBS += $(LIBXC_LIB)/libxcf03.a
|
||||
LIBS += $(LIBXC_LIB)/libxc.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_DFTD4),)
|
||||
USE_DFTD4 := $(strip $(USE_DFTD4))
|
||||
DFTD4_INC := $(INSTALL_PATH)/dftd4-$(USE_DFTD4)/include
|
||||
DFTD4_LIB := $(INSTALL_PATH)/dftd4-$(USE_DFTD4)/lib64
|
||||
CFLAGS += -I$(DFTD4_INC)/dftd4/GNU-$(GNU_VER)
|
||||
DFLAGS += -D__DFTD4
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(DFTD4_LIB) -L$(DFTD4_LIB) -ldftd4 -lmstore -lmulticharge -lmctc-lib
|
||||
else
|
||||
LIBS += $(DFTD4_LIB)/libdftd4.a
|
||||
LIBS += $(DFTD4_LIB)/libmstore.a
|
||||
LIBS += $(DFTD4_LIB)/libmulticharge.a
|
||||
LIBS += $(DFTD4_LIB)/libmctc-lib.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBGRPP),)
|
||||
USE_LIBGRPP := $(strip $(USE_LIBGRPP))
|
||||
LIBGRPP_INC := $(INSTALL_PATH)/libgrpp-main-$(USE_LIBGRPP)/include
|
||||
LIBGRPP_LIB := $(INSTALL_PATH)/libgrpp-main-$(USE_LIBGRPP)/lib
|
||||
CFLAGS += -I$(LIBGRPP_INC)
|
||||
DFLAGS += -D__LIBGRPP
|
||||
LIBS += $(LIBGRPP_LIB)/liblibgrpp.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBINT),)
|
||||
USE_LIBINT := $(strip $(USE_LIBINT))
|
||||
LMAX := $(strip $(LMAX))
|
||||
LIBINT_INC := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/include
|
||||
LIBINT_LIB := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/lib
|
||||
CFLAGS += -I$(LIBINT_INC)
|
||||
DFLAGS += -D__LIBINT
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBINT_LIB) -L$(LIBINT_LIB) -lint2
|
||||
else
|
||||
LIBS += $(LIBINT_LIB)/libint2.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPGLIB),)
|
||||
USE_SPGLIB := $(strip $(USE_SPGLIB))
|
||||
SPGLIB_INC := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/include
|
||||
SPGLIB_LIB := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/lib
|
||||
CFLAGS += -I$(SPGLIB_INC)
|
||||
DFLAGS += -D__SPGLIB
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SPGLIB_LIB) -L$(SPGLIB_LIB) -lsymspg
|
||||
else
|
||||
LIBS += $(SPGLIB_LIB)/libsymspg.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBXSMM),)
|
||||
USE_LIBXSMM := $(strip $(USE_LIBXSMM))
|
||||
LIBXSMM_INC := $(INSTALL_PATH)/libxsmm-$(USE_LIBXSMM)/include
|
||||
LIBXSMM_LIB := $(INSTALL_PATH)/libxsmm-$(USE_LIBXSMM)/lib
|
||||
CFLAGS += -I$(LIBXSMM_INC)
|
||||
DFLAGS += -D__LIBXSMM
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBXSMM_LIB) -L$(LIBXSMM_LIB) -lxsmmf -lxsmm
|
||||
else
|
||||
LIBS += $(LIBXSMM_LIB)/libxsmmf.a
|
||||
LIBS += $(LIBXSMM_LIB)/libxsmm.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SIRIUS),)
|
||||
USE_SIRIUS := $(strip $(USE_SIRIUS))
|
||||
LIBVDWXC_VER := $(strip $(LIBVDWXC_VER))
|
||||
LIBVDWXC_INC := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/include
|
||||
LIBVDWXC_LIB := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/lib
|
||||
SIRIUS_INC := $(INSTALL_PATH)/sirius-$(USE_SIRIUS)/include
|
||||
SIRIUS_LIB := $(INSTALL_PATH)/sirius-$(USE_SIRIUS)/lib
|
||||
CFLAGS += -I$(LIBVDWXC_INC)
|
||||
CFLAGS += -I$(SIRIUS_INC)
|
||||
DFLAGS += -D__LIBVDWXC
|
||||
DFLAGS += -D__SIRIUS
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SIRIUS_LIB) -L$(SIRIUS_LIB) -lsirius
|
||||
LIBS += -Wl,-rpath=$(LIBVDWXC_LIB) -L$(LIBVDWXC_LIB) -lvdwxc
|
||||
else
|
||||
LIBS += $(SIRIUS_LIB)/libsirius.a
|
||||
LIBS += $(LIBVDWXC_LIB)/libvdwxc.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPFFT),)
|
||||
USE_SPFFT := $(strip $(USE_SPFFT))
|
||||
SPFFT_INC := $(INSTALL_PATH)/SpFFT-$(USE_SPFFT)/include
|
||||
SPFFT_LIB := $(INSTALL_PATH)/SpFFT-$(USE_SPFFT)/lib
|
||||
CFLAGS += -I$(SPFFT_INC)
|
||||
DFLAGS += -D__SPFFT
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SPFFT_LIB) -L$(SPFFT_LIB) -lspfft
|
||||
else
|
||||
LIBS += $(SPFFT_LIB)/libspfft.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPLA),)
|
||||
USE_SPLA := $(strip $(USE_SPLA))
|
||||
SPLA_INC := $(INSTALL_PATH)/SpLA-$(USE_SPLA)/include/spla
|
||||
SPLA_LIB := $(INSTALL_PATH)/SpLA-$(USE_SPLA)/lib
|
||||
CFLAGS += -I$(SPLA_INC)
|
||||
DFLAGS += -D__SPLA
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SPLA_LIB) -L$(SPLA_LIB) -lspla
|
||||
else
|
||||
LIBS += $(SPLA_LIB)/libspla.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_HDF5),)
|
||||
USE_HDF5 := $(strip $(USE_HDF5))
|
||||
HDF5_INC := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/include
|
||||
HDF5_LIB := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/lib
|
||||
CFLAGS += -I$(HDF5_INC)
|
||||
DFLAGS += -D__HDF5
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath,$(HDF5_LIB) -L$(HDF5_LIB) -lhdf5_fortran -lhdf5
|
||||
else
|
||||
LIBS += $(HDF5_LIB)/libhdf5_fortran.a
|
||||
LIBS += $(HDF5_LIB)/libhdf5_f90cstub.a
|
||||
LIBS += $(HDF5_LIB)/libhdf5.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_COSMA),)
|
||||
USE_COSMA := $(strip $(USE_COSMA))
|
||||
COSMA_INC := $(INSTALL_PATH)/COSMA-$(USE_COSMA)/include
|
||||
COSMA_LIB := $(INSTALL_PATH)/COSMA-$(USE_COSMA)/lib
|
||||
CFLAGS += -I$(COSMA_INC)
|
||||
DFLAGS += -D__COSMA
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(COSMA_LIB) -L$(COSMA_LIB) -lcosma_prefixed_pxgemm -lcosma -lcosta
|
||||
else
|
||||
LIBS += $(COSMA_LIB)/libcosma_prefixed_pxgemm.a
|
||||
LIBS += $(COSMA_LIB)/libcosma.a
|
||||
LIBS += $(COSMA_LIB)/libcosta.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_GSL),)
|
||||
USE_GSL := $(strip $(USE_GSL))
|
||||
GSL_INC := $(INSTALL_PATH)/gsl-$(USE_GSL)/include
|
||||
GSL_LIB := $(INSTALL_PATH)/gsl-$(USE_GSL)/lib
|
||||
CFLAGS += -I$(GSL_INC)
|
||||
DFLAGS += -D__GSL
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(GSL_LIB) -L$(GSL_LIB) -lgsl
|
||||
else
|
||||
LIBS += $(GSL_LIB)/libgsl.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(shell [ $(shell ldd --version | head -n 1 | tr -s '.' '\n' | tail -n 1) -ge 27 ] && echo yes), yes)
|
||||
ifneq ($(USE_LIBTORCH),)
|
||||
USE_LIBTORCH := $(strip $(USE_LIBTORCH))
|
||||
LIBTORCH_INC := $(INSTALL_PATH)/libtorch-$(USE_LIBTORCH)/include
|
||||
LIBTORCH_LIB := $(INSTALL_PATH)/libtorch-$(USE_LIBTORCH)/lib
|
||||
CFLAGS += -I$(LIBTORCH_INC)
|
||||
DFLAGS += -D__LIBTORCH
|
||||
LIBS += -Wl,-rpath=$(LIBTORCH_LIB) -L$(LIBTORCH_LIB) -lc10 -ltorch_cpu -ltorch
|
||||
endif
|
||||
endif
|
||||
|
||||
CFLAGS += $(DFLAGS)
|
||||
|
||||
CXXFLAGS := $(CFLAGS) --std=c++14
|
||||
|
||||
FCFLAGS := $(CFLAGS)
|
||||
ifeq ($(shell [ $(shell $(CC) -dumpversion | cut -d. -f1) -gt 9 ] && echo yes), yes)
|
||||
FCFLAGS += -fallow-argument-mismatch
|
||||
endif
|
||||
FCFLAGS += -fbacktrace
|
||||
FCFLAGS += -ffree-form
|
||||
FCFLAGS += -ffree-line-length-none
|
||||
FCFLAGS += -fno-omit-frame-pointer
|
||||
FCFLAGS += -std=f2008
|
||||
|
||||
LDFLAGS += $(FCFLAGS)
|
||||
|
||||
LIBS += -lz -ldl -lstdc++
|
||||
|
||||
# End
|
||||
392
arch/Eiger-mc-intel.psmp
Normal file
392
arch/Eiger-mc-intel.psmp
Normal file
|
|
@ -0,0 +1,392 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# CP2K (Intel/MKL x86_64) arch file for the Alps/Eiger (AMD Zen 2) cluster at CSCS
|
||||
#
|
||||
# Tested with: Intel 2021.10.0, Intel MPI, Intel MKL,
|
||||
# LIBINT 2.6.0, LIBXC 6.2.2, ELPA 2024.03.001,
|
||||
# PLUMED 2.9.0, SPGLIB 2.3.1, LIBVORI 220621,
|
||||
# GSL 2.7, COSMA 2.6.6, HDF5 1.14.2, SIRIUS 7.5.2,
|
||||
# LIBGRPP 20231225, SPFFT 1.1.0, SPLA 1.6.1,
|
||||
# DFTD4 3.6.0
|
||||
# on the Alps/Eiger (CSCS)
|
||||
#
|
||||
# Usage: Source this arch file and then run make as instructed.
|
||||
# Replace or adapt the "module load" commands below if needed.
|
||||
#
|
||||
# Last update: 04.08.2024
|
||||
#
|
||||
# \
|
||||
if [[ "${0}" == "${BASH_SOURCE}" ]]; then \
|
||||
echo "ERROR: Script ${0##*/} must be sourced"; \
|
||||
echo "Usage: source ${0##*/}"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
this_file=${BASH_SOURCE##*/}; \
|
||||
cd tools/toolchain; \
|
||||
rm -rf build; \
|
||||
module load cray; \
|
||||
module load cpeIntel; \
|
||||
module load cray-fftw; \
|
||||
module list; \
|
||||
[[ -z "${TARGET_CPU}" ]] && export TARGET_CPU="core-avx2"; \
|
||||
./install_cp2k_toolchain.sh -j32 --enable-cray --no-arch-files --target-cpu=${TARGET_CPU} --with-dftd4 --with-elpa --with-fftw --with-libtorch=no --with-intel --with-mkl --with-libtorch=no --with-libvdwxc --with-pexsi --with-plumed --with-quip=no; \
|
||||
source ./install/setup; \
|
||||
cd ../..; \
|
||||
echo; \
|
||||
echo "Check the output above for error messages and consistency!"; \
|
||||
echo; \
|
||||
echo "If everything is OK, you can build a CP2K production binary with"; \
|
||||
echo " make -j32 ARCH=${this_file%.*} VERSION=${this_file##*.} TARGET_CPU=${TARGET_CPU}"; \
|
||||
echo; \
|
||||
echo "Alternatively, you can add further checks, e.g. for regression testing, with"; \
|
||||
echo " make -j32 ARCH=${this_file%.*} VERSION=${this_file##*.} TARGET_CPU=${TARGET_CPU} DO_CHECKS=yes"; \
|
||||
echo; \
|
||||
return
|
||||
|
||||
# Set options
|
||||
DO_CHECKS := no
|
||||
SHARED := no
|
||||
TARGET_CPU := core-avx2
|
||||
USE_COSMA := 2.6.6
|
||||
USE_DFTD4 := 3.6.0
|
||||
USE_ELPA := 2024.03.001
|
||||
USE_HDF5 := 1.14.2
|
||||
USE_LIBGRPP := 20231225
|
||||
USE_LIBINT := 2.6.0
|
||||
USE_LIBPEXSI := 1.2.0
|
||||
#USE_LIBTORCH := 1.12.1
|
||||
USE_LIBVORI := 220621
|
||||
USE_LIBXC := 6.2.2
|
||||
USE_LIBXSMM := 1.17
|
||||
USE_PLUMED := 2.9.0
|
||||
USE_SIRIUS := 7.5.2
|
||||
USE_SPFFT := 1.1.0
|
||||
USE_SPGLIB := 2.3.1
|
||||
USE_SPLA := 1.6.1
|
||||
# Only needed for SIRIUS
|
||||
LIBVDWXC_VER := 0.4.0
|
||||
# Only needed for LIBPEXSI
|
||||
SCOTCH_VER := 6.0.0
|
||||
SUPERLU_VER := 6.1.0
|
||||
|
||||
LMAX := 5
|
||||
MAX_CONTR := 4
|
||||
|
||||
CC := cc
|
||||
FC := ftn
|
||||
LD := ftn
|
||||
AR := ar -r
|
||||
|
||||
CFLAGS := -O2 -fPIC -fp-model precise -funroll-loops -g -mtune=$(TARGET_CPU) -qopenmp -qopenmp-simd -traceback
|
||||
CFLAGS += -diag-disable=10448
|
||||
|
||||
DFLAGS := -D__parallel
|
||||
DFLAGS += -D__MKL
|
||||
DFLAGS += -D__FFTW3
|
||||
DFLAGS += -D__MAX_CONTR=$(strip $(MAX_CONTR))
|
||||
|
||||
INSTALL_PATH := $(PWD)/tools/toolchain/install
|
||||
|
||||
MKL_LIB := $(MKLROOT)/lib/intel64
|
||||
|
||||
ifeq ($(SHARED), yes)
|
||||
LD_SHARED := $(FC) -shared
|
||||
CFLAGS += -fPIC
|
||||
LDFLAGS := -Wl,--enable-new-dtags
|
||||
CP2K_LIB := $(PWD)/lib/$(ARCH)/$(ONEVERSION)
|
||||
LDFLAGS += -Wl,-rpath=$(CP2K_LIB)
|
||||
LDFLAGS += -Wl,-rpath=$(CP2K_LIB)/exts/dbcsr
|
||||
else
|
||||
LDFLAGS := -static-intel
|
||||
endif
|
||||
|
||||
# Settings for regression testing
|
||||
ifeq ($(DO_CHECKS), yes)
|
||||
DFLAGS += -D__CHECK_DIAG
|
||||
endif
|
||||
|
||||
ifneq ($(USE_PLUMED),)
|
||||
USE_PLUMED := $(strip $(USE_PLUMED))
|
||||
PLUMED_LIB := $(INSTALL_PATH)/plumed-$(USE_PLUMED)/lib
|
||||
DFLAGS += -D__PLUMED2
|
||||
USE_GSL := 2.7
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(PLUMED_LIB) -L$(PLUMED_LIB) -lplumed -lplumedKernel
|
||||
else
|
||||
LIBS += $(PLUMED_LIB)/libplumed.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_ELPA),)
|
||||
USE_ELPA := $(strip $(USE_ELPA))
|
||||
ELPA_INC := $(INSTALL_PATH)/elpa-$(USE_ELPA)/cpu/include/elpa_openmp-$(USE_ELPA)
|
||||
ELPA_LIB := $(INSTALL_PATH)/elpa-$(USE_ELPA)/cpu/lib
|
||||
CFLAGS += -I$(ELPA_INC)/elpa -I$(ELPA_INC)/modules
|
||||
DFLAGS += -D__ELPA
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(ELPA_LIB) -L$(ELPA_LIB) -lelpa_openmp
|
||||
else
|
||||
LIBS += $(ELPA_LIB)/libelpa_openmp.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBPEXSI),)
|
||||
USE_LIBPEXSI := $(strip $(USE_LIBPEXSI))
|
||||
SCOTCH_VER := $(strip $(SCOTCH_VER))
|
||||
SUPERLU_VER := $(strip $(SUPERLU_VER))
|
||||
LIBPEXSI_INC := $(INSTALL_PATH)/pexsi-$(USE_LIBPEXSI)/include
|
||||
LIBPEXSI_LIB := $(INSTALL_PATH)/pexsi-$(USE_LIBPEXSI)/lib
|
||||
SCOTCH_INC := $(INSTALL_PATH)/scotch-$(SCOTCH_VER)/include
|
||||
SCOTCH_LIB := $(INSTALL_PATH)/scotch-$(SCOTCH_VER)/lib
|
||||
SUPERLU_INC := $(INSTALL_PATH)/superlu_dist-$(SUPERLU_VER)/include
|
||||
SUPERLU_LIB := $(INSTALL_PATH)/superlu_dist-$(SUPERLU_VER)/lib
|
||||
CFLAGS += -I$(LIBPEXSI_INC) -I$(SCOTCH_INC) -I$(SUPERLU_INC)
|
||||
DFLAGS += -D__LIBPEXSI
|
||||
LIBS += $(LIBPEXSI_LIB)/libpexsi.a
|
||||
LIBS += $(SUPERLU_LIB)/libsuperlu_dist.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotchparmetis.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotch.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotcherr.a
|
||||
LIBS += $(SCOTCH_LIB)/libscotchmetis.a
|
||||
LIBS += $(SCOTCH_LIB)/libscotch.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBVORI),)
|
||||
USE_LIBVORI := $(strip $(USE_LIBVORI))
|
||||
LIBVORI_LIB := $(INSTALL_PATH)/libvori-$(USE_LIBVORI)/lib
|
||||
DFLAGS += -D__LIBVORI
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBVORI_LIB) -L$(LIBVORI_LIB) -lvori
|
||||
else
|
||||
LIBS += $(LIBVORI_LIB)/libvori.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBXC),)
|
||||
USE_LIBXC := $(strip $(USE_LIBXC))
|
||||
LIBXC_INC := $(INSTALL_PATH)/libxc-$(USE_LIBXC)/include
|
||||
LIBXC_LIB := $(INSTALL_PATH)/libxc-$(USE_LIBXC)/lib
|
||||
CFLAGS += -I$(LIBXC_INC)
|
||||
DFLAGS += -D__LIBXC
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBXC_LIB) -L$(LIBXC_LIB) -lxcf03 -lxc
|
||||
else
|
||||
LIBS += $(LIBXC_LIB)/libxcf03.a
|
||||
LIBS += $(LIBXC_LIB)/libxc.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_DFTD4),)
|
||||
USE_DFTD4 := $(strip $(USE_DFTD4))
|
||||
DFTD4_INC := $(INSTALL_PATH)/dftd4-$(USE_DFTD4)/include
|
||||
DFTD4_LIB := $(INSTALL_PATH)/dftd4-$(USE_DFTD4)/lib64
|
||||
CFLAGS += -I$(shell ls -d $(DFTD4_INC)/dftd4/Intel-*)
|
||||
DFLAGS += -D__DFTD4
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(DFTD4_LIB) -L$(DFTD4_LIB) -ldftd4 -lmstore -lmulticharge -lmctc-lib
|
||||
else
|
||||
LIBS += $(DFTD4_LIB)/libdftd4.a
|
||||
LIBS += $(DFTD4_LIB)/libmstore.a
|
||||
LIBS += $(DFTD4_LIB)/libmulticharge.a
|
||||
LIBS += $(DFTD4_LIB)/libmctc-lib.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBGRPP),)
|
||||
USE_LIBGRPP := $(strip $(USE_LIBGRPP))
|
||||
LIBGRPP_INC := $(INSTALL_PATH)/libgrpp-main-$(USE_LIBGRPP)/include
|
||||
LIBGRPP_LIB := $(INSTALL_PATH)/libgrpp-main-$(USE_LIBGRPP)/lib
|
||||
CFLAGS += -I$(LIBGRPP_INC)
|
||||
DFLAGS += -D__LIBGRPP
|
||||
LIBS += $(LIBGRPP_LIB)/liblibgrpp.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBINT),)
|
||||
USE_LIBINT := $(strip $(USE_LIBINT))
|
||||
LMAX := $(strip $(LMAX))
|
||||
LIBINT_INC := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/include
|
||||
LIBINT_LIB := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/lib
|
||||
CFLAGS += -I$(LIBINT_INC)
|
||||
DFLAGS += -D__LIBINT
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBINT_LIB) -L$(LIBINT_LIB) -lint2
|
||||
else
|
||||
LIBS += $(LIBINT_LIB)/libint2.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPGLIB),)
|
||||
USE_SPGLIB := $(strip $(USE_SPGLIB))
|
||||
SPGLIB_INC := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/include
|
||||
SPGLIB_LIB := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/lib
|
||||
CFLAGS += -I$(SPGLIB_INC)
|
||||
DFLAGS += -D__SPGLIB
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SPGLIB_LIB) -L$(SPGLIB_LIB) -lsymspg
|
||||
else
|
||||
LIBS += $(SPGLIB_LIB)/libsymspg.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBXSMM),)
|
||||
USE_LIBXSMM := $(strip $(USE_LIBXSMM))
|
||||
LIBXSMM_INC := $(INSTALL_PATH)/libxsmm-$(USE_LIBXSMM)/include
|
||||
LIBXSMM_LIB := $(INSTALL_PATH)/libxsmm-$(USE_LIBXSMM)/lib
|
||||
CFLAGS += -I$(LIBXSMM_INC)
|
||||
DFLAGS += -D__LIBXSMM
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBXSMM_LIB) -L$(LIBXSMM_LIB) -lxsmmf -lxsmm
|
||||
else
|
||||
LIBS += $(LIBXSMM_LIB)/libxsmmf.a
|
||||
LIBS += $(LIBXSMM_LIB)/libxsmm.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SIRIUS),)
|
||||
USE_SIRIUS := $(strip $(USE_SIRIUS))
|
||||
LIBVDWXC_VER := $(strip $(LIBVDWXC_VER))
|
||||
LIBVDWXC_INC := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/include
|
||||
LIBVDWXC_LIB := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/lib
|
||||
SIRIUS_INC := $(INSTALL_PATH)/sirius-$(USE_SIRIUS)/include
|
||||
SIRIUS_LIB := $(INSTALL_PATH)/sirius-$(USE_SIRIUS)/lib
|
||||
CFLAGS += -I$(LIBVDWXC_INC)
|
||||
CFLAGS += -I$(SIRIUS_INC)
|
||||
DFLAGS += -D__LIBVDWXC
|
||||
DFLAGS += -D__SIRIUS
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SIRIUS_LIB) -L$(SIRIUS_LIB) -lsirius
|
||||
LIBS += -Wl,-rpath=$(LIBVDWXC_LIB) -L$(LIBVDWXC_LIB) -lvdwxc
|
||||
else
|
||||
LIBS += $(SIRIUS_LIB)/libsirius.a
|
||||
LIBS += $(LIBVDWXC_LIB)/libvdwxc.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPFFT),)
|
||||
USE_SPFFT := $(strip $(USE_SPFFT))
|
||||
SPFFT_INC := $(INSTALL_PATH)/SpFFT-$(USE_SPFFT)/include
|
||||
SPFFT_LIB := $(INSTALL_PATH)/SpFFT-$(USE_SPFFT)/lib
|
||||
CFLAGS += -I$(SPFFT_INC)
|
||||
DFLAGS += -D__SPFFT
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SPFFT_LIB) -L$(SPFFT_LIB) -lspfft
|
||||
else
|
||||
LIBS += $(SPFFT_LIB)/libspfft.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPLA),)
|
||||
USE_SPLA := $(strip $(USE_SPLA))
|
||||
SPLA_INC := $(INSTALL_PATH)/SpLA-$(USE_SPLA)/include/spla
|
||||
SPLA_LIB := $(INSTALL_PATH)/SpLA-$(USE_SPLA)/lib
|
||||
CFLAGS += -I$(SPLA_INC)
|
||||
DFLAGS += -D__SPLA
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SPLA_LIB) -L$(SPLA_LIB) -lspla
|
||||
else
|
||||
LIBS += $(SPLA_LIB)/libspla.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_HDF5),)
|
||||
USE_HDF5 := $(strip $(USE_HDF5))
|
||||
HDF5_INC := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/include
|
||||
HDF5_LIB := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/lib
|
||||
CFLAGS += -I$(HDF5_INC)
|
||||
DFLAGS += -D__HDF5
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath,$(HDF5_LIB) -L$(HDF5_LIB) -lhdf5_fortran -lhdf5
|
||||
else
|
||||
LIBS += $(HDF5_LIB)/libhdf5_fortran.a
|
||||
LIBS += $(HDF5_LIB)/libhdf5_f90cstub.a
|
||||
LIBS += $(HDF5_LIB)/libhdf5.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_COSMA),)
|
||||
USE_COSMA := $(strip $(USE_COSMA))
|
||||
COSMA_INC := $(INSTALL_PATH)/COSMA-$(USE_COSMA)/include
|
||||
COSMA_LIB := $(INSTALL_PATH)/COSMA-$(USE_COSMA)/lib
|
||||
CFLAGS += -I$(COSMA_INC)
|
||||
DFLAGS += -D__COSMA
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(COSMA_LIB) -L$(COSMA_LIB) -lcosma_prefixed_pxgemm -lcosma -lcosta
|
||||
else
|
||||
LIBS += $(COSMA_LIB)/libcosma_prefixed_pxgemm.a
|
||||
LIBS += $(COSMA_LIB)/libcosma.a
|
||||
LIBS += $(COSMA_LIB)/libcosta.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_GSL),)
|
||||
USE_GSL := $(strip $(USE_GSL))
|
||||
GSL_INC := $(INSTALL_PATH)/gsl-$(USE_GSL)/include
|
||||
GSL_LIB := $(INSTALL_PATH)/gsl-$(USE_GSL)/lib
|
||||
CFLAGS += -I$(GSL_INC)
|
||||
DFLAGS += -D__GSL
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(GSL_LIB) -L$(GSL_LIB) -lgsl
|
||||
else
|
||||
LIBS += $(GSL_LIB)/libgsl.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(MKL_LIB) -L$(MKL_LIB) -lmkl_scalapack_lp64
|
||||
LIBS += -Wl,--start-group
|
||||
LIBS += -lmkl_intel_lp64
|
||||
LIBS += -lmkl_sequential
|
||||
LIBS += -lmkl_core
|
||||
LIBS += -lmkl_blacs_intelmpi_lp64
|
||||
LIBS += -Wl,--end-group
|
||||
else
|
||||
LIBS += $(MKL_LIB)/libmkl_scalapack_lp64.a
|
||||
LIBS += -Wl,--start-group
|
||||
LIBS += $(MKL_LIB)/libmkl_intel_lp64.a
|
||||
LIBS += $(MKL_LIB)/libmkl_sequential.a
|
||||
LIBS += $(MKL_LIB)/libmkl_core.a
|
||||
LIBS += $(MKL_LIB)/libmkl_blacs_intelmpi_lp64.a
|
||||
LIBS += -Wl,--end-group
|
||||
endif
|
||||
|
||||
ifeq ($(shell [ $(shell ldd --version | head -n 1 | tr -s '.' '\n' | tail -n 1) -ge 27 ] && echo yes), yes)
|
||||
ifneq ($(USE_LIBTORCH),)
|
||||
USE_LIBTORCH := $(strip $(USE_LIBTORCH))
|
||||
LIBTORCH_INC := $(INSTALL_PATH)/libtorch-$(USE_LIBTORCH)/include
|
||||
LIBTORCH_LIB := $(INSTALL_PATH)/libtorch-$(USE_LIBTORCH)/lib
|
||||
CFLAGS += -I$(LIBTORCH_INC)
|
||||
DFLAGS += -D__LIBTORCH
|
||||
LIBS += -Wl,-rpath=$(LIBTORCH_LIB) -L$(LIBTORCH_LIB) -lc10 -ltorch_cpu -ltorch
|
||||
endif
|
||||
endif
|
||||
|
||||
CFLAGS += $(DFLAGS)
|
||||
CFLAGS += -I$(MKLROOT)/include
|
||||
CFLAGS += -I$(MKLROOT)/include/fftw
|
||||
|
||||
CXXFLAGS := $(CFLAGS) -std=c++14
|
||||
|
||||
FCFLAGS := $(CFLAGS)
|
||||
FCFLAGS += -diag-disable=8291
|
||||
FCFLAGS += -diag-disable=8293
|
||||
FCFLAGS += -fpp
|
||||
FCFLAGS += -fpscomp logicals
|
||||
FCFLAGS += -free
|
||||
#FCFLAGS += -std08
|
||||
|
||||
LDFLAGS += $(FCFLAGS)
|
||||
LDFLAGS_C := -nofor-main
|
||||
|
||||
LIBS += -lz -lstdc++
|
||||
|
||||
# Required due to memory leak that occurs if high optimisations are used
|
||||
mp2_optimize_ri_basis.o: mp2_optimize_ri_basis.F
|
||||
$(FC) -c $(subst O2,O0,$(FCFLAGS)) $<
|
||||
# Required due to SEGFAULTS occurring for higher optimisation levels
|
||||
paw_basis_types.o: paw_basis_types.F
|
||||
$(FC) -c $(subst O2,O1,$(FCFLAGS)) $<
|
||||
# Reduce compilation time
|
||||
hfx_contraction_methods.o: hfx_contraction_methods.F
|
||||
$(FC) -c $(subst -O2,-O1,$(FCFLAGS)) $<
|
||||
|
||||
# End
|
||||
8
arch/FreeBSD-gfortran.psmp
Normal file
8
arch/FreeBSD-gfortran.psmp
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
CC = gcc
|
||||
FC = mpifort
|
||||
LD = mpifort
|
||||
AR = ar -r
|
||||
DFLAGS = -D__FFTW3 -D__NO_STATM_ACCESS -D__parallel
|
||||
FCFLAGS = -O2 -fopenmp -funroll-loops -ftree-vectorize -march=native -ffree-form $(DFLAGS)
|
||||
LDFLAGS = $(FCFLAGS)
|
||||
LIBS = -llapack -lblas -lscalapack -lfftw3 -lfftw3_omp -lmpich
|
||||
9
arch/FreeBSD-gfortran.ssmp
Normal file
9
arch/FreeBSD-gfortran.ssmp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
CC = gcc
|
||||
FC = gfortran
|
||||
LD = gfortran
|
||||
AR = ar -r
|
||||
DFLAGS = -D__FFTW3 -D__NO_STATM_ACCESS
|
||||
FCFLAGS = -O2 -fopenmp -funroll-loops -ftree-vectorize -march=native -ffree-form $(DFLAGS)
|
||||
LDFLAGS = $(FCFLAGS)
|
||||
LIBS = -llapack -lblas -lfftw3 -lfftw3_omp
|
||||
|
||||
26
arch/Fugaku-fujitsu-minimal.psmp
Normal file
26
arch/Fugaku-fujitsu-minimal.psmp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# arch file for CP2K on Fugaku with the Fujitsu compiler, with minimal dependencies.
|
||||
# RIKEN uses Spack to provide libraries.
|
||||
|
||||
# XXX: you may have to append a hash, e.g., /3q6zoxs
|
||||
FFTW_DIR := $(shell spack location -i fujitsu-fftw)
|
||||
|
||||
CC = mpifccpx
|
||||
CXX = mpiFCCpx
|
||||
AR = ar -r
|
||||
FC = mpifrtpx
|
||||
LD = mpiFCCpx
|
||||
DFLAGS = -D__parallel
|
||||
DFLAGS += -D__FFTW3
|
||||
FCFLAGS = -Free -X08 -Kopenmp,SVE $(DFLAGS)
|
||||
FCFLAGS += -I$(FFTW_DIR)/include
|
||||
CFLAGS = -Kopenmp,SVE $(DFLAGS)
|
||||
CXXFLAGS = -Kopenmp,SVE $(DFLAGS)
|
||||
LDFLAGS = -SCALAPACK -SSL2 $(CXXFLAGS) --linkfortran
|
||||
|
||||
# The libfftw.so provided by fj-fftw is missing the RPATH/RUNPATH to the compilers libfjcrt.so.1, add it explicitly to avoid a warning.
|
||||
LIBS += -L$(FFTW_DIR)/lib -lfftw3 -lfftw3_omp -lfjcrt
|
||||
|
||||
# the compiler runs out of memory when optimizing the following:
|
||||
mp2_eri.o: mp2_eri.F
|
||||
$(TOOLSRC)/build_utils/fypp $(FYPPFLAGS) $< $*.F90
|
||||
$(FC) -c $(FCFLAGS) -O0 -D__SHORT_FILE__="\"$(subst $(SRCDIR)/,,$<)\"" -I'$(dir $<)' $(OBJEXTSINCL) $*.F90 $(FCLOGPIPE)
|
||||
30
arch/IBM-BGQ-MPI.psmp
Normal file
30
arch/IBM-BGQ-MPI.psmp
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# The following settings are intended for IBM/BlueGene Q with
|
||||
# - ESSL library essl/5.1 or later
|
||||
# - ESSL SMP library esslsmp/5.1 or later
|
||||
# - LAPACK library lapack/3.4.2 or later
|
||||
# - SCALAPACK library scalapack/1.8.0 or later
|
||||
# - MASS library mass/7.3 or later
|
||||
# Optional (if FFTW3 is requested)
|
||||
# - FFTW3 library fftw/3.3.3 or later
|
||||
# WARNING: Check your own libraries and paths !
|
||||
#
|
||||
CC = mpixlc
|
||||
FC = mpixlf2003_r -qpreprocess
|
||||
LD = mpixlf2003_r
|
||||
AR = ar -r
|
||||
|
||||
DFLAGS = -D__AIX -D__FFTW3 -D__FFTSG -D__parallel
|
||||
FCFLAGS = $(DFLAGS) -O3 -qhot -g -qsmp=omp -qstrict -qarch=qp -qtune=qp -qmaxmem=-1 \
|
||||
-I/bgsys/ibm_essl/prod/opt/ibmmath/essl/5.1/include \
|
||||
-I/bglocal/cn/pub/LAPACK/3.4.2/include -I/bglocal/cn/pub/FFTW/3.3.3/include
|
||||
|
||||
LDFLAGS = $(FCFLAGS) -Wl,--allow-multiple-definition
|
||||
|
||||
LIBS = -L/bglocal/cn/pub/FFTW/3.3.3/lib -lfftw3_mpi -lfftw3_omp -lfftw3 -lfftw3f_mpi -lfftw3f_omp -lfftw3f \
|
||||
/bglocal/cn/pub/ScaLAPACK/1.8.0/lib/libscalapack.a /bglocal/cn/pub/BLACS/1.1/lib/libblacsF77init.a \
|
||||
/bglocal/cn/pub/BLACS/1.1/lib/libblacsCinit.a /bglocal/cn/pub/BLACS/1.1/lib/libblacs.a \
|
||||
/bglocal/cn/pub/LAPACK/3.4.2/lib/liblapack.a \
|
||||
/bgsys/ibm_essl/prod/opt/ibmmath/essl/5.1/lib64/libesslbg.a \
|
||||
/opt/ibmcmp/xlmass/bg/7.3/bglib64/libmass.a
|
||||
|
||||
OBJECTS_ARCHITECTURE = machine_aix.o
|
||||
52
arch/Isambard2-fujitsu-minimal.psmp
Normal file
52
arch/Isambard2-fujitsu-minimal.psmp
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
# arch file for CP2K on Isambard2 with the Fujitsu compiler, with minimal dependencies.
|
||||
|
||||
CC = mpifcc
|
||||
CXX = mpiFCC
|
||||
AR = ar -r
|
||||
FC = mpifrt
|
||||
LD = mpifrt
|
||||
DFLAGS = -D__parallel
|
||||
#DFLAGS += -D__FFTW3
|
||||
FCFLAGS = -Free -X08 -Kopenmp,SVE $(DFLAGS)
|
||||
CFLAGS = -Kopenmp,SVE $(DFLAGS)
|
||||
CXXFLAGS = -Kopenmp,SVE $(DFLAGS)
|
||||
LDFLAGS = -SCALAPACK -SSL2 $(FCFLAGS)
|
||||
#LIBS += -lfftw3 -lfftw3_omp
|
||||
|
||||
# the compiler runs out of memory when optimizing the following:
|
||||
mp2_eri.o: mp2_eri.F
|
||||
$(TOOLSRC)/build_utils/fypp $(FYPPFLAGS) $< $*.F90
|
||||
$(FC) -c $(FCFLAGS) -O0 -D__SHORT_FILE__="\"$(subst $(SRCDIR)/,,$<)\"" -I'$(dir $<)' $(OBJEXTSINCL) $*.F90 $(FCLOGPIPE)
|
||||
|
||||
# Note: the Fujitsu compiler still has a problem with some INTENT specifications in DBCSR and you may have to apply the following patch:
|
||||
# diff --git a/exts/dbcsr/src/dist/dbcsr_dist_methods.F b/exts/dbcsr/src/dist/dbcsr_dist_methods.F
|
||||
# index 38a5724e3..a3f242da4 100644
|
||||
# --- a/exts/dbcsr/src/dist/dbcsr_dist_methods.F
|
||||
# +++ b/exts/dbcsr/src/dist/dbcsr_dist_methods.F
|
||||
# @@ -77,7 +77,7 @@ CONTAINS
|
||||
# OPTIONAL :: template
|
||||
# INTEGER, INTENT(IN), OPTIONAL :: group
|
||||
# INTEGER, DIMENSION(:, :), OPTIONAL, POINTER :: pgrid
|
||||
# - INTEGER, DIMENSION(:), INTENT(IN), POINTER, CONTIGUOUS :: row_dist, col_dist
|
||||
# + INTEGER, DIMENSION(:), POINTER, CONTIGUOUS :: row_dist, col_dist
|
||||
# LOGICAL, INTENT(IN), OPTIONAL :: reuse_arrays
|
||||
#
|
||||
# TYPE(dbcsr_mp_obj) :: mp_env
|
||||
# @@ -116,7 +116,7 @@ CONTAINS
|
||||
# !! distribution
|
||||
# TYPE(dbcsr_mp_obj), INTENT(IN) :: mp_env
|
||||
# !! multiprocessing environment
|
||||
# - TYPE(array_i1d_obj), INTENT(IN) :: row_dist_block, col_dist_block
|
||||
# + TYPE(array_i1d_obj) :: row_dist_block, col_dist_block
|
||||
# TYPE(array_i1d_obj), INTENT(IN), OPTIONAL :: local_rows, local_cols
|
||||
#
|
||||
# INTEGER, DIMENSION(:), POINTER, CONTIGUOUS :: cont_row_dist, cont_col_dist, &
|
||||
# @@ -145,7 +145,7 @@ CONTAINS
|
||||
# !! distribution
|
||||
# TYPE(dbcsr_mp_obj), INTENT(IN) :: mp_env
|
||||
# !! multiprocessing environment
|
||||
# - INTEGER, DIMENSION(:), INTENT(IN), POINTER, CONTIGUOUS :: row_dist_block, col_dist_block
|
||||
# + INTEGER, DIMENSION(:), POINTER, CONTIGUOUS :: row_dist_block, col_dist_block
|
||||
# INTEGER, DIMENSION(:), INTENT(IN), OPTIONAL, &
|
||||
# POINTER, CONTIGUOUS :: local_rows, local_cols
|
||||
# LOGICAL, OPTIONAL
|
||||
458
arch/JURECA-cpu.psmp
Normal file
458
arch/JURECA-cpu.psmp
Normal file
|
|
@ -0,0 +1,458 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# CP2K arch file for JURECA at FZ Juelich (2 AMD EPYC 7742 CPUs per node)
|
||||
#
|
||||
# Tested with: GNU 11.3.0, ParaStationMPI,
|
||||
# ScaLAPACK 2.2.1, OpenBLAS 0.3.27,
|
||||
# FFTW 3.3.10, COSMA 2.6.6,
|
||||
# ELPA 2024.03.001, HDF5 1.14.2,
|
||||
# LIBINT 2.6.0, LIBPEXSI 1.2.0,
|
||||
# LIBXC 6.2.2, LIBVORI 220621,
|
||||
# LIBXSMM 1.17, PLUMED 2.9.0,
|
||||
# SIRIUS 7.5.2, SPGLIB 2.3.1
|
||||
#
|
||||
# Usage: Source this arch file and then run make as instructed.
|
||||
# A full toolchain installation is performed as default.
|
||||
# Replace or adapt the "module add" commands below if needed.
|
||||
#
|
||||
# Last update: 12.06.2024
|
||||
#
|
||||
# \
|
||||
if [ "${0}" = "${BASH_SOURCE}" ]; then \
|
||||
echo "ERROR: Script ${0##*/} must be sourced"; \
|
||||
echo "Usage: source ${0##*/}"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
this_file=${BASH_SOURCE##*/}; \
|
||||
module purge; \
|
||||
module add GCC/11.3.0; \
|
||||
module add ParaStationMPI/5.8.0-1-mt; \
|
||||
module list; \
|
||||
module save cp2k_jureca_cpu_psmp; \
|
||||
echo "To load the required modules in your batch job script, use:"; \
|
||||
echo " module restore cp2k_jureca_cpu_psmp"; \
|
||||
cd tools/toolchain; \
|
||||
rm -rf build; \
|
||||
./install_cp2k_toolchain.sh --enable-cuda=no --install-all -j32 --no-arch-files --with-gcc=system --with-mpich=system; \
|
||||
cd ../..; \
|
||||
printf "Sourcing ${PWD}/tools/toolchain/install/setup ... "; \
|
||||
source ${PWD}/tools/toolchain/install/setup; \
|
||||
printf "done\n"; \
|
||||
echo "Check the output above for error messages and consistency!"; \
|
||||
echo; \
|
||||
echo "If everything is OK, you can build a CP2K production binary with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.}"; \
|
||||
echo; \
|
||||
echo "Alternatively, you can add further checks, e.g. for regression testing, with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.} DO_CHECKS=yes"; \
|
||||
echo "or build CP2K as a library with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.} libcp2k"; \
|
||||
echo; \
|
||||
return
|
||||
|
||||
# Set options
|
||||
DO_CHECKS := no
|
||||
SHARED := no
|
||||
TARGET_CPU := native
|
||||
USE_ACC := no
|
||||
USE_COSMA := 2.6.6
|
||||
USE_ELPA := 2024.03.001
|
||||
USE_FFTW := 3.3.10
|
||||
USE_HDF5 := 1.14.2
|
||||
USE_LIBINT := 2.6.0
|
||||
USE_LIBPEXSI := 1.2.0
|
||||
USE_LIBTORCH := 1.12.1
|
||||
USE_LIBVORI := 220621
|
||||
USE_LIBXC := 6.2.2
|
||||
USE_LIBXSMM := 1.17
|
||||
USE_OPENBLAS := 0.3.27
|
||||
USE_PLUMED := 2.9.0
|
||||
USE_QUIP := 0.9.10
|
||||
USE_SCALAPACK := 2.2.1
|
||||
USE_SIRIUS := 7.5.2
|
||||
USE_SPGLIB := 2.3.1
|
||||
# Only needed for SIRIUS
|
||||
LIBVDWXC_VER := 0.4.0
|
||||
SPFFT_VER := 1.0.6
|
||||
SPLA_VER := 1.5.5
|
||||
# Only needed for LIBPEXSI
|
||||
SCOTCH_VER := 6.0.0
|
||||
SUPERLU_VER := 6.1.0
|
||||
|
||||
LMAX := 5
|
||||
MAX_CONTR := 4
|
||||
|
||||
ifeq ($(USE_ACC), yes)
|
||||
GPUVER := A100
|
||||
OFFLOAD_TARGET := cuda
|
||||
OFFLOAD_CC := nvcc
|
||||
endif
|
||||
|
||||
CC := mpicc
|
||||
CXX := mpicxx
|
||||
FC := mpifort
|
||||
LD := mpifort
|
||||
AR := ar -r
|
||||
|
||||
# cc, CC, and ftn include already the proper -march flag
|
||||
CFLAGS := -O2 -fPIC -fopenmp -fopenmp-simd -ftree-vectorize -funroll-loops -g -mtune=$(TARGET_CPU)
|
||||
|
||||
DFLAGS := -D__parallel
|
||||
DFLAGS += -D__MAX_CONTR=$(strip $(MAX_CONTR))
|
||||
|
||||
INSTALL_PATH := $(PWD)/tools/toolchain/install
|
||||
|
||||
ifeq ($(SHARED), yes)
|
||||
LD_SHARED := $(FC) -shared
|
||||
CFLAGS += -fPIC
|
||||
LDFLAGS := -Wl,--enable-new-dtags
|
||||
CP2K_LIB := $(PWD)/lib/$(ARCH)/$(ONEVERSION)
|
||||
LDFLAGS += -Wl,-rpath=$(CP2K_LIB)
|
||||
LDFLAGS += -Wl,-rpath=$(CP2K_LIB)/exts/dbcsr
|
||||
endif
|
||||
|
||||
# Settings for regression testing
|
||||
ifeq ($(DO_CHECKS), yes)
|
||||
DFLAGS += -D__CHECK_DIAG
|
||||
# CFLAGS_DEBUG := -fsanitize=address
|
||||
CFLAGS_DEBUG := -fsanitize=leak
|
||||
# FCFLAGS_DEBUG := -fcheck=bounds,do,recursion,pointer
|
||||
FCFLAGS_DEBUG += -fcheck=all,no-array-temps
|
||||
FCFLAGS_DEBUG += -ffpe-trap=invalid,overflow,zero
|
||||
FCFLAGS_DEBUG += -fimplicit-none
|
||||
FCFLAGS_DEBUG += -finit-derived
|
||||
FCFLAGS_DEBUG += -finit-real=snan
|
||||
FCFLAGS_DEBUG += -finit-integer=-42
|
||||
FCFLAGS_DEBUG += -finline-matmul-limit=0
|
||||
WFLAGS := -Werror=aliasing
|
||||
WFLAGS += -Werror=ampersand
|
||||
WFLAGS += -Werror=c-binding-type
|
||||
WFLAGS += -Werror=conversion
|
||||
WFLAGS += -Werror=intrinsic-shadow
|
||||
WFLAGS += -Werror=intrinsics-std
|
||||
WFLAGS += -Werror=line-truncation
|
||||
WFLAGS += -Wrealloc-lhs
|
||||
WFLAGS += -Werror=tabs
|
||||
WFLAGS += -Werror=target-lifetime
|
||||
WFLAGS += -Werror=underflow
|
||||
WFLAGS += -Werror=unused-but-set-variable
|
||||
WFLAGS += -Werror=unused-dummy-argument
|
||||
WFLAGS += -Werror=unused-variable
|
||||
endif
|
||||
|
||||
ifeq ($(USE_ACC), yes)
|
||||
DFLAGS += -D__DBCSR_ACC
|
||||
DFLAGS += -D__OFFLOAD_CUDA
|
||||
# Possibly no performance gain with PW_CUDA currently
|
||||
DFLAGS += -D__NO_OFFLOAD_PW
|
||||
endif
|
||||
|
||||
ifneq ($(USE_PLUMED),)
|
||||
USE_PLUMED := $(strip $(USE_PLUMED))
|
||||
PLUMED_LIB := $(INSTALL_PATH)/plumed-$(USE_PLUMED)/lib
|
||||
DFLAGS += -D__PLUMED2
|
||||
USE_GSL := 2.7
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(PLUMED_LIB) -L$(PLUMED_LIB) -lplumed -lplumedKernel
|
||||
else
|
||||
LIBS += $(PLUMED_LIB)/libplumed.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_ELPA),)
|
||||
USE_ELPA := $(strip $(USE_ELPA))
|
||||
ifeq ($(USE_ACC), yes)
|
||||
TARGET := nvidia
|
||||
DFLAGS += -D__ELPA_NVIDIA_GPU
|
||||
else
|
||||
TARGET := cpu
|
||||
endif
|
||||
ELPA_INC := $(INSTALL_PATH)/elpa-$(USE_ELPA)/$(TARGET)/include/elpa_openmp-$(USE_ELPA)
|
||||
ELPA_LIB := $(INSTALL_PATH)/elpa-$(USE_ELPA)/$(TARGET)/lib
|
||||
CFLAGS += -I$(ELPA_INC)/elpa -I$(ELPA_INC)/modules
|
||||
DFLAGS += -D__ELPA
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(ELPA_LIB) -L$(ELPA_LIB) -lelpa_openmp
|
||||
else
|
||||
LIBS += $(ELPA_LIB)/libelpa_openmp.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_QUIP),)
|
||||
USE_QUIP := $(strip $(USE_QUIP))
|
||||
QUIP_INC := $(INSTALL_PATH)/quip-$(USE_QUIP)/include
|
||||
QUIP_LIB := $(INSTALL_PATH)/quip-$(USE_QUIP)/lib
|
||||
CFLAGS += -I$(QUIP_INC)
|
||||
DFLAGS += -D__QUIP
|
||||
LIBS += $(QUIP_LIB)/libquip_core.a
|
||||
LIBS += $(QUIP_LIB)/libatoms.a
|
||||
LIBS += $(QUIP_LIB)/libFoX_sax.a
|
||||
LIBS += $(QUIP_LIB)/libFoX_common.a
|
||||
LIBS += $(QUIP_LIB)/libFoX_utils.a
|
||||
LIBS += $(QUIP_LIB)/libFoX_fsys.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBPEXSI),)
|
||||
USE_LIBPEXSI := $(strip $(USE_LIBPEXSI))
|
||||
SCOTCH_VER := $(strip $(SCOTCH_VER))
|
||||
SUPERLU_VER := $(strip $(SUPERLU_VER))
|
||||
LIBPEXSI_INC := $(INSTALL_PATH)/pexsi-$(USE_LIBPEXSI)/include
|
||||
LIBPEXSI_LIB := $(INSTALL_PATH)/pexsi-$(USE_LIBPEXSI)/lib
|
||||
SCOTCH_INC := $(INSTALL_PATH)/scotch-$(SCOTCH_VER)/include
|
||||
SCOTCH_LIB := $(INSTALL_PATH)/scotch-$(SCOTCH_VER)/lib
|
||||
SUPERLU_INC := $(INSTALL_PATH)/superlu_dist-$(SUPERLU_VER)/include
|
||||
SUPERLU_LIB := $(INSTALL_PATH)/superlu_dist-$(SUPERLU_VER)/lib
|
||||
CFLAGS += -I$(LIBPEXSI_INC) -I$(SCOTCH_INC) -I$(SUPERLU_INC)
|
||||
DFLAGS += -D__LIBPEXSI
|
||||
LIBS += $(LIBPEXSI_LIB)/libpexsi.a
|
||||
LIBS += $(SUPERLU_LIB)/libsuperlu_dist.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotchparmetis.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotch.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotcherr.a
|
||||
LIBS += $(SCOTCH_LIB)/libscotchmetis.a
|
||||
LIBS += $(SCOTCH_LIB)/libscotch.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBVORI),)
|
||||
USE_LIBVORI := $(strip $(USE_LIBVORI))
|
||||
LIBVORI_LIB := $(INSTALL_PATH)/libvori-$(USE_LIBVORI)/lib
|
||||
DFLAGS += -D__LIBVORI
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBVORI_LIB) -L$(LIBVORI_LIB) -lvori
|
||||
else
|
||||
LIBS += $(LIBVORI_LIB)/libvori.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBXC),)
|
||||
USE_LIBXC := $(strip $(USE_LIBXC))
|
||||
LIBXC_INC := $(INSTALL_PATH)/libxc-$(USE_LIBXC)/include
|
||||
LIBXC_LIB := $(INSTALL_PATH)/libxc-$(USE_LIBXC)/lib
|
||||
CFLAGS += -I$(LIBXC_INC)
|
||||
DFLAGS += -D__LIBXC
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBXC_LIB) -L$(LIBXC_LIB) -lxcf03 -lxc
|
||||
else
|
||||
LIBS += $(LIBXC_LIB)/libxcf03.a
|
||||
LIBS += $(LIBXC_LIB)/libxc.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBINT),)
|
||||
USE_LIBINT := $(strip $(USE_LIBINT))
|
||||
LMAX := $(strip $(LMAX))
|
||||
LIBINT_INC := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/include
|
||||
LIBINT_LIB := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/lib
|
||||
CFLAGS += -I$(LIBINT_INC)
|
||||
DFLAGS += -D__LIBINT
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBINT_LIB) -L$(LIBINT_LIB) -lint2
|
||||
else
|
||||
LIBS += $(LIBINT_LIB)/libint2.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPGLIB),)
|
||||
USE_SPGLIB := $(strip $(USE_SPGLIB))
|
||||
SPGLIB_INC := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/include
|
||||
SPGLIB_LIB := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/lib
|
||||
CFLAGS += -I$(SPGLIB_INC)
|
||||
DFLAGS += -D__SPGLIB
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SPGLIB_LIB) -L$(SPGLIB_LIB) -lsymspg
|
||||
else
|
||||
LIBS += $(SPGLIB_LIB)/libsymspg.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBXSMM),)
|
||||
USE_LIBXSMM := $(strip $(USE_LIBXSMM))
|
||||
LIBXSMM_INC := $(INSTALL_PATH)/libxsmm-$(USE_LIBXSMM)/include
|
||||
LIBXSMM_LIB := $(INSTALL_PATH)/libxsmm-$(USE_LIBXSMM)/lib
|
||||
CFLAGS += -I$(LIBXSMM_INC)
|
||||
DFLAGS += -D__LIBXSMM
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBXSMM_LIB) -L$(LIBXSMM_LIB) -lxsmmf -lxsmm
|
||||
else
|
||||
LIBS += $(LIBXSMM_LIB)/libxsmmf.a
|
||||
LIBS += $(LIBXSMM_LIB)/libxsmm.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SIRIUS),)
|
||||
USE_SIRIUS := $(strip $(USE_SIRIUS))
|
||||
LIBVDWXC_VER := $(strip $(LIBVDWXC_VER))
|
||||
LIBVDWXC_INC := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/include
|
||||
LIBVDWXC_LIB := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/lib
|
||||
SPFFT_VER := $(strip $(SPFFT_VER))
|
||||
SPFFT_INC := $(INSTALL_PATH)/SpFFT-$(SPFFT_VER)/include
|
||||
SPLA_VER := $(strip $(SPLA_VER))
|
||||
SPLA_INC := $(INSTALL_PATH)/SpLA-$(SPLA_VER)/include/spla
|
||||
ifeq ($(USE_ACC), yes)
|
||||
DFLAGS += -D__OFFLOAD_GEMM
|
||||
SPFFT_LIB := $(INSTALL_PATH)/SpFFT-$(SPFFT_VER)/lib/cuda
|
||||
SPLA_LIB := $(INSTALL_PATH)/SpLA-$(SPLA_VER)/lib/cuda
|
||||
SIRIUS_INC := $(INSTALL_PATH)/sirius-$(USE_SIRIUS)/include/cuda
|
||||
SIRIUS_LIB := $(INSTALL_PATH)/sirius-$(USE_SIRIUS)/lib/cuda
|
||||
else
|
||||
SPFFT_LIB := $(INSTALL_PATH)/SpFFT-$(SPFFT_VER)/lib
|
||||
SPLA_LIB := $(INSTALL_PATH)/SpLA-$(SPLA_VER)/lib
|
||||
SIRIUS_INC := $(INSTALL_PATH)/sirius-$(USE_SIRIUS)/include
|
||||
SIRIUS_LIB := $(INSTALL_PATH)/sirius-$(USE_SIRIUS)/lib
|
||||
endif
|
||||
CFLAGS += -I$(LIBVDWXC_INC)
|
||||
CFLAGS += -I$(SPFFT_INC)
|
||||
CFLAGS += -I$(SPLA_INC)
|
||||
CFLAGS += -I$(SIRIUS_INC)
|
||||
DFLAGS += -D__LIBVDWXC
|
||||
DFLAGS += -D__SPFFT
|
||||
DFLAGS += -D__SPLA
|
||||
DFLAGS += -D__SIRIUS
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SIRIUS_LIB) -L$(SIRIUS_LIB) -lsirius
|
||||
LIBS += -Wl,-rpath=$(SPLA_LIB) -L$(SPLA_LIB) -lspla
|
||||
LIBS += -Wl,-rpath=$(SPFFT_LIB) -L$(SPFFT_LIB) -lspfft
|
||||
LIBS += -Wl,-rpath=$(LIBVDWXC_LIB) -L$(LIBVDWXC_LIB) -lvdwxc
|
||||
else
|
||||
LIBS += $(SIRIUS_LIB)/libsirius.a
|
||||
LIBS += $(SPLA_LIB)/libspla.a
|
||||
LIBS += $(SPFFT_LIB)/libspfft.a
|
||||
LIBS += $(LIBVDWXC_LIB)/libvdwxc.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_HDF5),)
|
||||
USE_HDF5 := $(strip $(USE_HDF5))
|
||||
HDF5_INC := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/include
|
||||
HDF5_LIB := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/lib
|
||||
CFLAGS += -I$(HDF5_INC)
|
||||
DFLAGS += -D__HDF5
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath,$(HDF5_LIB) -L$(HDF5_LIB) -lhdf5_fortran -lhdf5
|
||||
else
|
||||
LIBS += $(HDF5_LIB)/libhdf5_fortran.a
|
||||
LIBS += $(HDF5_LIB)/libhdf5_f90cstub.a
|
||||
LIBS += $(HDF5_LIB)/libhdf5.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_COSMA),)
|
||||
USE_COSMA := $(strip $(USE_COSMA))
|
||||
ifeq ($(USE_ACC), yes)
|
||||
USE_COSMA := $(USE_COSMA)-cuda
|
||||
endif
|
||||
COSMA_INC := $(INSTALL_PATH)/COSMA-$(USE_COSMA)/include
|
||||
COSMA_LIB := $(INSTALL_PATH)/COSMA-$(USE_COSMA)/lib
|
||||
CFLAGS += -I$(COSMA_INC)
|
||||
DFLAGS += -D__COSMA
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(COSMA_LIB) -L$(COSMA_LIB) -lcosma_prefixed_pxgemm -lcosma -lcosta
|
||||
ifeq ($(USE_ACC), yes)
|
||||
LIBS += -lTiled-MM
|
||||
endif
|
||||
else
|
||||
LIBS += $(COSMA_LIB)/libcosma_prefixed_pxgemm.a
|
||||
LIBS += $(COSMA_LIB)/libcosma.a
|
||||
LIBS += $(COSMA_LIB)/libcosta.a
|
||||
ifeq ($(USE_ACC), yes)
|
||||
LIBS += $(COSMA_LIB)/libTiled-MM.a
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_FFTW),)
|
||||
USE_FFTW := $(strip $(USE_FFTW))
|
||||
FFTW_INC := $(INSTALL_PATH)/fftw-$(USE_FFTW)/include
|
||||
FFTW_LIB := $(INSTALL_PATH)/fftw-$(USE_FFTW)/lib
|
||||
CFLAGS += -I$(FFTW_INC)
|
||||
DFLAGS += -D__FFTW3
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(FFTW_LIB) -L$(FFTW_LIB) -lfftw3_mpi -lfftw3_omp -lfftw3
|
||||
else
|
||||
LIBS += $(FFTW_LIB)/libfftw3_mpi.a
|
||||
LIBS += $(FFTW_LIB)/libfftw3_omp.a
|
||||
LIBS += $(FFTW_LIB)/libfftw3.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SCALAPACK),)
|
||||
SCALAPACK_LIB := $(INSTALL_PATH)/scalapack-$(USE_SCALAPACK)/lib
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SCALAPACK_LIB) -L$(SCALAPACK_LIB) -lscalapack
|
||||
else
|
||||
LIBS += $(SCALAPACK_LIB)/libscalapack.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_GSL),)
|
||||
USE_GSL := $(strip $(USE_GSL))
|
||||
GSL_INC := $(INSTALL_PATH)/gsl-$(USE_GSL)/include
|
||||
GSL_LIB := $(INSTALL_PATH)/gsl-$(USE_GSL)/lib
|
||||
CFLAGS += -I$(GSL_INC)
|
||||
DFLAGS += -D__GSL
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(GSL_LIB) -L$(GSL_LIB) -lgsl
|
||||
else
|
||||
LIBS += $(GSL_LIB)/libgsl.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_OPENBLAS),)
|
||||
USE_OPENBLAS := $(strip $(USE_OPENBLAS))
|
||||
OPENBLAS_INC := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/include
|
||||
OPENBLAS_LIB := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/lib
|
||||
CFLAGS += -I$(OPENBLAS_INC)
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(OPENBLAS_LIB) -L$(OPENBLAS_LIB) -lopenblas
|
||||
else
|
||||
LIBS += $(OPENBLAS_LIB)/libopenblas.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(shell [ $(shell ldd --version | head -n 1 | tr -s '.' '\n' | tail -n 1) -ge 27 ] && echo yes), yes)
|
||||
ifneq ($(USE_LIBTORCH),)
|
||||
USE_LIBTORCH := $(strip $(USE_LIBTORCH))
|
||||
LIBTORCH_INC := $(INSTALL_PATH)/libtorch-$(USE_LIBTORCH)/include
|
||||
LIBTORCH_LIB := $(INSTALL_PATH)/libtorch-$(USE_LIBTORCH)/lib
|
||||
CFLAGS += -I$(LIBTORCH_INC)
|
||||
DFLAGS += -D__LIBTORCH
|
||||
ifeq ($(USE_ACC), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBTORCH_LIB) -L$(LIBTORCH_LIB) -lc10 -ltorch_cpu -ltorch
|
||||
# LIBS += -Wl,-rpath=$(LIBTORCH_LIB) -L$(LIBTORCH_LIB) -lc10 -lc10_cuda -ltorch_cpu -ltorch_cuda -ltorch
|
||||
else
|
||||
LIBS += -Wl,-rpath=$(LIBTORCH_LIB) -L$(LIBTORCH_LIB) -lc10 -ltorch_cpu -ltorch
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
CFLAGS += $(DFLAGS)
|
||||
|
||||
FCFLAGS := $(CFLAGS)
|
||||
ifeq ($(shell [ $(shell gcc -dumpversion | cut -d. -f1) -gt 9 ] && echo yes), yes)
|
||||
FCFLAGS += -fallow-argument-mismatch
|
||||
endif
|
||||
FCFLAGS += -fbacktrace
|
||||
FCFLAGS += -ffree-form
|
||||
FCFLAGS += -ffree-line-length-none
|
||||
FCFLAGS += -fno-omit-frame-pointer
|
||||
FCFLAGS += -std=f2008
|
||||
|
||||
ifneq ($(CUDA_HOME),)
|
||||
CFLAGS += -I$(CUDA_HOME)/include
|
||||
FCFLAGS += -I$(CUDA_HOME)/include
|
||||
CUDA_LIB := $(CUDA_HOME)/lib64
|
||||
LDFLAGS += $(FCFLAGS) -L$(CUDA_LIB) -Wl,-rpath=$(CUDA_LIB)
|
||||
else
|
||||
LDFLAGS += $(FCFLAGS)
|
||||
endif
|
||||
|
||||
CFLAGS += $(CFLAGS) -std=c11
|
||||
CXXFLAGS := $(CFLAGS) -std=c++14
|
||||
ifeq ($(USE_ACC), yes)
|
||||
OFFLOAD_FLAGS := $(DFLAGS) -O3 -Xcompiler='-fopenmp' -allow-unsupported-compiler -arch sm_80 -g --std=c++11
|
||||
LIBS += -lcusolver -lcudart -lnvrtc -lcuda -lcufft -lcublas -lrt
|
||||
endif
|
||||
|
||||
LIBS += -lz -ldl -lpthread -lstdc++
|
||||
|
||||
# End
|
||||
459
arch/JURECA-gpu.psmp
Normal file
459
arch/JURECA-gpu.psmp
Normal file
|
|
@ -0,0 +1,459 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# CP2K arch file for JURECA at FZ Juelich (2 AMD EPYC 7742 CPUs and 4 A100 GPUs per node)
|
||||
#
|
||||
# Tested with: GNU 11.3.0, ParaStationMPI,
|
||||
# ScaLAPACK 2.2.1, OpenBLAS 0.3.27,
|
||||
# FFTW 3.3.10, COSMA 2.6.6,
|
||||
# ELPA 2024.03.001, HDF5 1.14.2,
|
||||
# LIBINT 2.6.0, LIBPEXSI 1.2.0,
|
||||
# LIBXC 6.2.2, LIBVORI 220621,
|
||||
# LIBXSMM 1.17, PLUMED 2.9.0,
|
||||
# SIRIUS 7.5.2, SPGLIB 2.3.1
|
||||
#
|
||||
# Usage: Source this arch file and then run make as instructed.
|
||||
# A full toolchain installation is performed as default.
|
||||
# Replace or adapt the "module add" commands below if needed.
|
||||
#
|
||||
# Last update: 12.06.2024
|
||||
#
|
||||
# \
|
||||
if [ "${0}" = "${BASH_SOURCE}" ]; then \
|
||||
echo "ERROR: Script ${0##*/} must be sourced"; \
|
||||
echo "Usage: source ${0##*/}"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
this_file=${BASH_SOURCE##*/}; \
|
||||
module purge; \
|
||||
module add GCC/11.3.0; \
|
||||
module add ParaStationMPI/5.8.0-1-mt; \
|
||||
module add CUDA/11.7; \
|
||||
module list; \
|
||||
module save cp2k_jureca_gpu_psmp; \
|
||||
echo "To load the required modules in your batch job script, use:"; \
|
||||
echo " module restore cp2k_jureca_gpu_psmp"; \
|
||||
cd tools/toolchain; \
|
||||
rm -rf build; \
|
||||
./install_cp2k_toolchain.sh --enable-cuda=yes --gpu-ver=A100 --install-all -j32 --no-arch-files --with-gcc=system --with-mpich=system; \
|
||||
cd ../..; \
|
||||
printf "Sourcing ${PWD}/tools/toolchain/install/setup ... "; \
|
||||
source ${PWD}/tools/toolchain/install/setup; \
|
||||
printf "done\n"; \
|
||||
echo "Check the output above for error messages and consistency!"; \
|
||||
echo; \
|
||||
echo "If everything is OK, you can build a CP2K production binary with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.}"; \
|
||||
echo; \
|
||||
echo "Alternatively, you can add further checks, e.g. for regression testing, with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.} DO_CHECKS=yes"; \
|
||||
echo "or build CP2K as a library with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.} libcp2k"; \
|
||||
echo; \
|
||||
return
|
||||
|
||||
# Set options
|
||||
DO_CHECKS := no
|
||||
SHARED := no
|
||||
TARGET_CPU := native
|
||||
USE_ACC := yes
|
||||
USE_COSMA := 2.6.6
|
||||
USE_ELPA := 2024.03.001
|
||||
USE_FFTW := 3.3.10
|
||||
USE_HDF5 := 1.14.2
|
||||
USE_LIBINT := 2.6.0
|
||||
USE_LIBPEXSI := 1.2.0
|
||||
USE_LIBTORCH := 1.12.1
|
||||
USE_LIBVORI := 220621
|
||||
USE_LIBXC := 6.2.2
|
||||
USE_LIBXSMM := 1.17
|
||||
USE_OPENBLAS := 0.3.27
|
||||
USE_PLUMED := 2.9.0
|
||||
USE_QUIP := 0.9.10
|
||||
USE_SCALAPACK := 2.2.1
|
||||
USE_SIRIUS := 7.5.2
|
||||
USE_SPGLIB := 2.3.1
|
||||
# Only needed for SIRIUS
|
||||
LIBVDWXC_VER := 0.4.0
|
||||
SPFFT_VER := 1.0.6
|
||||
SPLA_VER := 1.5.5
|
||||
# Only needed for LIBPEXSI
|
||||
SCOTCH_VER := 6.0.0
|
||||
SUPERLU_VER := 6.1.0
|
||||
|
||||
LMAX := 5
|
||||
MAX_CONTR := 4
|
||||
|
||||
ifeq ($(USE_ACC), yes)
|
||||
GPUVER := A100
|
||||
OFFLOAD_TARGET := cuda
|
||||
OFFLOAD_CC := nvcc
|
||||
endif
|
||||
|
||||
CC := mpicc
|
||||
CXX := mpicxx
|
||||
FC := mpifort
|
||||
LD := mpifort
|
||||
AR := ar -r
|
||||
|
||||
# cc, CC, and ftn include already the proper -march flag
|
||||
CFLAGS := -O2 -fPIC -fopenmp -fopenmp-simd -ftree-vectorize -funroll-loops -g -mtune=$(TARGET_CPU)
|
||||
|
||||
DFLAGS := -D__parallel
|
||||
DFLAGS += -D__MAX_CONTR=$(strip $(MAX_CONTR))
|
||||
|
||||
INSTALL_PATH := $(PWD)/tools/toolchain/install
|
||||
|
||||
ifeq ($(SHARED), yes)
|
||||
LD_SHARED := $(FC) -shared
|
||||
CFLAGS += -fPIC
|
||||
LDFLAGS := -Wl,--enable-new-dtags
|
||||
CP2K_LIB := $(PWD)/lib/$(ARCH)/$(ONEVERSION)
|
||||
LDFLAGS += -Wl,-rpath=$(CP2K_LIB)
|
||||
LDFLAGS += -Wl,-rpath=$(CP2K_LIB)/exts/dbcsr
|
||||
endif
|
||||
|
||||
# Settings for regression testing
|
||||
ifeq ($(DO_CHECKS), yes)
|
||||
DFLAGS += -D__CHECK_DIAG
|
||||
# CFLAGS_DEBUG := -fsanitize=address
|
||||
CFLAGS_DEBUG := -fsanitize=leak
|
||||
# FCFLAGS_DEBUG := -fcheck=bounds,do,recursion,pointer
|
||||
FCFLAGS_DEBUG += -fcheck=all,no-array-temps
|
||||
FCFLAGS_DEBUG += -ffpe-trap=invalid,overflow,zero
|
||||
FCFLAGS_DEBUG += -fimplicit-none
|
||||
FCFLAGS_DEBUG += -finit-derived
|
||||
FCFLAGS_DEBUG += -finit-real=snan
|
||||
FCFLAGS_DEBUG += -finit-integer=-42
|
||||
FCFLAGS_DEBUG += -finline-matmul-limit=0
|
||||
WFLAGS := -Werror=aliasing
|
||||
WFLAGS += -Werror=ampersand
|
||||
WFLAGS += -Werror=c-binding-type
|
||||
WFLAGS += -Werror=conversion
|
||||
WFLAGS += -Werror=intrinsic-shadow
|
||||
WFLAGS += -Werror=intrinsics-std
|
||||
WFLAGS += -Werror=line-truncation
|
||||
WFLAGS += -Wrealloc-lhs
|
||||
WFLAGS += -Werror=tabs
|
||||
WFLAGS += -Werror=target-lifetime
|
||||
WFLAGS += -Werror=underflow
|
||||
WFLAGS += -Werror=unused-but-set-variable
|
||||
WFLAGS += -Werror=unused-dummy-argument
|
||||
WFLAGS += -Werror=unused-variable
|
||||
endif
|
||||
|
||||
ifeq ($(USE_ACC), yes)
|
||||
DFLAGS += -D__DBCSR_ACC
|
||||
DFLAGS += -D__OFFLOAD_CUDA
|
||||
# Possibly no performance gain with PW_CUDA currently
|
||||
DFLAGS += -D__NO_OFFLOAD_PW
|
||||
endif
|
||||
|
||||
ifneq ($(USE_PLUMED),)
|
||||
USE_PLUMED := $(strip $(USE_PLUMED))
|
||||
PLUMED_LIB := $(INSTALL_PATH)/plumed-$(USE_PLUMED)/lib
|
||||
DFLAGS += -D__PLUMED2
|
||||
USE_GSL := 2.7
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(PLUMED_LIB) -L$(PLUMED_LIB) -lplumed -lplumedKernel
|
||||
else
|
||||
LIBS += $(PLUMED_LIB)/libplumed.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_ELPA),)
|
||||
USE_ELPA := $(strip $(USE_ELPA))
|
||||
ifeq ($(USE_ACC), yes)
|
||||
TARGET := nvidia
|
||||
DFLAGS += -D__ELPA_NVIDIA_GPU
|
||||
else
|
||||
TARGET := cpu
|
||||
endif
|
||||
ELPA_INC := $(INSTALL_PATH)/elpa-$(USE_ELPA)/$(TARGET)/include/elpa_openmp-$(USE_ELPA)
|
||||
ELPA_LIB := $(INSTALL_PATH)/elpa-$(USE_ELPA)/$(TARGET)/lib
|
||||
CFLAGS += -I$(ELPA_INC)/elpa -I$(ELPA_INC)/modules
|
||||
DFLAGS += -D__ELPA
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(ELPA_LIB) -L$(ELPA_LIB) -lelpa_openmp
|
||||
else
|
||||
LIBS += $(ELPA_LIB)/libelpa_openmp.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_QUIP),)
|
||||
USE_QUIP := $(strip $(USE_QUIP))
|
||||
QUIP_INC := $(INSTALL_PATH)/quip-$(USE_QUIP)/include
|
||||
QUIP_LIB := $(INSTALL_PATH)/quip-$(USE_QUIP)/lib
|
||||
CFLAGS += -I$(QUIP_INC)
|
||||
DFLAGS += -D__QUIP
|
||||
LIBS += $(QUIP_LIB)/libquip_core.a
|
||||
LIBS += $(QUIP_LIB)/libatoms.a
|
||||
LIBS += $(QUIP_LIB)/libFoX_sax.a
|
||||
LIBS += $(QUIP_LIB)/libFoX_common.a
|
||||
LIBS += $(QUIP_LIB)/libFoX_utils.a
|
||||
LIBS += $(QUIP_LIB)/libFoX_fsys.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBPEXSI),)
|
||||
USE_LIBPEXSI := $(strip $(USE_LIBPEXSI))
|
||||
SCOTCH_VER := $(strip $(SCOTCH_VER))
|
||||
SUPERLU_VER := $(strip $(SUPERLU_VER))
|
||||
LIBPEXSI_INC := $(INSTALL_PATH)/pexsi-$(USE_LIBPEXSI)/include
|
||||
LIBPEXSI_LIB := $(INSTALL_PATH)/pexsi-$(USE_LIBPEXSI)/lib
|
||||
SCOTCH_INC := $(INSTALL_PATH)/scotch-$(SCOTCH_VER)/include
|
||||
SCOTCH_LIB := $(INSTALL_PATH)/scotch-$(SCOTCH_VER)/lib
|
||||
SUPERLU_INC := $(INSTALL_PATH)/superlu_dist-$(SUPERLU_VER)/include
|
||||
SUPERLU_LIB := $(INSTALL_PATH)/superlu_dist-$(SUPERLU_VER)/lib
|
||||
CFLAGS += -I$(LIBPEXSI_INC) -I$(SCOTCH_INC) -I$(SUPERLU_INC)
|
||||
DFLAGS += -D__LIBPEXSI
|
||||
LIBS += $(LIBPEXSI_LIB)/libpexsi.a
|
||||
LIBS += $(SUPERLU_LIB)/libsuperlu_dist.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotchparmetis.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotch.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotcherr.a
|
||||
LIBS += $(SCOTCH_LIB)/libscotchmetis.a
|
||||
LIBS += $(SCOTCH_LIB)/libscotch.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBVORI),)
|
||||
USE_LIBVORI := $(strip $(USE_LIBVORI))
|
||||
LIBVORI_LIB := $(INSTALL_PATH)/libvori-$(USE_LIBVORI)/lib
|
||||
DFLAGS += -D__LIBVORI
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBVORI_LIB) -L$(LIBVORI_LIB) -lvori
|
||||
else
|
||||
LIBS += $(LIBVORI_LIB)/libvori.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBXC),)
|
||||
USE_LIBXC := $(strip $(USE_LIBXC))
|
||||
LIBXC_INC := $(INSTALL_PATH)/libxc-$(USE_LIBXC)/include
|
||||
LIBXC_LIB := $(INSTALL_PATH)/libxc-$(USE_LIBXC)/lib
|
||||
CFLAGS += -I$(LIBXC_INC)
|
||||
DFLAGS += -D__LIBXC
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBXC_LIB) -L$(LIBXC_LIB) -lxcf03 -lxc
|
||||
else
|
||||
LIBS += $(LIBXC_LIB)/libxcf03.a
|
||||
LIBS += $(LIBXC_LIB)/libxc.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBINT),)
|
||||
USE_LIBINT := $(strip $(USE_LIBINT))
|
||||
LMAX := $(strip $(LMAX))
|
||||
LIBINT_INC := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/include
|
||||
LIBINT_LIB := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/lib
|
||||
CFLAGS += -I$(LIBINT_INC)
|
||||
DFLAGS += -D__LIBINT
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBINT_LIB) -L$(LIBINT_LIB) -lint2
|
||||
else
|
||||
LIBS += $(LIBINT_LIB)/libint2.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPGLIB),)
|
||||
USE_SPGLIB := $(strip $(USE_SPGLIB))
|
||||
SPGLIB_INC := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/include
|
||||
SPGLIB_LIB := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/lib
|
||||
CFLAGS += -I$(SPGLIB_INC)
|
||||
DFLAGS += -D__SPGLIB
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SPGLIB_LIB) -L$(SPGLIB_LIB) -lsymspg
|
||||
else
|
||||
LIBS += $(SPGLIB_LIB)/libsymspg.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBXSMM),)
|
||||
USE_LIBXSMM := $(strip $(USE_LIBXSMM))
|
||||
LIBXSMM_INC := $(INSTALL_PATH)/libxsmm-$(USE_LIBXSMM)/include
|
||||
LIBXSMM_LIB := $(INSTALL_PATH)/libxsmm-$(USE_LIBXSMM)/lib
|
||||
CFLAGS += -I$(LIBXSMM_INC)
|
||||
DFLAGS += -D__LIBXSMM
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBXSMM_LIB) -L$(LIBXSMM_LIB) -lxsmmf -lxsmm
|
||||
else
|
||||
LIBS += $(LIBXSMM_LIB)/libxsmmf.a
|
||||
LIBS += $(LIBXSMM_LIB)/libxsmm.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SIRIUS),)
|
||||
USE_SIRIUS := $(strip $(USE_SIRIUS))
|
||||
LIBVDWXC_VER := $(strip $(LIBVDWXC_VER))
|
||||
LIBVDWXC_INC := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/include
|
||||
LIBVDWXC_LIB := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/lib
|
||||
SPFFT_VER := $(strip $(SPFFT_VER))
|
||||
SPFFT_INC := $(INSTALL_PATH)/SpFFT-$(SPFFT_VER)/include
|
||||
SPLA_VER := $(strip $(SPLA_VER))
|
||||
SPLA_INC := $(INSTALL_PATH)/SpLA-$(SPLA_VER)/include/spla
|
||||
ifeq ($(USE_ACC), yes)
|
||||
DFLAGS += -D__OFFLOAD_GEMM
|
||||
SPFFT_LIB := $(INSTALL_PATH)/SpFFT-$(SPFFT_VER)/lib/cuda
|
||||
SPLA_LIB := $(INSTALL_PATH)/SpLA-$(SPLA_VER)/lib/cuda
|
||||
SIRIUS_INC := $(INSTALL_PATH)/sirius-$(USE_SIRIUS)/include/cuda
|
||||
SIRIUS_LIB := $(INSTALL_PATH)/sirius-$(USE_SIRIUS)/lib/cuda
|
||||
else
|
||||
SPFFT_LIB := $(INSTALL_PATH)/SpFFT-$(SPFFT_VER)/lib
|
||||
SPLA_LIB := $(INSTALL_PATH)/SpLA-$(SPLA_VER)/lib
|
||||
SIRIUS_INC := $(INSTALL_PATH)/sirius-$(USE_SIRIUS)/include
|
||||
SIRIUS_LIB := $(INSTALL_PATH)/sirius-$(USE_SIRIUS)/lib
|
||||
endif
|
||||
CFLAGS += -I$(LIBVDWXC_INC)
|
||||
CFLAGS += -I$(SPFFT_INC)
|
||||
CFLAGS += -I$(SPLA_INC)
|
||||
CFLAGS += -I$(SIRIUS_INC)
|
||||
DFLAGS += -D__LIBVDWXC
|
||||
DFLAGS += -D__SPFFT
|
||||
DFLAGS += -D__SPLA
|
||||
DFLAGS += -D__SIRIUS
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SIRIUS_LIB) -L$(SIRIUS_LIB) -lsirius
|
||||
LIBS += -Wl,-rpath=$(SPLA_LIB) -L$(SPLA_LIB) -lspla
|
||||
LIBS += -Wl,-rpath=$(SPFFT_LIB) -L$(SPFFT_LIB) -lspfft
|
||||
LIBS += -Wl,-rpath=$(LIBVDWXC_LIB) -L$(LIBVDWXC_LIB) -lvdwxc
|
||||
else
|
||||
LIBS += $(SIRIUS_LIB)/libsirius.a
|
||||
LIBS += $(SPLA_LIB)/libspla.a
|
||||
LIBS += $(SPFFT_LIB)/libspfft.a
|
||||
LIBS += $(LIBVDWXC_LIB)/libvdwxc.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_HDF5),)
|
||||
USE_HDF5 := $(strip $(USE_HDF5))
|
||||
HDF5_INC := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/include
|
||||
HDF5_LIB := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/lib
|
||||
CFLAGS += -I$(HDF5_INC)
|
||||
DFLAGS += -D__HDF5
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath,$(HDF5_LIB) -L$(HDF5_LIB) -lhdf5_fortran -lhdf5
|
||||
else
|
||||
LIBS += $(HDF5_LIB)/libhdf5_fortran.a
|
||||
LIBS += $(HDF5_LIB)/libhdf5_f90cstub.a
|
||||
LIBS += $(HDF5_LIB)/libhdf5.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_COSMA),)
|
||||
USE_COSMA := $(strip $(USE_COSMA))
|
||||
ifeq ($(USE_ACC), yes)
|
||||
USE_COSMA := $(USE_COSMA)-cuda
|
||||
endif
|
||||
COSMA_INC := $(INSTALL_PATH)/COSMA-$(USE_COSMA)/include
|
||||
COSMA_LIB := $(INSTALL_PATH)/COSMA-$(USE_COSMA)/lib
|
||||
CFLAGS += -I$(COSMA_INC)
|
||||
DFLAGS += -D__COSMA
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(COSMA_LIB) -L$(COSMA_LIB) -lcosma_prefixed_pxgemm -lcosma -lcosta
|
||||
ifeq ($(USE_ACC), yes)
|
||||
LIBS += -lTiled-MM
|
||||
endif
|
||||
else
|
||||
LIBS += $(COSMA_LIB)/libcosma_prefixed_pxgemm.a
|
||||
LIBS += $(COSMA_LIB)/libcosma.a
|
||||
LIBS += $(COSMA_LIB)/libcosta.a
|
||||
ifeq ($(USE_ACC), yes)
|
||||
LIBS += $(COSMA_LIB)/libTiled-MM.a
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_FFTW),)
|
||||
USE_FFTW := $(strip $(USE_FFTW))
|
||||
FFTW_INC := $(INSTALL_PATH)/fftw-$(USE_FFTW)/include
|
||||
FFTW_LIB := $(INSTALL_PATH)/fftw-$(USE_FFTW)/lib
|
||||
CFLAGS += -I$(FFTW_INC)
|
||||
DFLAGS += -D__FFTW3
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(FFTW_LIB) -L$(FFTW_LIB) -lfftw3_mpi -lfftw3_omp -lfftw3
|
||||
else
|
||||
LIBS += $(FFTW_LIB)/libfftw3_mpi.a
|
||||
LIBS += $(FFTW_LIB)/libfftw3_omp.a
|
||||
LIBS += $(FFTW_LIB)/libfftw3.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SCALAPACK),)
|
||||
SCALAPACK_LIB := $(INSTALL_PATH)/scalapack-$(USE_SCALAPACK)/lib
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SCALAPACK_LIB) -L$(SCALAPACK_LIB) -lscalapack
|
||||
else
|
||||
LIBS += $(SCALAPACK_LIB)/libscalapack.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_GSL),)
|
||||
USE_GSL := $(strip $(USE_GSL))
|
||||
GSL_INC := $(INSTALL_PATH)/gsl-$(USE_GSL)/include
|
||||
GSL_LIB := $(INSTALL_PATH)/gsl-$(USE_GSL)/lib
|
||||
CFLAGS += -I$(GSL_INC)
|
||||
DFLAGS += -D__GSL
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(GSL_LIB) -L$(GSL_LIB) -lgsl
|
||||
else
|
||||
LIBS += $(GSL_LIB)/libgsl.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_OPENBLAS),)
|
||||
USE_OPENBLAS := $(strip $(USE_OPENBLAS))
|
||||
OPENBLAS_INC := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/include
|
||||
OPENBLAS_LIB := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/lib
|
||||
CFLAGS += -I$(OPENBLAS_INC)
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(OPENBLAS_LIB) -L$(OPENBLAS_LIB) -lopenblas
|
||||
else
|
||||
LIBS += $(OPENBLAS_LIB)/libopenblas.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(shell [ $(shell ldd --version | head -n 1 | tr -s '.' '\n' | tail -n 1) -ge 27 ] && echo yes), yes)
|
||||
ifneq ($(USE_LIBTORCH),)
|
||||
USE_LIBTORCH := $(strip $(USE_LIBTORCH))
|
||||
LIBTORCH_INC := $(INSTALL_PATH)/libtorch-$(USE_LIBTORCH)/include
|
||||
LIBTORCH_LIB := $(INSTALL_PATH)/libtorch-$(USE_LIBTORCH)/lib
|
||||
CFLAGS += -I$(LIBTORCH_INC)
|
||||
DFLAGS += -D__LIBTORCH
|
||||
ifeq ($(USE_ACC), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBTORCH_LIB) -L$(LIBTORCH_LIB) -lc10 -ltorch_cpu -ltorch
|
||||
# LIBS += -Wl,-rpath=$(LIBTORCH_LIB) -L$(LIBTORCH_LIB) -lc10 -lc10_cuda -ltorch_cpu -ltorch_cuda -ltorch
|
||||
else
|
||||
LIBS += -Wl,-rpath=$(LIBTORCH_LIB) -L$(LIBTORCH_LIB) -lc10 -ltorch_cpu -ltorch
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
CFLAGS += $(DFLAGS)
|
||||
|
||||
FCFLAGS := $(CFLAGS)
|
||||
ifeq ($(shell [ $(shell gcc -dumpversion | cut -d. -f1) -gt 9 ] && echo yes), yes)
|
||||
FCFLAGS += -fallow-argument-mismatch
|
||||
endif
|
||||
FCFLAGS += -fbacktrace
|
||||
FCFLAGS += -ffree-form
|
||||
FCFLAGS += -ffree-line-length-none
|
||||
FCFLAGS += -fno-omit-frame-pointer
|
||||
FCFLAGS += -std=f2008
|
||||
|
||||
ifneq ($(CUDA_HOME),)
|
||||
CFLAGS += -I$(CUDA_HOME)/include
|
||||
FCFLAGS += -I$(CUDA_HOME)/include
|
||||
CUDA_LIB := $(CUDA_HOME)/lib64
|
||||
LDFLAGS += $(FCFLAGS) -L$(CUDA_LIB) -Wl,-rpath=$(CUDA_LIB)
|
||||
else
|
||||
LDFLAGS += $(FCFLAGS)
|
||||
endif
|
||||
|
||||
CFLAGS += $(CFLAGS) -std=c11
|
||||
CXXFLAGS := $(CFLAGS) -std=c++14
|
||||
ifeq ($(USE_ACC), yes)
|
||||
OFFLOAD_FLAGS := $(DFLAGS) -O3 -Xcompiler='-fopenmp' -allow-unsupported-compiler -arch sm_80 -g --std=c++11
|
||||
LIBS += -lcusolver -lcudart -lnvrtc -lcuda -lcufft -lcublas -lrt
|
||||
endif
|
||||
|
||||
LIBS += -lz -ldl -lpthread -lstdc++
|
||||
|
||||
# End
|
||||
193
arch/Linux-gnu-aarch64-static.ssmp
Normal file
193
arch/Linux-gnu-aarch64-static.ssmp
Normal file
|
|
@ -0,0 +1,193 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# CP2K (GNU aarch64) arch file for a serial static ARM64 binary
|
||||
#
|
||||
# Tested with: GNU 14.1.0, FFTW 3.3.10, LIBINT 2.6.0, LIBVORI 220621,
|
||||
# LIBXC 6.2.2, OpenBLAS 0.3.27, SPGLIB 2.3.1, DFTD4 3.6.0,
|
||||
# LIBGRPP 20231225
|
||||
#
|
||||
# Usage: Source this arch file and then run make as instructed.
|
||||
#
|
||||
# Last update: 04.08.2024
|
||||
#
|
||||
# \
|
||||
if [[ "${0}" == "${BASH_SOURCE}" ]]; then \
|
||||
echo "ERROR: Script ${0##*/} must be sourced"; \
|
||||
echo "Usage: source ${0##*/}"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
this_file=${BASH_SOURCE##*/}; \
|
||||
cd tools/toolchain; \
|
||||
rm -rf build; \
|
||||
[[ -z "${target_cpu}" ]] && target_cpu="native"; \
|
||||
./install_cp2k_toolchain.sh -j${maxtasks} --mpi-mode=no --no-arch-files --target-cpu=${target_cpu} --with-gcc --with-libxsmm=no; \
|
||||
source ./install/setup; \
|
||||
cd ../..; \
|
||||
echo; \
|
||||
echo "Check the output above for error messages and consistency!"; \
|
||||
echo; \
|
||||
echo "If everything is OK, you can build a CP2K production binary with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.}"; \
|
||||
echo "Further checks are performed, if DO_CHECKS=yes is added."; \
|
||||
echo; \
|
||||
return
|
||||
|
||||
# Set options
|
||||
DO_CHECKS := no
|
||||
TARGET_CPU := native
|
||||
GNU_VER := $(shell gcc -dumpfullversion)
|
||||
USE_DFTD4 := 3.6.0
|
||||
USE_FFTW := 3.3.10
|
||||
USE_LIBGRPP := 20231225
|
||||
USE_LIBINT := 2.6.0
|
||||
USE_LIBVORI := 220621
|
||||
USE_LIBXC := 6.2.2
|
||||
USE_OPENBLAS := 0.3.27
|
||||
USE_SPGLIB := 2.3.1
|
||||
|
||||
LMAX := 5
|
||||
MAX_CONTR := 4
|
||||
|
||||
CC := gcc
|
||||
CXX := g++
|
||||
FC := gfortran
|
||||
LD := gfortran
|
||||
AR := ar -r
|
||||
|
||||
CFLAGS := -O2 -fopenmp -fopenmp-simd -ftree-vectorize -funroll-loops -g -mtune=$(TARGET_CPU)
|
||||
|
||||
DFLAGS += -D__MAX_CONTR=$(strip $(MAX_CONTR))
|
||||
|
||||
INSTALL_PATH := $(PWD)/tools/toolchain/install
|
||||
|
||||
# Settings for regression testing
|
||||
ifeq ($(DO_CHECKS), yes)
|
||||
DFLAGS += -D__CHECK_DIAG
|
||||
# CFLAGS_DEBUG := -fsanitize=address
|
||||
CFLAGS_DEBUG := -fsanitize=leak
|
||||
FCFLAGS_DEBUG := -fcheck=bounds,do,recursion,pointer
|
||||
FCFLAGS_DEBUG += -fcheck=all,no-array-temps
|
||||
FCFLAGS_DEBUG += -ffpe-trap=invalid,overflow,zero
|
||||
FCFLAGS_DEBUG += -fimplicit-none
|
||||
FCFLAGS_DEBUG += -finit-derived
|
||||
FCFLAGS_DEBUG += -finit-real=snan
|
||||
FCFLAGS_DEBUG += -finit-integer=-42
|
||||
FCFLAGS_DEBUG += -finline-matmul-limit=0
|
||||
WFLAGS := -Werror=aliasing
|
||||
WFLAGS += -Werror=ampersand
|
||||
WFLAGS += -Werror=c-binding-type
|
||||
WFLAGS += -Werror=conversion
|
||||
WFLAGS += -Werror=intrinsic-shadow
|
||||
WFLAGS += -Werror=intrinsics-std
|
||||
WFLAGS += -Werror=line-truncation
|
||||
WFLAGS += -Wrealloc-lhs
|
||||
WFLAGS += -Werror=tabs
|
||||
WFLAGS += -Werror=target-lifetime
|
||||
WFLAGS += -Werror=underflow
|
||||
WFLAGS += -Werror=unused-but-set-variable
|
||||
WFLAGS += -Werror=unused-dummy-argument
|
||||
WFLAGS += -Werror=unused-variable
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBVORI),)
|
||||
USE_LIBVORI := $(strip $(USE_LIBVORI))
|
||||
LIBVORI_LIB := $(INSTALL_PATH)/libvori-$(USE_LIBVORI)/lib
|
||||
DFLAGS += -D__LIBVORI
|
||||
LIBS += $(LIBVORI_LIB)/libvori.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBXC),)
|
||||
USE_LIBXC := $(strip $(USE_LIBXC))
|
||||
LIBXC_INC := $(INSTALL_PATH)/libxc-$(USE_LIBXC)/include
|
||||
LIBXC_LIB := $(INSTALL_PATH)/libxc-$(USE_LIBXC)/lib
|
||||
CFLAGS += -I$(LIBXC_INC)
|
||||
DFLAGS += -D__LIBXC
|
||||
LIBS += $(LIBXC_LIB)/libxcf03.a
|
||||
LIBS += $(LIBXC_LIB)/libxc.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_DFTD4),)
|
||||
USE_DFTD4 := $(strip $(USE_DFTD4))
|
||||
DFTD4_INC := $(INSTALL_PATH)/dftd4-$(USE_DFTD4)/include
|
||||
DFTD4_LIB := $(INSTALL_PATH)/dftd4-$(USE_DFTD4)/lib
|
||||
CFLAGS += -I$(DFTD4_INC)/dftd4/GNU-$(GNU_VER)
|
||||
DFLAGS += -D__DFTD4
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(DFTD4_LIB) -L$(DFTD4_LIB) -ldftd4 -lmstore -lmulticharge -lmctc-lib
|
||||
else
|
||||
LIBS += $(DFTD4_LIB)/libdftd4.a
|
||||
LIBS += $(DFTD4_LIB)/libmstore.a
|
||||
LIBS += $(DFTD4_LIB)/libmulticharge.a
|
||||
LIBS += $(DFTD4_LIB)/libmctc-lib.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBGRPP),)
|
||||
USE_LIBGRPP := $(strip $(USE_LIBGRPP))
|
||||
LIBGRPP_INC := $(INSTALL_PATH)/libgrpp-main-$(USE_LIBGRPP)/include
|
||||
LIBGRPP_LIB := $(INSTALL_PATH)/libgrpp-main-$(USE_LIBGRPP)/lib
|
||||
CFLAGS += -I$(LIBGRPP_INC)
|
||||
DFLAGS += -D__LIBGRPP
|
||||
LIBS += $(LIBGRPP_LIB)/liblibgrpp.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBINT),)
|
||||
USE_LIBINT := $(strip $(USE_LIBINT))
|
||||
LMAX := $(strip $(LMAX))
|
||||
LIBINT_INC := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/include
|
||||
LIBINT_LIB := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/lib
|
||||
CFLAGS += -I$(LIBINT_INC)
|
||||
DFLAGS += -D__LIBINT
|
||||
LIBS += $(LIBINT_LIB)/libint2.a
|
||||
LIBS += $(LIBINT_LIB)/libint2.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPGLIB),)
|
||||
USE_SPGLIB := $(strip $(USE_SPGLIB))
|
||||
SPGLIB_INC := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/include
|
||||
SPGLIB_LIB := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/lib
|
||||
CFLAGS += -I$(SPGLIB_INC)
|
||||
DFLAGS += -D__SPGLIB
|
||||
LIBS += $(SPGLIB_LIB)/libsymspg.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_FFTW),)
|
||||
USE_FFTW := $(strip $(USE_FFTW))
|
||||
FFTW_INC := $(INSTALL_PATH)/fftw-$(USE_FFTW)/include
|
||||
FFTW_LIB := $(INSTALL_PATH)/fftw-$(USE_FFTW)/lib
|
||||
CFLAGS += -I$(FFTW_INC)
|
||||
DFLAGS += -D__FFTW3
|
||||
LIBS += $(FFTW_LIB)/libfftw3_omp.a
|
||||
LIBS += $(FFTW_LIB)/libfftw3.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_OPENBLAS),)
|
||||
USE_OPENBLAS := $(strip $(USE_OPENBLAS))
|
||||
OPENBLAS_INC := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/include
|
||||
OPENBLAS_LIB := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/lib
|
||||
CFLAGS += -I$(OPENBLAS_INC)
|
||||
LIBS += $(OPENBLAS_LIB)/libopenblas.a
|
||||
endif
|
||||
|
||||
CFLAGS += $(DFLAGS) $(CFLAGS_DEBUG)
|
||||
|
||||
FCFLAGS := $(CFLAGS) $(FCFLAGS_DEBUG) $(WFLAGS)
|
||||
ifeq ($(shell [ $(shell gcc -dumpversion | cut -d. -f1) -gt 9 ] && echo yes), yes)
|
||||
FCFLAGS += -fallow-argument-mismatch
|
||||
endif
|
||||
FCFLAGS += -fbacktrace
|
||||
FCFLAGS += -ffree-form
|
||||
FCFLAGS += -ffree-line-length-none
|
||||
FCFLAGS += -fno-omit-frame-pointer
|
||||
FCFLAGS += -std=f2008
|
||||
|
||||
# The LeakSanitizer does not work with static linking
|
||||
ifeq ($(DO_CHECKS), yes)
|
||||
LDFLAGS += $(FCFLAGS)
|
||||
else
|
||||
LDFLAGS += $(FCFLAGS) -static
|
||||
endif
|
||||
|
||||
LIBS += -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -ldl -lstdc++
|
||||
|
||||
# End
|
||||
430
arch/Linux-gnu-aarch64.psmp
Normal file
430
arch/Linux-gnu-aarch64.psmp
Normal file
|
|
@ -0,0 +1,430 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# CP2K (GNU aarch64) arch file for Linux clusters
|
||||
#
|
||||
# Tested with: GNU 14.1.0, MPICH 4.0.3,
|
||||
# ScaLAPACK 2.2.1, OpenBLAS 0.3.27,
|
||||
# FFTW 3.3.10, HDF5 1.14.2,
|
||||
# LIBINT 2.6.0, LIBXC 6.2.2,
|
||||
# ELPA 2024.03.001, PLUMED 2.9.0,
|
||||
# SPGLIB 2.3.1, LIBVORI 220621,
|
||||
# GSL 2.7, COSMA 2.6.6, SIRIUS 7.5.2,
|
||||
# LIBGRPP 20231225, SPFFT 1.1.0, SPLA 1.6.1,
|
||||
# DFTD4 3.6.0
|
||||
#
|
||||
# Usage: Source this arch file and then run make as instructed.
|
||||
# A full toolchain installation is performed as default.
|
||||
#
|
||||
# Last update: 04.08.2024
|
||||
#
|
||||
# \
|
||||
if [[ "${0}" == "${BASH_SOURCE}" ]]; then \
|
||||
echo "ERROR: Script ${0##*/} must be sourced"; \
|
||||
echo "Usage: source ${0##*/}"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
this_file=${BASH_SOURCE##*/}; \
|
||||
cd tools/toolchain; \
|
||||
rm -rf build; \
|
||||
[[ -z "${mpi_implementation}" ]] && mpi_implementation="mpich"; \
|
||||
[[ -z "${target_cpu}" ]] && target_cpu="native"; \
|
||||
./install_cp2k_toolchain.sh --install-all -j${maxtasks} --no-arch-files --target-cpu=${target_cpu} --with-gcc --with-${mpi_implementation} --with-libxsmm=no; \
|
||||
source ./install/setup; \
|
||||
cd ../..; \
|
||||
echo; \
|
||||
echo "Check the output above for error messages and consistency!"; \
|
||||
echo; \
|
||||
echo "If everything is OK, you can build a CP2K production binary with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.}"; \
|
||||
echo; \
|
||||
echo "Alternatively, you can add further checks, e.g. for regression testing, with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.} DO_CHECKS=yes"; \
|
||||
echo "or build CP2K only with shared libraries using"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.} SHARED=yes"; \
|
||||
echo "or build CP2K as a library with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.} libcp2k"; \
|
||||
echo; \
|
||||
echo "Run always the following command before using the CP2K binary"; \
|
||||
echo " source ${PWD}/tools/toolchain/install/setup"; \
|
||||
echo; \
|
||||
return
|
||||
|
||||
# Set options
|
||||
DO_CHECKS := no
|
||||
SHARED := no
|
||||
TARGET_CPU := native
|
||||
GNU_VER := $(shell gcc -dumpfullversion)
|
||||
USE_COSMA := 2.6.6
|
||||
USE_DFTD4 := 3.6.0
|
||||
USE_ELPA := 2024.03.001
|
||||
USE_FFTW := 3.3.10
|
||||
USE_HDF5 := 1.14.2
|
||||
USE_LIBGRPP := 20231225
|
||||
USE_LIBINT := 2.6.0
|
||||
USE_LIBPEXSI := 1.2.0
|
||||
USE_LIBVORI := 220621
|
||||
USE_LIBXC := 6.2.2
|
||||
#USE_LIBXSMM := 1.17
|
||||
USE_OPENBLAS := 0.3.27
|
||||
USE_PLUMED := 2.9.0
|
||||
USE_QUIP := 0.9.10
|
||||
USE_SCALAPACK := 2.2.1
|
||||
USE_SIRIUS := 7.5.2
|
||||
USE_SPFFT := 1.1.0
|
||||
USE_SPGLIB := 2.3.1
|
||||
USE_SPLA := 1.6.1
|
||||
# Only needed for SIRIUS
|
||||
LIBVDWXC_VER := 0.4.0
|
||||
# Only needed for LIBPEXSI
|
||||
SCOTCH_VER := 6.0.0
|
||||
SUPERLU_VER := 6.1.0
|
||||
|
||||
LMAX := 5
|
||||
MAX_CONTR := 4
|
||||
|
||||
CC := mpicc
|
||||
FC := mpifort
|
||||
LD := mpifort
|
||||
AR := ar -r
|
||||
|
||||
CFLAGS := -O2 -fopenmp -fopenmp-simd -ftree-vectorize -funroll-loops -g -mtune=$(TARGET_CPU)
|
||||
|
||||
DFLAGS := -D__parallel
|
||||
DFLAGS += -D__HAS_IEEE_EXCEPTIONS
|
||||
DFLAGS += -D__MAX_CONTR=$(strip $(MAX_CONTR))
|
||||
|
||||
INSTALL_PATH := $(PWD)/tools/toolchain/install
|
||||
|
||||
ifeq ($(SHARED), yes)
|
||||
LD_SHARED := $(FC) -shared
|
||||
CFLAGS += -fPIC
|
||||
LDFLAGS := -Wl,--enable-new-dtags
|
||||
CP2K_LIB := $(PWD)/lib/$(ARCH)/$(ONEVERSION)
|
||||
LDFLAGS += -Wl,-rpath=$(CP2K_LIB)
|
||||
LDFLAGS += -Wl,-rpath=$(CP2K_LIB)/exts/dbcsr
|
||||
endif
|
||||
|
||||
# Settings for regression testing
|
||||
ifeq ($(DO_CHECKS), yes)
|
||||
DFLAGS += -D__CHECK_DIAG
|
||||
# CFLAGS_DEBUG := -fsanitize=address
|
||||
CFLAGS_DEBUG := -fsanitize=leak
|
||||
FCFLAGS_DEBUG := -fcheck=bounds,do,recursion,pointer
|
||||
FCFLAGS_DEBUG += -fcheck=all,no-array-temps
|
||||
FCFLAGS_DEBUG += -ffpe-trap=invalid,overflow,zero
|
||||
FCFLAGS_DEBUG += -fimplicit-none
|
||||
FCFLAGS_DEBUG += -finit-derived
|
||||
FCFLAGS_DEBUG += -finit-real=snan
|
||||
FCFLAGS_DEBUG += -finit-integer=-42
|
||||
FCFLAGS_DEBUG += -finline-matmul-limit=0
|
||||
WFLAGS := -Werror=aliasing
|
||||
WFLAGS += -Werror=ampersand
|
||||
WFLAGS += -Werror=c-binding-type
|
||||
WFLAGS += -Werror=conversion
|
||||
WFLAGS += -Werror=intrinsic-shadow
|
||||
WFLAGS += -Werror=intrinsics-std
|
||||
WFLAGS += -Werror=line-truncation
|
||||
WFLAGS += -Wrealloc-lhs
|
||||
WFLAGS += -Werror=tabs
|
||||
WFLAGS += -Werror=target-lifetime
|
||||
WFLAGS += -Werror=underflow
|
||||
WFLAGS += -Werror=unused-but-set-variable
|
||||
WFLAGS += -Werror=unused-dummy-argument
|
||||
WFLAGS += -Werror=unused-variable
|
||||
endif
|
||||
|
||||
ifneq ($(USE_PLUMED),)
|
||||
USE_PLUMED := $(strip $(USE_PLUMED))
|
||||
PLUMED_LIB := $(INSTALL_PATH)/plumed-$(USE_PLUMED)/lib
|
||||
DFLAGS += -D__PLUMED2
|
||||
USE_GSL := 2.7
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(PLUMED_LIB) -L$(PLUMED_LIB) -lplumed -lplumedKernel
|
||||
else
|
||||
LIBS += $(PLUMED_LIB)/libplumed.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_ELPA),)
|
||||
USE_ELPA := $(strip $(USE_ELPA))
|
||||
ELPA_INC := $(INSTALL_PATH)/elpa-$(USE_ELPA)/cpu/include/elpa_openmp-$(USE_ELPA)
|
||||
ELPA_LIB := $(INSTALL_PATH)/elpa-$(USE_ELPA)/cpu/lib
|
||||
CFLAGS += -I$(ELPA_INC)/elpa -I$(ELPA_INC)/modules
|
||||
DFLAGS += -D__ELPA
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(ELPA_LIB) -L$(ELPA_LIB) -lelpa_openmp
|
||||
else
|
||||
LIBS += $(ELPA_LIB)/libelpa_openmp.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_QUIP),)
|
||||
USE_QUIP := $(strip $(USE_QUIP))
|
||||
QUIP_INC := $(INSTALL_PATH)/quip-$(USE_QUIP)/include
|
||||
QUIP_LIB := $(INSTALL_PATH)/quip-$(USE_QUIP)/lib
|
||||
CFLAGS += -I$(QUIP_INC)
|
||||
DFLAGS += -D__QUIP
|
||||
LIBS += $(QUIP_LIB)/libquip_core.a
|
||||
LIBS += $(QUIP_LIB)/libatoms.a
|
||||
LIBS += $(QUIP_LIB)/libFoX_sax.a
|
||||
LIBS += $(QUIP_LIB)/libFoX_common.a
|
||||
LIBS += $(QUIP_LIB)/libFoX_utils.a
|
||||
LIBS += $(QUIP_LIB)/libFoX_fsys.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBPEXSI),)
|
||||
USE_LIBPEXSI := $(strip $(USE_LIBPEXSI))
|
||||
SCOTCH_VER := $(strip $(SCOTCH_VER))
|
||||
SUPERLU_VER := $(strip $(SUPERLU_VER))
|
||||
LIBPEXSI_INC := $(INSTALL_PATH)/pexsi-$(USE_LIBPEXSI)/include
|
||||
LIBPEXSI_LIB := $(INSTALL_PATH)/pexsi-$(USE_LIBPEXSI)/lib
|
||||
SCOTCH_INC := $(INSTALL_PATH)/scotch-$(SCOTCH_VER)/include
|
||||
SCOTCH_LIB := $(INSTALL_PATH)/scotch-$(SCOTCH_VER)/lib
|
||||
SUPERLU_INC := $(INSTALL_PATH)/superlu_dist-$(SUPERLU_VER)/include
|
||||
SUPERLU_LIB := $(INSTALL_PATH)/superlu_dist-$(SUPERLU_VER)/lib
|
||||
CFLAGS += -I$(LIBPEXSI_INC) -I$(SCOTCH_INC) -I$(SUPERLU_INC)
|
||||
DFLAGS += -D__LIBPEXSI
|
||||
LIBS += $(LIBPEXSI_LIB)/libpexsi.a
|
||||
LIBS += $(SUPERLU_LIB)/libsuperlu_dist.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotchparmetis.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotch.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotcherr.a
|
||||
LIBS += $(SCOTCH_LIB)/libscotchmetis.a
|
||||
LIBS += $(SCOTCH_LIB)/libscotch.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBVORI),)
|
||||
USE_LIBVORI := $(strip $(USE_LIBVORI))
|
||||
LIBVORI_LIB := $(INSTALL_PATH)/libvori-$(USE_LIBVORI)/lib
|
||||
DFLAGS += -D__LIBVORI
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBVORI_LIB) -L$(LIBVORI_LIB) -lvori
|
||||
else
|
||||
LIBS += $(LIBVORI_LIB)/libvori.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBXC),)
|
||||
USE_LIBXC := $(strip $(USE_LIBXC))
|
||||
LIBXC_INC := $(INSTALL_PATH)/libxc-$(USE_LIBXC)/include
|
||||
LIBXC_LIB := $(INSTALL_PATH)/libxc-$(USE_LIBXC)/lib
|
||||
CFLAGS += -I$(LIBXC_INC)
|
||||
DFLAGS += -D__LIBXC
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBXC_LIB) -L$(LIBXC_LIB) -lxcf03 -lxc
|
||||
else
|
||||
LIBS += $(LIBXC_LIB)/libxcf03.a
|
||||
LIBS += $(LIBXC_LIB)/libxc.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_DFTD4),)
|
||||
USE_DFTD4 := $(strip $(USE_DFTD4))
|
||||
DFTD4_INC := $(INSTALL_PATH)/dftd4-$(USE_DFTD4)/include
|
||||
DFTD4_LIB := $(INSTALL_PATH)/dftd4-$(USE_DFTD4)/lib
|
||||
CFLAGS += -I$(DFTD4_INC)/dftd4/GNU-$(GNU_VER)
|
||||
DFLAGS += -D__DFTD4
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(DFTD4_LIB) -L$(DFTD4_LIB) -ldftd4 -lmstore -lmulticharge -lmctc-lib
|
||||
else
|
||||
LIBS += $(DFTD4_LIB)/libdftd4.a
|
||||
LIBS += $(DFTD4_LIB)/libmstore.a
|
||||
LIBS += $(DFTD4_LIB)/libmulticharge.a
|
||||
LIBS += $(DFTD4_LIB)/libmctc-lib.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBGRPP),)
|
||||
USE_LIBGRPP := $(strip $(USE_LIBGRPP))
|
||||
LIBGRPP_INC := $(INSTALL_PATH)/libgrpp-main-$(USE_LIBGRPP)/include
|
||||
LIBGRPP_LIB := $(INSTALL_PATH)/libgrpp-main-$(USE_LIBGRPP)/lib
|
||||
CFLAGS += -I$(LIBGRPP_INC)
|
||||
DFLAGS += -D__LIBGRPP
|
||||
LIBS += $(LIBGRPP_LIB)/liblibgrpp.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBINT),)
|
||||
USE_LIBINT := $(strip $(USE_LIBINT))
|
||||
LMAX := $(strip $(LMAX))
|
||||
LIBINT_INC := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/include
|
||||
LIBINT_LIB := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/lib
|
||||
CFLAGS += -I$(LIBINT_INC)
|
||||
DFLAGS += -D__LIBINT
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBINT_LIB) -L$(LIBINT_LIB) -lint2
|
||||
else
|
||||
LIBS += $(LIBINT_LIB)/libint2.a
|
||||
LIBS += $(LIBINT_LIB)/libint2.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPGLIB),)
|
||||
USE_SPGLIB := $(strip $(USE_SPGLIB))
|
||||
SPGLIB_INC := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/include
|
||||
SPGLIB_LIB := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/lib
|
||||
CFLAGS += -I$(SPGLIB_INC)
|
||||
DFLAGS += -D__SPGLIB
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SPGLIB_LIB) -L$(SPGLIB_LIB) -lsymspg
|
||||
else
|
||||
LIBS += $(SPGLIB_LIB)/libsymspg.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBXSMM),)
|
||||
USE_LIBXSMM := $(strip $(USE_LIBXSMM))
|
||||
LIBXSMM_INC := $(INSTALL_PATH)/libxsmm-$(USE_LIBXSMM)/include
|
||||
LIBXSMM_LIB := $(INSTALL_PATH)/libxsmm-$(USE_LIBXSMM)/lib
|
||||
CFLAGS += -I$(LIBXSMM_INC)
|
||||
DFLAGS += -D__LIBXSMM
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBXSMM_LIB) -L$(LIBXSMM_LIB) -lxsmmf -lxsmm
|
||||
else
|
||||
LIBS += $(LIBXSMM_LIB)/libxsmmf.a
|
||||
LIBS += $(LIBXSMM_LIB)/libxsmm.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SIRIUS),)
|
||||
USE_SIRIUS := $(strip $(USE_SIRIUS))
|
||||
LIBVDWXC_VER := $(strip $(LIBVDWXC_VER))
|
||||
LIBVDWXC_INC := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/include
|
||||
LIBVDWXC_LIB := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/lib
|
||||
SIRIUS_INC := $(INSTALL_PATH)/sirius-$(USE_SIRIUS)/include
|
||||
SIRIUS_LIB := $(INSTALL_PATH)/sirius-$(USE_SIRIUS)/lib
|
||||
CFLAGS += -I$(LIBVDWXC_INC)
|
||||
CFLAGS += -I$(SIRIUS_INC)
|
||||
DFLAGS += -D__LIBVDWXC
|
||||
DFLAGS += -D__SIRIUS
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SIRIUS_LIB) -L$(SIRIUS_LIB) -lsirius
|
||||
LIBS += -Wl,-rpath=$(LIBVDWXC_LIB) -L$(LIBVDWXC_LIB) -lvdwxc
|
||||
else
|
||||
LIBS += $(SIRIUS_LIB)/libsirius.a
|
||||
LIBS += $(LIBVDWXC_LIB)/libvdwxc.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPFFT),)
|
||||
USE_SPFFT := $(strip $(USE_SPFFT))
|
||||
SPFFT_INC := $(INSTALL_PATH)/SpFFT-$(USE_SPFFT)/include
|
||||
SPFFT_LIB := $(INSTALL_PATH)/SpFFT-$(USE_SPFFT)/lib
|
||||
CFLAGS += -I$(SPFFT_INC)
|
||||
DFLAGS += -D__SPFFT
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SPFFT_LIB) -L$(SPFFT_LIB) -lspfft
|
||||
else
|
||||
LIBS += $(SPFFT_LIB)/libspfft.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPLA),)
|
||||
USE_SPLA := $(strip $(USE_SPLA))
|
||||
SPLA_INC := $(INSTALL_PATH)/SpLA-$(USE_SPLA)/include/spla
|
||||
SPLA_LIB := $(INSTALL_PATH)/SpLA-$(USE_SPLA)/lib
|
||||
CFLAGS += -I$(SPLA_INC)
|
||||
DFLAGS += -D__SPLA
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SPLA_LIB) -L$(SPLA_LIB) -lspla
|
||||
else
|
||||
LIBS += $(SPLA_LIB)/libspla.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_HDF5),)
|
||||
USE_HDF5 := $(strip $(USE_HDF5))
|
||||
HDF5_INC := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/include
|
||||
HDF5_LIB := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/lib
|
||||
CFLAGS += -I$(HDF5_INC)
|
||||
DFLAGS += -D__HDF5
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath,$(HDF5_LIB) -L$(HDF5_LIB) -lhdf5_fortran -lhdf5
|
||||
else
|
||||
LIBS += $(HDF5_LIB)/libhdf5_fortran.a
|
||||
LIBS += $(HDF5_LIB)/libhdf5_f90cstub.a
|
||||
LIBS += $(HDF5_LIB)/libhdf5.a
|
||||
endif
|
||||
LIBS += -lsz
|
||||
endif
|
||||
|
||||
ifneq ($(USE_COSMA),)
|
||||
USE_COSMA := $(strip $(USE_COSMA))
|
||||
COSMA_INC := $(INSTALL_PATH)/COSMA-$(USE_COSMA)/include
|
||||
COSMA_LIB := $(INSTALL_PATH)/COSMA-$(USE_COSMA)/lib
|
||||
CFLAGS += -I$(COSMA_INC)
|
||||
DFLAGS += -D__COSMA
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(COSMA_LIB) -L$(COSMA_LIB) -lcosma_prefixed_pxgemm -lcosma -lcosta
|
||||
else
|
||||
LIBS += $(COSMA_LIB)/libcosma_prefixed_pxgemm.a
|
||||
LIBS += $(COSMA_LIB)/libcosma.a
|
||||
LIBS += $(COSMA_LIB)/libcosta.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_FFTW),)
|
||||
USE_FFTW := $(strip $(USE_FFTW))
|
||||
FFTW_INC := $(INSTALL_PATH)/fftw-$(USE_FFTW)/include
|
||||
FFTW_LIB := $(INSTALL_PATH)/fftw-$(USE_FFTW)/lib
|
||||
CFLAGS += -I$(FFTW_INC)
|
||||
DFLAGS += -D__FFTW3
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(FFTW_LIB) -L$(FFTW_LIB) -lfftw3_mpi -lfftw3_omp -lfftw3
|
||||
else
|
||||
LIBS += $(FFTW_LIB)/libfftw3_mpi.a
|
||||
LIBS += $(FFTW_LIB)/libfftw3_omp.a
|
||||
LIBS += $(FFTW_LIB)/libfftw3.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SCALAPACK),)
|
||||
SCALAPACK_LIB := $(INSTALL_PATH)/scalapack-$(USE_SCALAPACK)/lib
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SCALAPACK_LIB) -L$(SCALAPACK_LIB) -lscalapack
|
||||
else
|
||||
LIBS += $(SCALAPACK_LIB)/libscalapack.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_GSL),)
|
||||
USE_GSL := $(strip $(USE_GSL))
|
||||
GSL_INC := $(INSTALL_PATH)/gsl-$(USE_GSL)/include
|
||||
GSL_LIB := $(INSTALL_PATH)/gsl-$(USE_GSL)/lib
|
||||
CFLAGS += -I$(GSL_INC)
|
||||
DFLAGS += -D__GSL
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(GSL_LIB) -L$(GSL_LIB) -lgsl
|
||||
else
|
||||
LIBS += $(GSL_LIB)/libgsl.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_OPENBLAS),)
|
||||
USE_OPENBLAS := $(strip $(USE_OPENBLAS))
|
||||
OPENBLAS_INC := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/include
|
||||
OPENBLAS_LIB := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/lib
|
||||
CFLAGS += -I$(OPENBLAS_INC)
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(OPENBLAS_LIB) -L$(OPENBLAS_LIB) -lopenblas
|
||||
else
|
||||
LIBS += $(OPENBLAS_LIB)/libopenblas.a
|
||||
endif
|
||||
endif
|
||||
|
||||
CFLAGS += $(DFLAGS) $(CFLAGS_DEBUG)
|
||||
|
||||
FCFLAGS := $(CFLAGS) $(FCFLAGS_DEBUG) $(WFLAGS)
|
||||
ifeq ($(shell [ $(shell gcc -dumpversion | cut -d. -f1) -gt 9 ] && echo yes), yes)
|
||||
FCFLAGS += -fallow-argument-mismatch
|
||||
endif
|
||||
FCFLAGS += -fbacktrace
|
||||
FCFLAGS += -ffree-form
|
||||
FCFLAGS += -ffree-line-length-none
|
||||
FCFLAGS += -fno-omit-frame-pointer
|
||||
FCFLAGS += -std=f2008
|
||||
|
||||
LDFLAGS += $(FCFLAGS)
|
||||
|
||||
LIBS += -lz -ldl -lstdc++
|
||||
|
||||
# End
|
||||
193
arch/Linux-gnu-x86_64-static.ssmp
Normal file
193
arch/Linux-gnu-x86_64-static.ssmp
Normal file
|
|
@ -0,0 +1,193 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# CP2K (GNU) arch file for a serial static x86_64 binary
|
||||
#
|
||||
# Tested with: GNU 14.1.0, FFTW 3.3.10, LIBINT 2.6.0, LIBVORI 220621,
|
||||
# LIBXC 6.2.2, OpenBLAS 0.3.27, SPGLIB 2.3.1, LIBVORI 220621,
|
||||
# LIBGRPP 20231225, DFTD4 3.6.0
|
||||
#
|
||||
# Usage: Source this arch file and then run make as instructed.
|
||||
#
|
||||
# Last update: 04.08.2024
|
||||
#
|
||||
# \
|
||||
if [[ "${0}" == "${BASH_SOURCE}" ]]; then \
|
||||
echo "ERROR: Script ${0##*/} must be sourced"; \
|
||||
echo "Usage: source ${0##*/}"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
this_file=${BASH_SOURCE##*/}; \
|
||||
cd tools/toolchain; \
|
||||
rm -rf build; \
|
||||
[[ -z "${target_cpu}" ]] && target_cpu="native"; \
|
||||
echo "Found GCC $(gcc -dumpfullversion) compiler"; \
|
||||
./install_cp2k_toolchain.sh -j${maxtasks} --mpi-mode=no --no-arch-files --target-cpu=${target_cpu} --with-gcc --with-dftd4; \
|
||||
source ./install/setup; \
|
||||
cd ../..; \
|
||||
echo; \
|
||||
echo "Check the output above for error messages and consistency!"; \
|
||||
echo; \
|
||||
echo "If everything is OK, you can build a CP2K production binary with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.}"; \
|
||||
echo "Further checks are performed, if DO_CHECKS=yes is added, but this disables static linking."; \
|
||||
echo; \
|
||||
return
|
||||
|
||||
# Set options
|
||||
DO_CHECKS := no
|
||||
TARGET_CPU := native
|
||||
GNU_VER := $(shell gcc -dumpfullversion)
|
||||
USE_DFTD4 := 3.6.0
|
||||
USE_FFTW := 3.3.10
|
||||
USE_LIBGRPP := 20231225
|
||||
USE_LIBINT := 2.6.0
|
||||
USE_LIBVORI := 220621
|
||||
USE_LIBXC := 6.2.2
|
||||
USE_OPENBLAS := 0.3.27
|
||||
USE_SPGLIB := 2.3.1
|
||||
|
||||
LMAX := 5
|
||||
MAX_CONTR := 4
|
||||
|
||||
CC := gcc
|
||||
CXX := g++
|
||||
FC := gfortran
|
||||
LD := gfortran
|
||||
AR := ar -r
|
||||
|
||||
ifeq ($(TARGET_CPU), generic)
|
||||
CFLAGS := -O2 -fopenmp -fopenmp-simd -ftree-vectorize -funroll-loops -g -mtune=$(TARGET_CPU)
|
||||
else
|
||||
CFLAGS := -O2 -fopenmp -fopenmp-simd -ftree-vectorize -funroll-loops -g -march=$(TARGET_CPU) -mtune=$(TARGET_CPU)
|
||||
endif
|
||||
|
||||
DFLAGS += -D__MAX_CONTR=$(strip $(MAX_CONTR))
|
||||
|
||||
INSTALL_PATH := $(PWD)/tools/toolchain/install
|
||||
|
||||
# Settings for regression testing
|
||||
ifeq ($(DO_CHECKS), yes)
|
||||
DFLAGS += -D__CHECK_DIAG
|
||||
# CFLAGS_DEBUG := -fsanitize=address
|
||||
CFLAGS_DEBUG := -fsanitize=leak
|
||||
FCFLAGS_DEBUG := -fcheck=bounds,do,recursion,pointer
|
||||
FCFLAGS_DEBUG += -fcheck=all,no-array-temps
|
||||
FCFLAGS_DEBUG += -ffpe-trap=invalid,overflow,zero
|
||||
FCFLAGS_DEBUG += -fimplicit-none
|
||||
FCFLAGS_DEBUG += -finit-derived
|
||||
FCFLAGS_DEBUG += -finit-real=snan
|
||||
FCFLAGS_DEBUG += -finit-integer=-42
|
||||
FCFLAGS_DEBUG += -finline-matmul-limit=0
|
||||
WFLAGS := -Werror=aliasing
|
||||
WFLAGS += -Werror=ampersand
|
||||
WFLAGS += -Werror=c-binding-type
|
||||
WFLAGS += -Werror=conversion
|
||||
WFLAGS += -Werror=intrinsic-shadow
|
||||
WFLAGS += -Werror=intrinsics-std
|
||||
WFLAGS += -Werror=line-truncation
|
||||
WFLAGS += -Wrealloc-lhs
|
||||
WFLAGS += -Werror=tabs
|
||||
WFLAGS += -Werror=target-lifetime
|
||||
WFLAGS += -Werror=underflow
|
||||
WFLAGS += -Werror=unused-but-set-variable
|
||||
WFLAGS += -Werror=unused-dummy-argument
|
||||
WFLAGS += -Werror=unused-variable
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBVORI),)
|
||||
USE_LIBVORI := $(strip $(USE_LIBVORI))
|
||||
LIBVORI_LIB := $(INSTALL_PATH)/libvori-$(USE_LIBVORI)/lib
|
||||
DFLAGS += -D__LIBVORI
|
||||
LIBS += $(LIBVORI_LIB)/libvori.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBXC),)
|
||||
USE_LIBXC := $(strip $(USE_LIBXC))
|
||||
LIBXC_INC := $(INSTALL_PATH)/libxc-$(USE_LIBXC)/include
|
||||
LIBXC_LIB := $(INSTALL_PATH)/libxc-$(USE_LIBXC)/lib
|
||||
CFLAGS += -I$(LIBXC_INC)
|
||||
DFLAGS += -D__LIBXC
|
||||
LIBS += $(LIBXC_LIB)/libxcf03.a
|
||||
LIBS += $(LIBXC_LIB)/libxc.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_DFTD4),)
|
||||
USE_DFTD4 := $(strip $(USE_DFTD4))
|
||||
DFTD4_INC := $(INSTALL_PATH)/dftd4-$(USE_DFTD4)/include
|
||||
DFTD4_LIB := $(INSTALL_PATH)/dftd4-$(USE_DFTD4)/lib64
|
||||
CFLAGS += -I$(DFTD4_INC)/dftd4/GNU-$(GNU_VER)
|
||||
DFLAGS += -D__DFTD4
|
||||
LIBS += $(DFTD4_LIB)/libdftd4.a
|
||||
LIBS += $(DFTD4_LIB)/libmstore.a
|
||||
LIBS += $(DFTD4_LIB)/libmulticharge.a
|
||||
LIBS += $(DFTD4_LIB)/libmctc-lib.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBGRPP),)
|
||||
USE_LIBGRPP := $(strip $(USE_LIBGRPP))
|
||||
LIBGRPP_INC := $(INSTALL_PATH)/libgrpp-main-$(USE_LIBGRPP)/include
|
||||
LIBGRPP_LIB := $(INSTALL_PATH)/libgrpp-main-$(USE_LIBGRPP)/lib
|
||||
CFLAGS += -I$(LIBGRPP_INC)
|
||||
DFLAGS += -D__LIBGRPP
|
||||
LIBS += $(LIBGRPP_LIB)/liblibgrpp.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBINT),)
|
||||
USE_LIBINT := $(strip $(USE_LIBINT))
|
||||
LMAX := $(strip $(LMAX))
|
||||
LIBINT_INC := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/include
|
||||
LIBINT_LIB := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/lib
|
||||
CFLAGS += -I$(LIBINT_INC)
|
||||
DFLAGS += -D__LIBINT
|
||||
LIBS += $(LIBINT_LIB)/libint2.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPGLIB),)
|
||||
USE_SPGLIB := $(strip $(USE_SPGLIB))
|
||||
SPGLIB_INC := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/include
|
||||
SPGLIB_LIB := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/lib
|
||||
CFLAGS += -I$(SPGLIB_INC)
|
||||
DFLAGS += -D__SPGLIB
|
||||
LIBS += $(SPGLIB_LIB)/libsymspg.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_FFTW),)
|
||||
USE_FFTW := $(strip $(USE_FFTW))
|
||||
FFTW_INC := $(INSTALL_PATH)/fftw-$(USE_FFTW)/include
|
||||
FFTW_LIB := $(INSTALL_PATH)/fftw-$(USE_FFTW)/lib
|
||||
CFLAGS += -I$(FFTW_INC)
|
||||
DFLAGS += -D__FFTW3
|
||||
LIBS += $(FFTW_LIB)/libfftw3_omp.a
|
||||
LIBS += $(FFTW_LIB)/libfftw3.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_OPENBLAS),)
|
||||
USE_OPENBLAS := $(strip $(USE_OPENBLAS))
|
||||
OPENBLAS_INC := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/include
|
||||
OPENBLAS_LIB := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/lib
|
||||
CFLAGS += -I$(OPENBLAS_INC)
|
||||
LIBS += $(OPENBLAS_LIB)/libopenblas.a
|
||||
endif
|
||||
|
||||
CFLAGS += $(DFLAGS) $(CFLAGS_DEBUG)
|
||||
|
||||
FCFLAGS := $(CFLAGS) $(FCFLAGS_DEBUG) $(WFLAGS)
|
||||
ifeq ($(shell [ $(shell gcc -dumpversion | cut -d. -f1) -gt 9 ] && echo yes), yes)
|
||||
FCFLAGS += -fallow-argument-mismatch
|
||||
endif
|
||||
FCFLAGS += -fbacktrace
|
||||
FCFLAGS += -ffree-form
|
||||
FCFLAGS += -ffree-line-length-none
|
||||
FCFLAGS += -fno-omit-frame-pointer
|
||||
FCFLAGS += -std=f2008
|
||||
|
||||
# The LeakSanitizer does not work with static linking
|
||||
ifeq ($(DO_CHECKS), yes)
|
||||
LDFLAGS += $(FCFLAGS)
|
||||
else
|
||||
LDFLAGS += $(FCFLAGS) -static
|
||||
endif
|
||||
|
||||
LIBS += -Wl,--whole-archive -lpthread -ldl -Wl,--no-whole-archive -lstdc++
|
||||
|
||||
# End
|
||||
462
arch/Linux-gnu-x86_64.psmp
Normal file
462
arch/Linux-gnu-x86_64.psmp
Normal file
|
|
@ -0,0 +1,462 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# CP2K (GNU x86_64) arch file for Linux clusters
|
||||
#
|
||||
# Tested with: GNU 14.1.0, MPICH 4.0.3 and OpenMPI 5.0.5,
|
||||
# ScaLAPACK 2.2.1, OpenBLAS 0.3.27,
|
||||
# FFTW 3.3.10, ELPA 2024.03.001, HDF5 1.14.2,
|
||||
# LIBINT 2.6.0, LIBXC 6.2.2, PLUMED 2.9.0,
|
||||
# SPGLIB 2.3.1, LIBVORI 220621, GSL 2.7,
|
||||
# COSMA 2.6.6, SIRIUS 7.5.2, LIBTORCH 1.12.1,
|
||||
# LIBGRPP 20231225, SPFFT 1.1.0, SPLA 1.6.1,
|
||||
# DFTD4 3.6.0
|
||||
# on the Merlin cluster (PSI)
|
||||
#
|
||||
# Usage: Source this arch file and then run make as instructed.
|
||||
# A full toolchain installation is performed as default.
|
||||
# Optionally, GNU compiler and MPI implementation can be specified as arguments.
|
||||
# Replace or adapt the "module add" commands below if needed.
|
||||
#
|
||||
# Last update: 04.08.2024
|
||||
#
|
||||
# \
|
||||
if [[ "${0}" == "${BASH_SOURCE}" ]]; then \
|
||||
echo "ERROR: Script ${0##*/} must be sourced"; \
|
||||
echo "Usage: source ${0##*/}"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
this_file=${BASH_SOURCE##*/}; \
|
||||
cd tools/toolchain; \
|
||||
rm -rf build; \
|
||||
[[ -z "${mpi_implementation}" ]] && mpi_implementation="mpich"; \
|
||||
[[ -z "${target_cpu}" ]] && target_cpu="native"; \
|
||||
echo "Found GCC $(gcc -dumpfullversion) compiler"; \
|
||||
echo "Building for target CPU ${target_cpu} using ${mpi_implementation}"; \
|
||||
if [[ -n "${1}" ]]; then \
|
||||
module add ${1}; \
|
||||
if [[ -n "${2}" ]]; then \
|
||||
module add ${2}; \
|
||||
module list; \
|
||||
./install_cp2k_toolchain.sh --install-all -j${maxtasks} --no-arch-files --target-cpu=${target_cpu} --with-gcc=system --with-${mpi_implementation}=system; \
|
||||
else \
|
||||
module list; \
|
||||
./install_cp2k_toolchain.sh --install-all -j${maxtasks} --no-arch-files --target-cpu=${target_cpu} --with-gcc=system --with-${mpi_implementation}; \
|
||||
fi; \
|
||||
else \
|
||||
./install_cp2k_toolchain.sh --install-all -j${maxtasks} --no-arch-files --target-cpu=${target_cpu} --with-gcc --with-${mpi_implementation}; \
|
||||
fi; \
|
||||
source ./install/setup; \
|
||||
cd ../..; \
|
||||
echo; \
|
||||
echo "Check the output above for error messages and consistency!"; \
|
||||
echo; \
|
||||
echo "If everything is OK, you can build a CP2K production binary with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.}"; \
|
||||
echo; \
|
||||
echo "Alternatively, you can add further checks, e.g. for regression testing, with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.} DO_CHECKS=yes"; \
|
||||
echo "or build CP2K only with shared libraries using"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.} SHARED=yes"; \
|
||||
echo "or build CP2K as a library with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.} libcp2k"; \
|
||||
echo; \
|
||||
echo "Run always the following command before using the CP2K binary"; \
|
||||
echo " source ${PWD}/tools/toolchain/install/setup"; \
|
||||
echo; \
|
||||
return
|
||||
|
||||
# Set options
|
||||
DO_CHECKS := no
|
||||
SHARED := no
|
||||
TARGET_CPU := native
|
||||
GNU_VER := $(shell gcc -dumpfullversion)
|
||||
USE_COSMA := 2.6.6
|
||||
USE_DFTD4 := 3.6.0
|
||||
USE_ELPA := 2024.03.001
|
||||
USE_FFTW := 3.3.10
|
||||
USE_HDF5 := 1.14.2
|
||||
USE_LIBGRPP := 20231225
|
||||
USE_LIBINT := 2.6.0
|
||||
USE_LIBPEXSI := 1.2.0
|
||||
USE_LIBTORCH := 1.12.1
|
||||
USE_LIBVORI := 220621
|
||||
USE_LIBXC := 6.2.2
|
||||
USE_LIBXSMM := 1.17
|
||||
USE_OPENBLAS := 0.3.27
|
||||
USE_PLUMED := 2.9.0
|
||||
USE_QUIP := 0.9.10
|
||||
USE_SCALAPACK := 2.2.1
|
||||
USE_SIRIUS := 7.5.2
|
||||
USE_SPFFT := 1.1.0
|
||||
USE_SPGLIB := 2.3.1
|
||||
USE_SPLA := 1.6.1
|
||||
# Only needed for SIRIUS
|
||||
LIBVDWXC_VER := 0.4.0
|
||||
# Only needed for LIBPEXSI
|
||||
SCOTCH_VER := 6.0.0
|
||||
SUPERLU_VER := 6.1.0
|
||||
|
||||
LMAX := 5
|
||||
MAX_CONTR := 4
|
||||
|
||||
CC := mpicc
|
||||
FC := mpifort
|
||||
LD := mpifort
|
||||
AR := ar -r
|
||||
|
||||
ifeq ($(TARGET_CPU), generic)
|
||||
CFLAGS := -O2 -fopenmp -fopenmp-simd -ftree-vectorize -funroll-loops -g -mtune=$(TARGET_CPU)
|
||||
else
|
||||
CFLAGS := -O2 -fopenmp -fopenmp-simd -ftree-vectorize -funroll-loops -g -march=$(TARGET_CPU) -mtune=$(TARGET_CPU)
|
||||
endif
|
||||
|
||||
DFLAGS := -D__parallel
|
||||
DFLAGS += -D__HAS_IEEE_EXCEPTIONS
|
||||
DFLAGS += -D__MAX_CONTR=$(strip $(MAX_CONTR))
|
||||
|
||||
INSTALL_PATH := $(PWD)/tools/toolchain/install
|
||||
|
||||
ifeq ($(SHARED), yes)
|
||||
LD_SHARED := $(FC) -shared
|
||||
CFLAGS += -fPIC
|
||||
LDFLAGS := -Wl,--enable-new-dtags
|
||||
CP2K_LIB := $(PWD)/lib/$(ARCH)/$(ONEVERSION)
|
||||
LDFLAGS += -Wl,-rpath=$(CP2K_LIB)
|
||||
LDFLAGS += -Wl,-rpath=$(CP2K_LIB)/exts/dbcsr
|
||||
endif
|
||||
|
||||
# Settings for regression testing
|
||||
ifeq ($(DO_CHECKS), yes)
|
||||
DFLAGS += -D__CHECK_DIAG
|
||||
# CFLAGS_DEBUG := -fsanitize=address
|
||||
CFLAGS_DEBUG := -fsanitize=leak
|
||||
# FCFLAGS_DEBUG := -fcheck=bounds,do,recursion,pointer
|
||||
FCFLAGS_DEBUG += -fcheck=all,no-array-temps
|
||||
FCFLAGS_DEBUG += -ffpe-trap=invalid,overflow,zero
|
||||
FCFLAGS_DEBUG += -fimplicit-none
|
||||
FCFLAGS_DEBUG += -finit-derived
|
||||
FCFLAGS_DEBUG += -finit-real=snan
|
||||
FCFLAGS_DEBUG += -finit-integer=-42
|
||||
FCFLAGS_DEBUG += -finline-matmul-limit=0
|
||||
WFLAGS := -Werror=aliasing
|
||||
WFLAGS += -Werror=ampersand
|
||||
WFLAGS += -Werror=c-binding-type
|
||||
WFLAGS += -Werror=conversion
|
||||
WFLAGS += -Werror=intrinsic-shadow
|
||||
WFLAGS += -Werror=intrinsics-std
|
||||
WFLAGS += -Werror=line-truncation
|
||||
WFLAGS += -Wrealloc-lhs
|
||||
WFLAGS += -Werror=tabs
|
||||
WFLAGS += -Werror=target-lifetime
|
||||
WFLAGS += -Werror=underflow
|
||||
WFLAGS += -Werror=unused-but-set-variable
|
||||
WFLAGS += -Werror=unused-dummy-argument
|
||||
WFLAGS += -Werror=unused-variable
|
||||
endif
|
||||
|
||||
ifneq ($(USE_PLUMED),)
|
||||
USE_PLUMED := $(strip $(USE_PLUMED))
|
||||
PLUMED_LIB := $(INSTALL_PATH)/plumed-$(USE_PLUMED)/lib
|
||||
DFLAGS += -D__PLUMED2
|
||||
USE_GSL := 2.7
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(PLUMED_LIB) -L$(PLUMED_LIB) -lplumed -lplumedKernel
|
||||
else
|
||||
LIBS += $(PLUMED_LIB)/libplumed.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_ELPA),)
|
||||
USE_ELPA := $(strip $(USE_ELPA))
|
||||
ELPA_INC := $(INSTALL_PATH)/elpa-$(USE_ELPA)/cpu/include/elpa_openmp-$(USE_ELPA)
|
||||
ELPA_LIB := $(INSTALL_PATH)/elpa-$(USE_ELPA)/cpu/lib
|
||||
CFLAGS += -I$(ELPA_INC)/elpa -I$(ELPA_INC)/modules
|
||||
DFLAGS += -D__ELPA
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(ELPA_LIB) -L$(ELPA_LIB) -lelpa_openmp
|
||||
else
|
||||
LIBS += $(ELPA_LIB)/libelpa_openmp.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_QUIP),)
|
||||
USE_QUIP := $(strip $(USE_QUIP))
|
||||
QUIP_INC := $(INSTALL_PATH)/quip-$(USE_QUIP)/include
|
||||
QUIP_LIB := $(INSTALL_PATH)/quip-$(USE_QUIP)/lib
|
||||
CFLAGS += -I$(QUIP_INC)
|
||||
DFLAGS += -D__QUIP
|
||||
LIBS += $(QUIP_LIB)/libquip_core.a
|
||||
LIBS += $(QUIP_LIB)/libatoms.a
|
||||
LIBS += $(QUIP_LIB)/libFoX_sax.a
|
||||
LIBS += $(QUIP_LIB)/libFoX_common.a
|
||||
LIBS += $(QUIP_LIB)/libFoX_utils.a
|
||||
LIBS += $(QUIP_LIB)/libFoX_fsys.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBPEXSI),)
|
||||
USE_LIBPEXSI := $(strip $(USE_LIBPEXSI))
|
||||
SCOTCH_VER := $(strip $(SCOTCH_VER))
|
||||
SUPERLU_VER := $(strip $(SUPERLU_VER))
|
||||
LIBPEXSI_INC := $(INSTALL_PATH)/pexsi-$(USE_LIBPEXSI)/include
|
||||
LIBPEXSI_LIB := $(INSTALL_PATH)/pexsi-$(USE_LIBPEXSI)/lib
|
||||
SCOTCH_INC := $(INSTALL_PATH)/scotch-$(SCOTCH_VER)/include
|
||||
SCOTCH_LIB := $(INSTALL_PATH)/scotch-$(SCOTCH_VER)/lib
|
||||
SUPERLU_INC := $(INSTALL_PATH)/superlu_dist-$(SUPERLU_VER)/include
|
||||
SUPERLU_LIB := $(INSTALL_PATH)/superlu_dist-$(SUPERLU_VER)/lib
|
||||
CFLAGS += -I$(LIBPEXSI_INC) -I$(SCOTCH_INC) -I$(SUPERLU_INC)
|
||||
DFLAGS += -D__LIBPEXSI
|
||||
LIBS += $(LIBPEXSI_LIB)/libpexsi.a
|
||||
LIBS += $(SUPERLU_LIB)/libsuperlu_dist.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotchparmetis.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotch.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotcherr.a
|
||||
LIBS += $(SCOTCH_LIB)/libscotchmetis.a
|
||||
LIBS += $(SCOTCH_LIB)/libscotch.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBVORI),)
|
||||
USE_LIBVORI := $(strip $(USE_LIBVORI))
|
||||
LIBVORI_LIB := $(INSTALL_PATH)/libvori-$(USE_LIBVORI)/lib
|
||||
DFLAGS += -D__LIBVORI
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBVORI_LIB) -L$(LIBVORI_LIB) -lvori
|
||||
else
|
||||
LIBS += $(LIBVORI_LIB)/libvori.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBXC),)
|
||||
USE_LIBXC := $(strip $(USE_LIBXC))
|
||||
LIBXC_INC := $(INSTALL_PATH)/libxc-$(USE_LIBXC)/include
|
||||
LIBXC_LIB := $(INSTALL_PATH)/libxc-$(USE_LIBXC)/lib
|
||||
CFLAGS += -I$(LIBXC_INC)
|
||||
DFLAGS += -D__LIBXC
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBXC_LIB) -L$(LIBXC_LIB) -lxcf03 -lxc
|
||||
else
|
||||
LIBS += $(LIBXC_LIB)/libxcf03.a
|
||||
LIBS += $(LIBXC_LIB)/libxc.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_DFTD4),)
|
||||
USE_DFTD4 := $(strip $(USE_DFTD4))
|
||||
DFTD4_INC := $(INSTALL_PATH)/dftd4-$(USE_DFTD4)/include
|
||||
DFTD4_LIB := $(INSTALL_PATH)/dftd4-$(USE_DFTD4)/lib64
|
||||
CFLAGS += -I$(DFTD4_INC)/dftd4/GNU-$(GNU_VER)
|
||||
DFLAGS += -D__DFTD4
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(DFTD4_LIB) -L$(DFTD4_LIB) -ldftd4 -lmstore -lmulticharge -lmctc-lib
|
||||
else
|
||||
LIBS += $(DFTD4_LIB)/libdftd4.a
|
||||
LIBS += $(DFTD4_LIB)/libmstore.a
|
||||
LIBS += $(DFTD4_LIB)/libmulticharge.a
|
||||
LIBS += $(DFTD4_LIB)/libmctc-lib.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBGRPP),)
|
||||
USE_LIBGRPP := $(strip $(USE_LIBGRPP))
|
||||
LIBGRPP_INC := $(INSTALL_PATH)/libgrpp-main-$(USE_LIBGRPP)/include
|
||||
LIBGRPP_LIB := $(INSTALL_PATH)/libgrpp-main-$(USE_LIBGRPP)/lib
|
||||
CFLAGS += -I$(LIBGRPP_INC)
|
||||
DFLAGS += -D__LIBGRPP
|
||||
LIBS += $(LIBGRPP_LIB)/liblibgrpp.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBINT),)
|
||||
USE_LIBINT := $(strip $(USE_LIBINT))
|
||||
LMAX := $(strip $(LMAX))
|
||||
LIBINT_INC := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/include
|
||||
LIBINT_LIB := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/lib
|
||||
CFLAGS += -I$(LIBINT_INC)
|
||||
DFLAGS += -D__LIBINT
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBINT_LIB) -L$(LIBINT_LIB) -lint2
|
||||
else
|
||||
LIBS += $(LIBINT_LIB)/libint2.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPGLIB),)
|
||||
USE_SPGLIB := $(strip $(USE_SPGLIB))
|
||||
SPGLIB_INC := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/include
|
||||
SPGLIB_LIB := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/lib
|
||||
CFLAGS += -I$(SPGLIB_INC)
|
||||
DFLAGS += -D__SPGLIB
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SPGLIB_LIB) -L$(SPGLIB_LIB) -lsymspg
|
||||
else
|
||||
LIBS += $(SPGLIB_LIB)/libsymspg.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBXSMM),)
|
||||
USE_LIBXSMM := $(strip $(USE_LIBXSMM))
|
||||
LIBXSMM_INC := $(INSTALL_PATH)/libxsmm-$(USE_LIBXSMM)/include
|
||||
LIBXSMM_LIB := $(INSTALL_PATH)/libxsmm-$(USE_LIBXSMM)/lib
|
||||
CFLAGS += -I$(LIBXSMM_INC)
|
||||
DFLAGS += -D__LIBXSMM
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBXSMM_LIB) -L$(LIBXSMM_LIB) -lxsmmf -lxsmm
|
||||
else
|
||||
LIBS += $(LIBXSMM_LIB)/libxsmmf.a
|
||||
LIBS += $(LIBXSMM_LIB)/libxsmm.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SIRIUS),)
|
||||
USE_SIRIUS := $(strip $(USE_SIRIUS))
|
||||
LIBVDWXC_VER := $(strip $(LIBVDWXC_VER))
|
||||
LIBVDWXC_INC := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/include
|
||||
LIBVDWXC_LIB := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/lib
|
||||
SIRIUS_INC := $(INSTALL_PATH)/sirius-$(USE_SIRIUS)/include
|
||||
SIRIUS_LIB := $(INSTALL_PATH)/sirius-$(USE_SIRIUS)/lib
|
||||
CFLAGS += -I$(LIBVDWXC_INC)
|
||||
CFLAGS += -I$(SIRIUS_INC)
|
||||
DFLAGS += -D__LIBVDWXC
|
||||
DFLAGS += -D__SIRIUS
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SIRIUS_LIB) -L$(SIRIUS_LIB) -lsirius
|
||||
LIBS += -Wl,-rpath=$(LIBVDWXC_LIB) -L$(LIBVDWXC_LIB) -lvdwxc
|
||||
else
|
||||
LIBS += $(SIRIUS_LIB)/libsirius.a
|
||||
LIBS += $(LIBVDWXC_LIB)/libvdwxc.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPFFT),)
|
||||
USE_SPFFT := $(strip $(USE_SPFFT))
|
||||
SPFFT_INC := $(INSTALL_PATH)/SpFFT-$(USE_SPFFT)/include
|
||||
SPFFT_LIB := $(INSTALL_PATH)/SpFFT-$(USE_SPFFT)/lib
|
||||
CFLAGS += -I$(SPFFT_INC)
|
||||
DFLAGS += -D__SPFFT
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SPFFT_LIB) -L$(SPFFT_LIB) -lspfft
|
||||
else
|
||||
LIBS += $(SPFFT_LIB)/libspfft.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPLA),)
|
||||
USE_SPLA := $(strip $(USE_SPLA))
|
||||
SPLA_INC := $(INSTALL_PATH)/SpLA-$(USE_SPLA)/include/spla
|
||||
SPLA_LIB := $(INSTALL_PATH)/SpLA-$(USE_SPLA)/lib
|
||||
CFLAGS += -I$(SPLA_INC)
|
||||
DFLAGS += -D__SPLA
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SPLA_LIB) -L$(SPLA_LIB) -lspla
|
||||
else
|
||||
LIBS += $(SPLA_LIB)/libspla.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_HDF5),)
|
||||
USE_HDF5 := $(strip $(USE_HDF5))
|
||||
HDF5_INC := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/include
|
||||
HDF5_LIB := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/lib
|
||||
CFLAGS += -I$(HDF5_INC)
|
||||
DFLAGS += -D__HDF5
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath,$(HDF5_LIB) -L$(HDF5_LIB) -lhdf5_fortran -lhdf5
|
||||
else
|
||||
LIBS += $(HDF5_LIB)/libhdf5_fortran.a
|
||||
LIBS += $(HDF5_LIB)/libhdf5_f90cstub.a
|
||||
LIBS += $(HDF5_LIB)/libhdf5.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_COSMA),)
|
||||
USE_COSMA := $(strip $(USE_COSMA))
|
||||
COSMA_INC := $(INSTALL_PATH)/COSMA-$(USE_COSMA)/include
|
||||
COSMA_LIB := $(INSTALL_PATH)/COSMA-$(USE_COSMA)/lib
|
||||
CFLAGS += -I$(COSMA_INC)
|
||||
DFLAGS += -D__COSMA
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(COSMA_LIB) -L$(COSMA_LIB) -lcosma_prefixed_pxgemm -lcosma -lcosta
|
||||
else
|
||||
LIBS += $(COSMA_LIB)/libcosma_prefixed_pxgemm.a
|
||||
LIBS += $(COSMA_LIB)/libcosma.a
|
||||
LIBS += $(COSMA_LIB)/libcosta.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_FFTW),)
|
||||
USE_FFTW := $(strip $(USE_FFTW))
|
||||
FFTW_INC := $(INSTALL_PATH)/fftw-$(USE_FFTW)/include
|
||||
FFTW_LIB := $(INSTALL_PATH)/fftw-$(USE_FFTW)/lib
|
||||
CFLAGS += -I$(FFTW_INC)
|
||||
DFLAGS += -D__FFTW3
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(FFTW_LIB) -L$(FFTW_LIB) -lfftw3_mpi -lfftw3_omp -lfftw3
|
||||
else
|
||||
LIBS += $(FFTW_LIB)/libfftw3_mpi.a
|
||||
LIBS += $(FFTW_LIB)/libfftw3_omp.a
|
||||
LIBS += $(FFTW_LIB)/libfftw3.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SCALAPACK),)
|
||||
SCALAPACK_LIB := $(INSTALL_PATH)/scalapack-$(USE_SCALAPACK)/lib
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SCALAPACK_LIB) -L$(SCALAPACK_LIB) -lscalapack
|
||||
else
|
||||
LIBS += $(SCALAPACK_LIB)/libscalapack.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_GSL),)
|
||||
USE_GSL := $(strip $(USE_GSL))
|
||||
GSL_INC := $(INSTALL_PATH)/gsl-$(USE_GSL)/include
|
||||
GSL_LIB := $(INSTALL_PATH)/gsl-$(USE_GSL)/lib
|
||||
CFLAGS += -I$(GSL_INC)
|
||||
DFLAGS += -D__GSL
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(GSL_LIB) -L$(GSL_LIB) -lgsl
|
||||
else
|
||||
LIBS += $(GSL_LIB)/libgsl.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_OPENBLAS),)
|
||||
USE_OPENBLAS := $(strip $(USE_OPENBLAS))
|
||||
OPENBLAS_INC := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/include
|
||||
OPENBLAS_LIB := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/lib
|
||||
CFLAGS += -I$(OPENBLAS_INC)
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(OPENBLAS_LIB) -L$(OPENBLAS_LIB) -lopenblas
|
||||
else
|
||||
LIBS += $(OPENBLAS_LIB)/libopenblas.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(shell [ $(shell ldd --version | head -n 1 | tr -s '.' '\n' | tail -n 1) -ge 27 ] && echo yes), yes)
|
||||
ifneq ($(USE_LIBTORCH),)
|
||||
USE_LIBTORCH := $(strip $(USE_LIBTORCH))
|
||||
LIBTORCH_INC := $(INSTALL_PATH)/libtorch-$(USE_LIBTORCH)/include
|
||||
LIBTORCH_LIB := $(INSTALL_PATH)/libtorch-$(USE_LIBTORCH)/lib
|
||||
CFLAGS += -I$(LIBTORCH_INC)
|
||||
DFLAGS += -D__LIBTORCH
|
||||
LIBS += -Wl,-rpath=$(LIBTORCH_LIB) -L$(LIBTORCH_LIB) -lc10 -ltorch_cpu -ltorch
|
||||
endif
|
||||
endif
|
||||
|
||||
CFLAGS += $(DFLAGS) $(CFLAGS_DEBUG)
|
||||
|
||||
CXXFLAGS := $(CFLAGS) --std=c++14
|
||||
|
||||
FCFLAGS := $(CFLAGS) $(FCFLAGS_DEBUG) $(WFLAGS)
|
||||
ifeq ($(shell [ $(shell gcc -dumpversion | cut -d. -f1) -gt 9 ] && echo yes), yes)
|
||||
FCFLAGS += -fallow-argument-mismatch
|
||||
endif
|
||||
FCFLAGS += -fbacktrace
|
||||
FCFLAGS += -ffree-form
|
||||
FCFLAGS += -ffree-line-length-none
|
||||
FCFLAGS += -fno-omit-frame-pointer
|
||||
FCFLAGS += -std=f2008
|
||||
|
||||
LDFLAGS += $(FCFLAGS)
|
||||
|
||||
LIBS += -lz -ldl -lstdc++
|
||||
|
||||
# End
|
||||
57
arch/Linux-intel-x86_64-minimal.psmp
Normal file
57
arch/Linux-intel-x86_64-minimal.psmp
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# CP2K (Intel/MKL x86_64) minimal arch file for Linux clusters
|
||||
#
|
||||
# Tested with: Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.5.0
|
||||
|
||||
# Usage: Source this arch file after the module for Intel/MKL has been loaded if needed.
|
||||
#
|
||||
# Last update: 08.08.2022
|
||||
#
|
||||
# \
|
||||
if [[ "${0}" == "${BASH_SOURCE}" ]]; then \
|
||||
echo "ERROR: Script ${0##*/} must be sourced"; \
|
||||
echo "Usage: source ${0##*/}"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
this_file=${BASH_SOURCE##*/}; \
|
||||
make -j ARCH=${this_file%.*} VERSION=${this_file##*.} realclean; \
|
||||
make -j ARCH=${this_file%.*} VERSION=${this_file##*.}; \
|
||||
return
|
||||
|
||||
CC = mpiicc
|
||||
FC = mpiifort
|
||||
LD = mpiifort
|
||||
AR = ar -r
|
||||
|
||||
CFLAGS = -O2 -qopenmp -fp-model precise -funroll-loops -g -qopenmp-simd -traceback -xHost
|
||||
|
||||
DFLAGS = -D__FFTW3
|
||||
DFLAGS += -D__MAX_CONTR=4
|
||||
DFLAGS += -D__MKL
|
||||
DFLAGS += -D__parallel
|
||||
|
||||
FCFLAGS = $(CFLAGS) $(DFLAGS)
|
||||
FCFLAGS += -diag-disable=8291
|
||||
FCFLAGS += -diag-disable=8293
|
||||
FCFLAGS += -fpp
|
||||
FCFLAGS += -free
|
||||
FCFLAGS += -I$(MKLROOT)/include
|
||||
FCFLAGS += -I$(MKLROOT)/include/fftw
|
||||
|
||||
LDFLAGS = $(FCFLAGS) -static-intel -static_mpi
|
||||
LDFLAGS_C = -nofor-main
|
||||
|
||||
MKL_LIB = $(MKLROOT)/lib/intel64
|
||||
|
||||
LIBS = $(MKL_LIB)/libmkl_scalapack_lp64.a
|
||||
LIBS += -Wl,--start-group
|
||||
LIBS += $(MKL_LIB)/libmkl_intel_lp64.a
|
||||
LIBS += $(MKL_LIB)/libmkl_sequential.a
|
||||
LIBS += $(MKL_LIB)/libmkl_core.a
|
||||
LIBS += $(MKL_LIB)/libmkl_blacs_intelmpi_lp64.a
|
||||
LIBS += -Wl,--end-group
|
||||
|
||||
# Required due to memory leak that occurs if high optimisations are used
|
||||
mp2_optimize_ri_basis.o: mp2_optimize_ri_basis.F
|
||||
$(FC) -c $(subst O2,O0,$(FCFLAGS)) $<
|
||||
405
arch/Linux-intel-x86_64.psmp
Normal file
405
arch/Linux-intel-x86_64.psmp
Normal file
|
|
@ -0,0 +1,405 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# CP2K (Intel/MKL x86_64) arch file for Linux clusters
|
||||
#
|
||||
# Tested with: Intel 22.2, 2021.13, Intel MPI, Intel MKL,
|
||||
# LIBINT 2.6.0, LIBXC 6.2.2, ELPA 2024.03.001,
|
||||
# PLUMED 2.9.0, SPGLIB 2.3.1, LIBVORI 220621,
|
||||
# GSL 2.7, COSMA 2.6.6, HDF5 1.14.2, SIRIUS 7.5.2,
|
||||
# LIBGRPP 20231225, SPFFT 1.1.0, SPLA 1.6.1,
|
||||
# DFTD4 3.6.0
|
||||
# on the Merlin cluster (PSI)
|
||||
#
|
||||
# Usage: Source this arch file and then run make as instructed.
|
||||
# A full toolchain installation is performed as default.
|
||||
# Optionally, the Intel compiler version can be specified as argument.
|
||||
# Replace or adapt the "module add" commands below if needed.
|
||||
#
|
||||
# Last update: 04.08.2024
|
||||
#
|
||||
# \
|
||||
if [[ "${0}" == "${BASH_SOURCE}" ]]; then \
|
||||
echo "ERROR: Script ${0##*/} must be sourced"; \
|
||||
echo "Usage: source ${0##*/}"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
this_file=${BASH_SOURCE##*/}; \
|
||||
cd tools/toolchain; \
|
||||
rm -rf build; \
|
||||
[[ -z "${target_cpu}" ]] && target_cpu="native"; \
|
||||
if [[ -n "${1}" ]]; then \
|
||||
module add ${1}; \
|
||||
module list; \
|
||||
fi; \
|
||||
./install_cp2k_toolchain.sh --install-all -j${maxtasks} --no-arch-files --target-cpu=${target_cpu} --with-intelmpi --with-mkl --with-libtorch=no; \
|
||||
source ./install/setup; \
|
||||
cd ../..; \
|
||||
echo; \
|
||||
echo "Check the output above for error messages and consistency!"; \
|
||||
echo; \
|
||||
echo "If everything is OK, you can build a CP2K production binary with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.}"; \
|
||||
echo; \
|
||||
echo "Alternatively, you can add further checks, e.g. for regression testing, with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.} DO_CHECKS=yes"; \
|
||||
echo "or build CP2K only with shared libraries using"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.} SHARED=yes"; \
|
||||
echo "or build CP2K as a library with"; \
|
||||
echo " make -j ARCH=${this_file%.*} VERSION=${this_file##*.} libcp2k"; \
|
||||
echo; \
|
||||
echo "Run always the following command before using the CP2K binary"; \
|
||||
echo " source ${PWD}/tools/toolchain/install/setup"; \
|
||||
echo; \
|
||||
return
|
||||
|
||||
# Set options
|
||||
DO_CHECKS := no
|
||||
SHARED := no
|
||||
TARGET_CPU := native
|
||||
USE_COSMA := 2.6.6
|
||||
USE_DFTD4 := 3.6.0
|
||||
USE_ELPA := 2024.03.001
|
||||
USE_HDF5 := 1.14.2
|
||||
USE_LIBGRPP := 20231225
|
||||
USE_LIBINT := 2.6.0
|
||||
USE_LIBPEXSI := 1.2.0
|
||||
#USE_LIBTORCH := 1.12.1
|
||||
USE_LIBVORI := 220621
|
||||
USE_LIBXC := 6.2.2
|
||||
USE_LIBXSMM := 1.17
|
||||
USE_PLUMED := 2.9.0
|
||||
USE_SIRIUS := 7.5.2
|
||||
USE_SPFFT := 1.1.0
|
||||
USE_SPGLIB := 2.3.1
|
||||
USE_SPLA := 1.6.1
|
||||
# Only needed for SIRIUS
|
||||
LIBVDWXC_VER := 0.4.0
|
||||
# Only needed for LIBPEXSI
|
||||
SCOTCH_VER := 6.0.0
|
||||
SUPERLU_VER := 6.1.0
|
||||
|
||||
LMAX := 5
|
||||
MAX_CONTR := 4
|
||||
|
||||
CC := mpiicc
|
||||
FC := mpiifort
|
||||
LD := mpiifort
|
||||
AR := ar -r
|
||||
|
||||
ifeq ($(strip $(TARGET_CPU)), native)
|
||||
CFLAGS := -O2 -fPIC -fp-model precise -funroll-loops -g -qopenmp -qopenmp-simd -traceback -xHost
|
||||
else
|
||||
CFLAGS := -O2 -fPIC -fp-model precise -funroll-loops -g -mtune=$(TARGET_CPU) -qopenmp -qopenmp-simd -traceback
|
||||
endif
|
||||
CFLAGS += -diag-disable=10448
|
||||
|
||||
DFLAGS := -D__parallel
|
||||
DFLAGS += -D__MKL
|
||||
DFLAGS += -D__FFTW3
|
||||
DFLAGS += -D__MAX_CONTR=$(strip $(MAX_CONTR))
|
||||
|
||||
INSTALL_PATH := $(PWD)/tools/toolchain/install
|
||||
|
||||
MKL_LIB := $(MKLROOT)/lib/intel64
|
||||
|
||||
ifeq ($(SHARED), yes)
|
||||
LD_SHARED := $(FC) -shared
|
||||
CFLAGS += -fPIC
|
||||
LDFLAGS := -Wl,--enable-new-dtags
|
||||
CP2K_LIB := $(PWD)/lib/$(ARCH)/$(ONEVERSION)
|
||||
LDFLAGS += -Wl,-rpath=$(CP2K_LIB)
|
||||
LDFLAGS += -Wl,-rpath=$(CP2K_LIB)/exts/dbcsr
|
||||
else
|
||||
LDFLAGS := -static-intel
|
||||
endif
|
||||
|
||||
# Settings for regression testing
|
||||
ifeq ($(DO_CHECKS), yes)
|
||||
DFLAGS += -D__CHECK_DIAG
|
||||
endif
|
||||
|
||||
ifneq ($(USE_PLUMED),)
|
||||
USE_PLUMED := $(strip $(USE_PLUMED))
|
||||
PLUMED_LIB := $(INSTALL_PATH)/plumed-$(USE_PLUMED)/lib
|
||||
DFLAGS += -D__PLUMED2
|
||||
USE_GSL := 2.7
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(PLUMED_LIB) -L$(PLUMED_LIB) -lplumed -lplumedKernel
|
||||
else
|
||||
LIBS += $(PLUMED_LIB)/libplumed.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_ELPA),)
|
||||
USE_ELPA := $(strip $(USE_ELPA))
|
||||
ELPA_INC := $(INSTALL_PATH)/elpa-$(USE_ELPA)/cpu/include/elpa_openmp-$(USE_ELPA)
|
||||
ELPA_LIB := $(INSTALL_PATH)/elpa-$(USE_ELPA)/cpu/lib
|
||||
CFLAGS += -I$(ELPA_INC)/elpa -I$(ELPA_INC)/modules
|
||||
DFLAGS += -D__ELPA
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(ELPA_LIB) -L$(ELPA_LIB) -lelpa_openmp
|
||||
else
|
||||
LIBS += $(ELPA_LIB)/libelpa_openmp.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBPEXSI),)
|
||||
USE_LIBPEXSI := $(strip $(USE_LIBPEXSI))
|
||||
SCOTCH_VER := $(strip $(SCOTCH_VER))
|
||||
SUPERLU_VER := $(strip $(SUPERLU_VER))
|
||||
LIBPEXSI_INC := $(INSTALL_PATH)/pexsi-$(USE_LIBPEXSI)/include
|
||||
LIBPEXSI_LIB := $(INSTALL_PATH)/pexsi-$(USE_LIBPEXSI)/lib
|
||||
SCOTCH_INC := $(INSTALL_PATH)/scotch-$(SCOTCH_VER)/include
|
||||
SCOTCH_LIB := $(INSTALL_PATH)/scotch-$(SCOTCH_VER)/lib
|
||||
SUPERLU_INC := $(INSTALL_PATH)/superlu_dist-$(SUPERLU_VER)/include
|
||||
SUPERLU_LIB := $(INSTALL_PATH)/superlu_dist-$(SUPERLU_VER)/lib
|
||||
CFLAGS += -I$(LIBPEXSI_INC) -I$(SCOTCH_INC) -I$(SUPERLU_INC)
|
||||
DFLAGS += -D__LIBPEXSI
|
||||
LIBS += $(LIBPEXSI_LIB)/libpexsi.a
|
||||
LIBS += $(SUPERLU_LIB)/libsuperlu_dist.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotchparmetis.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotch.a
|
||||
LIBS += $(SCOTCH_LIB)/libptscotcherr.a
|
||||
LIBS += $(SCOTCH_LIB)/libscotchmetis.a
|
||||
LIBS += $(SCOTCH_LIB)/libscotch.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBVORI),)
|
||||
USE_LIBVORI := $(strip $(USE_LIBVORI))
|
||||
LIBVORI_LIB := $(INSTALL_PATH)/libvori-$(USE_LIBVORI)/lib
|
||||
DFLAGS += -D__LIBVORI
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBVORI_LIB) -L$(LIBVORI_LIB) -lvori
|
||||
else
|
||||
LIBS += $(LIBVORI_LIB)/libvori.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBXC),)
|
||||
USE_LIBXC := $(strip $(USE_LIBXC))
|
||||
LIBXC_INC := $(INSTALL_PATH)/libxc-$(USE_LIBXC)/include
|
||||
LIBXC_LIB := $(INSTALL_PATH)/libxc-$(USE_LIBXC)/lib
|
||||
CFLAGS += -I$(LIBXC_INC)
|
||||
DFLAGS += -D__LIBXC
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBXC_LIB) -L$(LIBXC_LIB) -lxcf03 -lxc
|
||||
else
|
||||
LIBS += $(LIBXC_LIB)/libxcf03.a
|
||||
LIBS += $(LIBXC_LIB)/libxc.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_DFTD4),)
|
||||
USE_DFTD4 := $(strip $(USE_DFTD4))
|
||||
DFTD4_INC := $(INSTALL_PATH)/dftd4-$(USE_DFTD4)/include
|
||||
DFTD4_LIB := $(INSTALL_PATH)/dftd4-$(USE_DFTD4)/lib64
|
||||
CFLAGS += -I$(shell ls -d $(DFTD4_INC)/dftd4/Intel-*)
|
||||
DFLAGS += -D__DFTD4
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(DFTD4_LIB) -L$(DFTD4_LIB) -ldftd4 -lmstore -lmulticharge -lmctc-lib
|
||||
else
|
||||
LIBS += $(DFTD4_LIB)/libdftd4.a
|
||||
LIBS += $(DFTD4_LIB)/libmstore.a
|
||||
LIBS += $(DFTD4_LIB)/libmulticharge.a
|
||||
LIBS += $(DFTD4_LIB)/libmctc-lib.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBGRPP),)
|
||||
USE_LIBGRPP := $(strip $(USE_LIBGRPP))
|
||||
LIBGRPP_INC := $(INSTALL_PATH)/libgrpp-main-$(USE_LIBGRPP)/include
|
||||
LIBGRPP_LIB := $(INSTALL_PATH)/libgrpp-main-$(USE_LIBGRPP)/lib
|
||||
CFLAGS += -I$(LIBGRPP_INC)
|
||||
DFLAGS += -D__LIBGRPP
|
||||
LIBS += $(LIBGRPP_LIB)/liblibgrpp.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBINT),)
|
||||
USE_LIBINT := $(strip $(USE_LIBINT))
|
||||
LMAX := $(strip $(LMAX))
|
||||
LIBINT_INC := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/include
|
||||
LIBINT_LIB := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/lib
|
||||
CFLAGS += -I$(LIBINT_INC)
|
||||
DFLAGS += -D__LIBINT
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBINT_LIB) -L$(LIBINT_LIB) -lint2
|
||||
else
|
||||
LIBS += $(LIBINT_LIB)/libint2.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPGLIB),)
|
||||
USE_SPGLIB := $(strip $(USE_SPGLIB))
|
||||
SPGLIB_INC := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/include
|
||||
SPGLIB_LIB := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/lib
|
||||
CFLAGS += -I$(SPGLIB_INC)
|
||||
DFLAGS += -D__SPGLIB
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SPGLIB_LIB) -L$(SPGLIB_LIB) -lsymspg
|
||||
else
|
||||
LIBS += $(SPGLIB_LIB)/libsymspg.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBXSMM),)
|
||||
USE_LIBXSMM := $(strip $(USE_LIBXSMM))
|
||||
LIBXSMM_INC := $(INSTALL_PATH)/libxsmm-$(USE_LIBXSMM)/include
|
||||
LIBXSMM_LIB := $(INSTALL_PATH)/libxsmm-$(USE_LIBXSMM)/lib
|
||||
CFLAGS += -I$(LIBXSMM_INC)
|
||||
DFLAGS += -D__LIBXSMM
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(LIBXSMM_LIB) -L$(LIBXSMM_LIB) -lxsmmf -lxsmm
|
||||
else
|
||||
LIBS += $(LIBXSMM_LIB)/libxsmmf.a
|
||||
LIBS += $(LIBXSMM_LIB)/libxsmm.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SIRIUS),)
|
||||
USE_SIRIUS := $(strip $(USE_SIRIUS))
|
||||
LIBVDWXC_VER := $(strip $(LIBVDWXC_VER))
|
||||
LIBVDWXC_INC := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/include
|
||||
LIBVDWXC_LIB := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/lib
|
||||
SIRIUS_INC := $(INSTALL_PATH)/sirius-$(USE_SIRIUS)/include
|
||||
SIRIUS_LIB := $(INSTALL_PATH)/sirius-$(USE_SIRIUS)/lib
|
||||
CFLAGS += -I$(LIBVDWXC_INC)
|
||||
CFLAGS += -I$(SIRIUS_INC)
|
||||
DFLAGS += -D__LIBVDWXC
|
||||
DFLAGS += -D__SIRIUS
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SIRIUS_LIB) -L$(SIRIUS_LIB) -lsirius
|
||||
LIBS += -Wl,-rpath=$(LIBVDWXC_LIB) -L$(LIBVDWXC_LIB) -lvdwxc
|
||||
else
|
||||
LIBS += $(SIRIUS_LIB)/libsirius.a
|
||||
LIBS += $(LIBVDWXC_LIB)/libvdwxc.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPFFT),)
|
||||
USE_SPFFT := $(strip $(USE_SPFFT))
|
||||
SPFFT_INC := $(INSTALL_PATH)/SpFFT-$(USE_SPFFT)/include
|
||||
SPFFT_LIB := $(INSTALL_PATH)/SpFFT-$(USE_SPFFT)/lib
|
||||
CFLAGS += -I$(SPFFT_INC)
|
||||
DFLAGS += -D__SPFFT
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SPFFT_LIB) -L$(SPFFT_LIB) -lspfft
|
||||
else
|
||||
LIBS += $(SPFFT_LIB)/libspfft.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPLA),)
|
||||
USE_SPLA := $(strip $(USE_SPLA))
|
||||
SPLA_INC := $(INSTALL_PATH)/SpLA-$(USE_SPLA)/include/spla
|
||||
SPLA_LIB := $(INSTALL_PATH)/SpLA-$(USE_SPLA)/lib
|
||||
CFLAGS += -I$(SPLA_INC)
|
||||
DFLAGS += -D__SPLA
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(SPLA_LIB) -L$(SPLA_LIB) -lspla
|
||||
else
|
||||
LIBS += $(SPLA_LIB)/libspla.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_HDF5),)
|
||||
USE_HDF5 := $(strip $(USE_HDF5))
|
||||
HDF5_INC := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/include
|
||||
HDF5_LIB := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/lib
|
||||
CFLAGS += -I$(HDF5_INC)
|
||||
DFLAGS += -D__HDF5
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath,$(HDF5_LIB) -L$(HDF5_LIB) -lhdf5_fortran -lhdf5
|
||||
else
|
||||
LIBS += $(HDF5_LIB)/libhdf5_fortran.a
|
||||
LIBS += $(HDF5_LIB)/libhdf5_f90cstub.a
|
||||
LIBS += $(HDF5_LIB)/libhdf5.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_COSMA),)
|
||||
USE_COSMA := $(strip $(USE_COSMA))
|
||||
COSMA_INC := $(INSTALL_PATH)/COSMA-$(USE_COSMA)/include
|
||||
COSMA_LIB := $(INSTALL_PATH)/COSMA-$(USE_COSMA)/lib
|
||||
CFLAGS += -I$(COSMA_INC)
|
||||
DFLAGS += -D__COSMA
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(COSMA_LIB) -L$(COSMA_LIB) -lcosma_prefixed_pxgemm -lcosma -lcosta
|
||||
else
|
||||
LIBS += $(COSMA_LIB)/libcosma_prefixed_pxgemm.a
|
||||
LIBS += $(COSMA_LIB)/libcosma.a
|
||||
LIBS += $(COSMA_LIB)/libcosta.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(USE_GSL),)
|
||||
USE_GSL := $(strip $(USE_GSL))
|
||||
GSL_INC := $(INSTALL_PATH)/gsl-$(USE_GSL)/include
|
||||
GSL_LIB := $(INSTALL_PATH)/gsl-$(USE_GSL)/lib
|
||||
CFLAGS += -I$(GSL_INC)
|
||||
DFLAGS += -D__GSL
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(GSL_LIB) -L$(GSL_LIB) -lgsl
|
||||
else
|
||||
LIBS += $(GSL_LIB)/libgsl.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath=$(MKL_LIB) -L$(MKL_LIB) -lmkl_scalapack_lp64
|
||||
LIBS += -Wl,--start-group
|
||||
LIBS += -lmkl_intel_lp64
|
||||
LIBS += -lmkl_sequential
|
||||
LIBS += -lmkl_core
|
||||
LIBS += -lmkl_blacs_intelmpi_lp64
|
||||
LIBS += -Wl,--end-group
|
||||
else
|
||||
LIBS += $(MKL_LIB)/libmkl_scalapack_lp64.a
|
||||
LIBS += -Wl,--start-group
|
||||
LIBS += $(MKL_LIB)/libmkl_intel_lp64.a
|
||||
LIBS += $(MKL_LIB)/libmkl_sequential.a
|
||||
LIBS += $(MKL_LIB)/libmkl_core.a
|
||||
LIBS += $(MKL_LIB)/libmkl_blacs_intelmpi_lp64.a
|
||||
LIBS += -Wl,--end-group
|
||||
endif
|
||||
|
||||
ifeq ($(shell [ $(shell ldd --version | head -n 1 | tr -s '.' '\n' | tail -n 1) -ge 27 ] && echo yes), yes)
|
||||
ifneq ($(USE_LIBTORCH),)
|
||||
USE_LIBTORCH := $(strip $(USE_LIBTORCH))
|
||||
LIBTORCH_INC := $(INSTALL_PATH)/libtorch-$(USE_LIBTORCH)/include
|
||||
LIBTORCH_LIB := $(INSTALL_PATH)/libtorch-$(USE_LIBTORCH)/lib
|
||||
CFLAGS += -I$(LIBTORCH_INC)
|
||||
DFLAGS += -D__LIBTORCH
|
||||
LIBS += -Wl,-rpath=$(LIBTORCH_LIB) -L$(LIBTORCH_LIB) -lc10 -ltorch_cpu -ltorch
|
||||
endif
|
||||
endif
|
||||
|
||||
CFLAGS += $(DFLAGS)
|
||||
CFLAGS += -I$(MKLROOT)/include
|
||||
CFLAGS += -I$(MKLROOT)/include/fftw
|
||||
|
||||
CXXFLAGS := $(CFLAGS) -std=c++14
|
||||
|
||||
FCFLAGS := $(CFLAGS)
|
||||
FCFLAGS += -diag-disable=8291
|
||||
FCFLAGS += -diag-disable=8293
|
||||
FCFLAGS += -fpp
|
||||
FCFLAGS += -fpscomp logicals
|
||||
FCFLAGS += -free
|
||||
#FCFLAGS += -std08
|
||||
|
||||
LDFLAGS += $(FCFLAGS)
|
||||
LDFLAGS_C := -nofor-main
|
||||
|
||||
LIBS += -lz -lstdc++
|
||||
|
||||
# Required due to memory leak that occurs if high optimisations are used
|
||||
mp2_optimize_ri_basis.o: mp2_optimize_ri_basis.F
|
||||
$(FC) -c $(subst O2,O0,$(FCFLAGS)) $<
|
||||
# Required due to SEGFAULTS occurring for higher optimisation levels
|
||||
paw_basis_types.o: paw_basis_types.F
|
||||
$(FC) -c $(subst O2,O1,$(FCFLAGS)) $<
|
||||
# Reduce compilation time
|
||||
hfx_contraction_methods.o: hfx_contraction_methods.F
|
||||
$(FC) -c $(subst -O2,-O1,$(FCFLAGS)) $<
|
||||
|
||||
# End
|
||||
88
arch/Linux-x86-64-gfortran-opencl.psmp
Normal file
88
arch/Linux-x86-64-gfortran-opencl.psmp
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
# Tested with: GFortran 9.4.0, Intel MPI, Intel MKL,
|
||||
# LIBINT 2.6.0, LIBXC 5.1.6, ELPA 2021.05.002,
|
||||
# PLUMED 2.7.2, LIBXSMM
|
||||
|
||||
CC = mpicc
|
||||
FC = mpifort
|
||||
LD = mpifort
|
||||
AR = gcc-ar -r
|
||||
|
||||
GPUVER = P100
|
||||
OFFLOAD_TARGET = opencl
|
||||
|
||||
GNU_PATH ?= $(HOME)
|
||||
MPI_PATH ?= $(GNU_PATH)
|
||||
|
||||
include $(MPI_PATH)/plumed2/gnu/lib/plumed/src/lib/Plumed.inc.static
|
||||
|
||||
BLAS_INC = $(MKLROOT)/include
|
||||
BLAS_LIB = -Wl,--start-group \
|
||||
$(MKLROOT)/lib/intel64/libmkl_scalapack_lp64.a \
|
||||
$(MKLROOT)/lib/intel64/libmkl_gf_lp64.a \
|
||||
$(MKLROOT)/lib/intel64/libmkl_core.a \
|
||||
$(MKLROOT)/lib/intel64/libmkl_gnu_thread.a \
|
||||
$(MKLROOT)/lib/intel64/libmkl_blacs_intelmpi_lp64.a \
|
||||
-Wl,--end-group
|
||||
|
||||
# ELPA 2021.05.002
|
||||
ELPA_INC = $(MPI_PATH)/elpa/gnu/include/elpa
|
||||
ELPA_LIB = $(MPI_PATH)/elpa/gnu/lib
|
||||
|
||||
LIBINT_INC = $(GNU_PATH)/libint/gnu/include
|
||||
LIBINT_LIB = $(GNU_PATH)/libint/gnu/lib
|
||||
|
||||
LIBXC_INC = $(GNU_PATH)/libxc/gnu/include
|
||||
LIBXC_LIB = $(GNU_PATH)/libxc/gnu/lib
|
||||
|
||||
LIBXSMM_INC = $(GNU_PATH)/libxsmm/include
|
||||
LIBXSMM_LIB = $(GNU_PATH)/libxsmm/lib
|
||||
|
||||
CFLAGS = -O2 -fopenmp -fopenmp-simd -ftree-vectorize -funroll-loops -g -march=native -mtune=native
|
||||
|
||||
DFLAGS += -D__DBCSR_ACC
|
||||
DFLAGS += -D__ELPA
|
||||
DFLAGS += -D__MKL -D__FFTW3
|
||||
DFLAGS += -D__LIBINT -D__MAX_CONTR=4
|
||||
DFLAGS += -D__LIBXC
|
||||
DFLAGS += -D__LIBXSMM
|
||||
DFLAGS += -D__PLUMED2
|
||||
DFLAGS += -D__parallel
|
||||
#DFLAGS += -D__CHECK_DIAG
|
||||
|
||||
FCFLAGS = $(CFLAGS) $(DFLAGS)
|
||||
FCFLAGS += -fbacktrace
|
||||
FCFLAGS += -ffree-form
|
||||
FCFLAGS += -ffree-line-length-none
|
||||
FCFLAGS += -fno-omit-frame-pointer
|
||||
FCFLAGS += -std=f2008
|
||||
FCFLAGS += -I$(BLAS_INC) -I$(BLAS_INC)/fftw
|
||||
FCFLAGS += -I$(ELPA_INC)/elpa -I$(ELPA_INC)/modules
|
||||
FCFLAGS += -I$(LIBINT_INC)
|
||||
FCFLAGS += -I$(LIBXC_INC)
|
||||
FCFLAGS += -I$(LIBXSMM_INC)
|
||||
|
||||
LDFLAGS = $(CFLAGS) -static-libgfortran
|
||||
|
||||
LIBS = $(PLUMED_DEPENDENCIES) -lz
|
||||
LIBS += $(ELPA_LIB)/libelpa.a
|
||||
LIBS += $(LIBXC_LIB)/libxcf03.a
|
||||
LIBS += $(LIBXC_LIB)/libxc.a
|
||||
LIBS += $(LIBINT_LIB)/libint2.a
|
||||
LIBS += $(LIBXSMM_LIB)/libxsmmf.a
|
||||
LIBS += $(LIBXSMM_LIB)/libxsmm.a
|
||||
LIBS += $(BLAS_LIB)
|
||||
LIBS += -ldl -lstdc++
|
||||
|
||||
# collect header and/or library from non-default location
|
||||
ifeq (,$(CUDATOOLKIT_HOME))
|
||||
CUDATOOLKIT_HOME := $(NVSDKCOMPUTE_ROOT)
|
||||
endif
|
||||
ifeq (,$(CUDATOOLKIT_HOME))
|
||||
NVCC := $(call which,nvcc)
|
||||
CUDATOOLKIT_HOME := $(if $(NVCC),$(abspath $(dir $(NVCC))/..))
|
||||
endif
|
||||
ifneq (,$(CUDATOOLKIT_HOME))
|
||||
LDFLAGS += -L$(CUDATOOLKIT_HOME)/lib64
|
||||
LDFLAGS += -Wl,-rpath=$(CUDATOOLKIT_HOME)/lib64
|
||||
endif
|
||||
LIBS += -lOpenCL
|
||||
20
arch/Linux-x86-64-gfortran.dumpast
Normal file
20
arch/Linux-x86-64-gfortran.dumpast
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#
|
||||
# gfortran arch file, recommended to use gfortran >= 4.6
|
||||
# building libraries (fftw3, libint, libxc, scalapack, smm) is needed to use this arch file
|
||||
# sdbg is intended for serial code development, not production
|
||||
#
|
||||
CC = cc
|
||||
FC = gfortran
|
||||
LD = gfortran
|
||||
AR = ar -r
|
||||
|
||||
DFLAGS =
|
||||
FCFLAGS = -O0 -fstrict-aliasing -fbacktrace -g -fbounds-check -ffree-form -fdump-fortran-original -fopenmp $(DFLAGS)
|
||||
CFLAGS = -fopenmp $(DFLAGS)
|
||||
LDFLAGS = $(FCFLAGS)
|
||||
LIBS = -lopenblas
|
||||
|
||||
FCLOGPIPE = > $(notdir $<).ast
|
||||
|
||||
export LC_ALL=C
|
||||
#EOF
|
||||
22
arch/Linux-x86-64-mingw64-minimal.sopt
Normal file
22
arch/Linux-x86-64-mingw64-minimal.sopt
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# This configuration was tested on a Centos 7 with the EPEL repository configured
|
||||
# and a Fedora 29 Docker image with the following packages installed:
|
||||
# mingw64-gcc-gfortran mingw64-gcc-c++ mingw64-winpthreads-static
|
||||
# OpenBLAS was built with the following command:
|
||||
# make BINARY=64 CC=x86_64-w64-mingw32-gcc FC=x86_64-w64-mingw32-gfortran HOSTCC=gcc TARGET=CORE2
|
||||
# The result is a minimal standalone binary running on Windows when built with
|
||||
# make OPENBLAS_LIBPATH=<path to OpenBLAS> ARCH=Linux-x86-64-mingw64-minimal VERSION=sopt
|
||||
# If you do not have a Fedora or Centos yet but have Docker, you can use the following two commands
|
||||
# to build CP2K via a Fedora Docker container:
|
||||
# docker build -f tools/docker/Dockerfile.build_mingw64 -t cp2k/mingw64:latest tools/docker
|
||||
# docker run --rm -v $(pwd):/cp2k --user $(id -u):$(id -g) cp2k/mingw64
|
||||
CC = x86_64-w64-mingw32-gcc
|
||||
CXX = x86_64-w64-mingw32-g++
|
||||
FC = x86_64-w64-mingw32-gfortran
|
||||
LD = x86_64-w64-mingw32-gfortran
|
||||
AR = x86_64-w64-mingw32-ar -r
|
||||
DFLAGS = -D__NO_STATM_ACCESS -D__NO_SOCKETS -D__MINGW
|
||||
CFLAGS = $(DFLAGS) -O2
|
||||
FCFLAGS = $(DFLAGS) -O2 -ffree-form -ffree-line-length-none \
|
||||
-ftree-vectorize -funroll-loops -std=f2008
|
||||
LDFLAGS = $(FCFLAGS) -static
|
||||
LIBS = $(OPENBLAS_LIBPATH)/libopenblas.a
|
||||
11
arch/Linux-x86-64-nvhpc.ssmp
Normal file
11
arch/Linux-x86-64-nvhpc.ssmp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
CC = nvc
|
||||
CXX = nvc++
|
||||
AR = ar -r
|
||||
FC = nvfortran
|
||||
LD = nvfortran
|
||||
|
||||
CFLAGS = -mp --diag_suppress=const_var_in_C_const_expr,unrecognized_gcc_pragma,code_is_unreachable
|
||||
FCFLAGS = -mp -Mbackslash -silent
|
||||
CXXFLAGS = -mp
|
||||
LDFLAGS = -mp
|
||||
LIBS = -lopenblas -fortranlibs -c++libs
|
||||
12
arch/minimal.sdbg
Normal file
12
arch/minimal.sdbg
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Minimal arch file for CP2K, with minimal dependencies.
|
||||
# With this setup, all of CP2K can be pasted together in a single .f90 file:
|
||||
# https://www.dropbox.com/s/18oi02srbot3h9p/cp2k_single_file.f90.gz
|
||||
CC = gcc -g
|
||||
CXX = g++ -g
|
||||
AR = ar -r
|
||||
FC = gfortran -g
|
||||
LD = gfortran
|
||||
CFLAGS = -fopenmp
|
||||
FCFLAGS = -fopenmp -ffree-form
|
||||
LDFLAGS = -fopenmp
|
||||
LIBS = -lopenblas
|
||||
|
|
@ -1,457 +0,0 @@
|
|||
&GLOBAL
|
||||
PREFERRED_DIAG_LIBRARY ScaLAPACK
|
||||
PRINT_LEVEL low
|
||||
PROJECT H2O-128_md
|
||||
RUN_TYPE MD
|
||||
&END GLOBAL
|
||||
|
||||
&MOTION
|
||||
&MD
|
||||
ENSEMBLE NVE
|
||||
STEPS 4
|
||||
TEMPERATURE 300.0
|
||||
TIMESTEP 0.5
|
||||
&END MD
|
||||
&END MOTION
|
||||
|
||||
&FORCE_EVAL
|
||||
METHOD Quickstep
|
||||
&DFT
|
||||
BASIS_SET_FILE_NAME GTH_BASIS_SETS
|
||||
POTENTIAL_FILE_NAME POTENTIAL
|
||||
&MGRID
|
||||
CUTOFF 480
|
||||
REL_CUTOFF 60
|
||||
&END MGRID
|
||||
&PRINT
|
||||
&HIRSHFELD off
|
||||
&END HIRSHFELD
|
||||
&MULLIKEN off
|
||||
&END MULLIKEN
|
||||
&END PRINT
|
||||
&QS
|
||||
EPS_DEFAULT 1.0E-14
|
||||
&END QS
|
||||
&SCF
|
||||
EPS_SCF 1.0E-7
|
||||
MAX_SCF 20
|
||||
SCF_GUESS atomic
|
||||
&OT on
|
||||
MINIMIZER CG
|
||||
PRECONDITIONER FULL_SINGLE_INVERSE
|
||||
&END OT
|
||||
&OUTER_SCF on
|
||||
EPS_SCF 1.0E-7
|
||||
MAX_SCF 3
|
||||
&END OUTER_SCF
|
||||
&PRINT
|
||||
&RESTART off
|
||||
&END RESTART
|
||||
&END PRINT
|
||||
&END SCF
|
||||
&XC
|
||||
&XC_FUNCTIONAL PBE
|
||||
&END XC_FUNCTIONAL
|
||||
&END XC
|
||||
&END DFT
|
||||
&SUBSYS
|
||||
&CELL
|
||||
ABC 15.6404 15.6404 15.6404
|
||||
&END CELL
|
||||
# 128 H2O (TIP5P,1bar,300K) a = 15.6404
|
||||
&COORD
|
||||
O 4.963362 8.433745 6.522726
|
||||
O 8.071195 10.247451 13.276063
|
||||
O 13.850862 12.652854 15.313528
|
||||
O 10.628770 14.045936 13.059901
|
||||
O 6.325463 12.328145 3.498946
|
||||
O 3.583600 12.446390 8.539707
|
||||
O 14.871126 15.358423 8.766155
|
||||
O 13.901523 10.863702 1.750201
|
||||
O 14.067166 0.862917 3.662820
|
||||
O 10.133858 15.114355 5.659292
|
||||
O 12.335899 11.027651 13.245276
|
||||
O 11.020881 3.916524 5.030404
|
||||
O 9.394684 6.531654 5.826834
|
||||
O 11.080390 7.885268 7.198950
|
||||
O 8.896688 8.249600 3.615318
|
||||
O 7.353156 1.137779 5.346406
|
||||
O 14.726780 7.918215 10.773641
|
||||
O 1.861458 11.989979 2.208095
|
||||
O 5.043121 6.543380 9.229162
|
||||
O 8.759694 11.116925 3.548469
|
||||
O 6.997656 8.373444 9.806165
|
||||
O 6.063005 12.809828 7.806901
|
||||
O 10.366591 5.779853 2.712706
|
||||
O 1.542969 4.767262 12.213947
|
||||
O 10.685570 14.507915 8.519941
|
||||
O 12.849421 13.198702 9.038657
|
||||
O 0.963120 14.402597 12.834647
|
||||
O 7.797670 4.829150 12.447033
|
||||
O 3.835427 3.788119 12.965881
|
||||
O 3.376860 4.479186 1.446663
|
||||
O 2.947460 1.489874 9.046559
|
||||
O 3.108796 14.723769 5.201095
|
||||
O 15.204514 8.599951 0.959433
|
||||
O 15.219684 4.238425 15.684030
|
||||
O 4.100649 1.057601 2.040112
|
||||
O 11.001052 2.229682 10.064311
|
||||
O 0.478278 0.949105 2.102755
|
||||
O 13.497545 5.548164 10.181923
|
||||
O 7.506276 1.277199 9.722916
|
||||
O 7.428299 4.380540 1.411980
|
||||
O 7.928952 14.363028 9.316256
|
||||
O 0.355839 11.996260 13.602596
|
||||
O 10.664734 7.760921 14.011072
|
||||
O 2.130951 6.397562 4.547882
|
||||
O 6.997688 7.117398 14.170903
|
||||
O 9.843852 1.807540 1.906473
|
||||
O 4.765738 9.146359 2.409067
|
||||
O 4.102297 1.274905 6.068037
|
||||
O 15.014340 11.743955 4.053518
|
||||
O 12.695114 13.021970 5.787211
|
||||
O 13.858302 3.507332 4.146316
|
||||
O 7.022070 10.109293 7.424303
|
||||
O 5.539291 5.159365 2.927469
|
||||
O 9.768643 11.517745 11.838411
|
||||
O 10.503632 1.060928 12.343495
|
||||
O 5.637836 14.137294 5.298814
|
||||
O 13.230577 15.494257 12.417538
|
||||
O 10.087712 12.367132 5.676113
|
||||
O 3.823444 11.248314 3.611973
|
||||
O 2.764628 9.932668 12.219621
|
||||
O 6.337327 1.214539 14.384465
|
||||
O 9.932541 13.322345 2.141626
|
||||
O 8.026468 1.856250 12.446566
|
||||
O 12.678267 4.212245 7.543967
|
||||
O 13.171058 4.494997 1.771265
|
||||
O 1.270597 13.402991 7.043142
|
||||
O 2.561666 15.503539 15.004783
|
||||
O 9.418846 5.882450 0.091388
|
||||
O 13.279532 8.467153 13.191095
|
||||
O 14.784685 10.103797 9.128104
|
||||
O 5.420783 3.626432 15.485019
|
||||
O 5.484596 2.586023 3.716333
|
||||
O 13.407464 7.649770 5.701169
|
||||
O 14.491627 2.828827 13.502603
|
||||
O 6.975558 5.474364 6.932584
|
||||
O 3.311237 6.301528 6.829047
|
||||
O 0.998842 3.600800 9.862514
|
||||
O 9.866483 10.306933 7.180898
|
||||
O 2.074137 10.679976 15.509320
|
||||
O 11.018416 9.906723 0.630304
|
||||
O 1.183950 1.843702 7.098684
|
||||
O 14.873704 5.527544 6.848733
|
||||
O 2.173299 7.943131 2.110457
|
||||
O 4.449383 11.930616 11.079086
|
||||
O 1.710425 14.756574 10.096897
|
||||
O 6.694784 0.922595 1.239003
|
||||
O 4.564438 11.918442 15.363533
|
||||
O 5.477639 4.707670 11.065326
|
||||
O 11.342444 0.223097 3.577043
|
||||
O 7.426077 12.972512 11.521810
|
||||
O 11.491853 1.563182 7.107076
|
||||
O 4.794353 4.113581 6.561312
|
||||
O 11.305735 3.619278 0.282229
|
||||
O 1.481140 5.957409 8.624482
|
||||
O 0.119546 10.931817 6.783795
|
||||
O 2.484663 6.791214 15.186771
|
||||
O 13.950657 12.916459 11.346835
|
||||
O 6.051702 14.320089 13.213208
|
||||
O 2.417817 14.602343 2.749723
|
||||
O 3.040699 10.496700 6.149311
|
||||
O 8.648120 3.218837 3.744312
|
||||
O 5.305757 2.668899 9.163911
|
||||
O 6.031135 7.542813 4.011356
|
||||
O 15.264572 0.530244 15.103544
|
||||
O 1.202379 11.443873 10.338401
|
||||
O 14.305770 2.092612 10.350492
|
||||
O 7.239758 12.387106 14.813865
|
||||
O 7.341353 9.684340 0.723854
|
||||
O 5.857541 9.676357 11.912006
|
||||
O 15.332365 7.094962 14.318822
|
||||
O 10.447327 8.207812 9.585339
|
||||
O 9.866363 4.445989 10.955351
|
||||
O 13.658983 0.219428 6.214705
|
||||
O 7.322356 13.965677 1.578063
|
||||
O 0.644540 4.039583 5.338294
|
||||
O 11.742745 10.899134 8.906616
|
||||
O 0.863237 3.520934 2.306355
|
||||
O 12.841333 10.018102 4.330247
|
||||
O 8.609050 2.288503 7.430427
|
||||
O 11.067694 12.559978 15.366360
|
||||
O 11.923672 3.212040 13.107757
|
||||
O 11.306237 6.632227 11.461951
|
||||
O 12.437417 7.860470 2.936097
|
||||
O 1.645609 7.437039 11.743266
|
||||
O 10.045665 4.639989 7.951130
|
||||
O 3.297915 13.397525 13.230354
|
||||
O 2.464454 1.557718 12.716823
|
||||
O 4.302185 8.124888 13.787389
|
||||
H 4.581468 7.718593 7.031593
|
||||
H 5.435252 7.997984 5.813033
|
||||
H 8.381737 9.538324 13.839031
|
||||
H 7.875012 10.964336 13.879239
|
||||
H 14.014609 12.142905 16.106856
|
||||
H 14.391871 12.234836 14.643601
|
||||
H 10.739569 13.533892 13.861004
|
||||
H 10.132364 13.472919 12.475551
|
||||
H 5.425531 12.003488 3.468104
|
||||
H 6.310811 13.012792 4.167733
|
||||
H 2.831114 13.037692 8.558619
|
||||
H 3.397989 11.844750 7.818728
|
||||
H 14.215688 14.710076 8.508709
|
||||
H 14.915685 15.962115 8.024669
|
||||
H 14.442896 10.979475 2.531061
|
||||
H 13.131333 10.387571 2.060586
|
||||
H 13.235552 0.480036 3.383444
|
||||
H 14.167503 0.581424 4.572175
|
||||
H 9.268459 15.423495 5.391430
|
||||
H 10.724909 15.435978 4.978521
|
||||
H 12.682383 11.900242 13.058822
|
||||
H 11.530377 10.974348 12.730956
|
||||
H 10.862047 3.493530 5.874252
|
||||
H 11.866334 3.570906 4.744068
|
||||
H 10.010906 6.860110 6.481524
|
||||
H 9.772826 5.701645 5.536446
|
||||
H 10.713257 8.747058 7.002065
|
||||
H 10.930529 7.769221 8.137196
|
||||
H 9.008071 7.846692 4.476416
|
||||
H 9.404635 7.694874 3.023287
|
||||
H 7.885169 1.417698 6.091281
|
||||
H 6.462912 1.407047 5.572662
|
||||
H 14.465524 8.122806 11.671483
|
||||
H 14.387942 7.036249 10.620165
|
||||
H 1.079976 11.549099 2.541476
|
||||
H 1.854266 11.812527 1.267515
|
||||
H 5.627954 7.254025 9.492195
|
||||
H 5.358566 6.280575 8.364489
|
||||
H 8.728012 10.160756 3.517346
|
||||
H 7.843327 11.389131 3.499416
|
||||
H 7.064983 9.034969 9.117627
|
||||
H 6.681536 8.854422 10.570991
|
||||
H 6.096247 13.255760 6.960573
|
||||
H 5.135401 12.812072 8.043075
|
||||
H 10.251809 4.879805 3.017615
|
||||
H 11.247569 6.019998 2.999828
|
||||
H 2.425379 4.423632 12.353605
|
||||
H 1.622138 5.706596 12.380127
|
||||
H 10.435334 14.464737 7.597038
|
||||
H 9.863861 14.392213 8.997057
|
||||
H 12.151749 13.846631 8.940295
|
||||
H 12.401656 12.354243 8.987406
|
||||
H 1.041376 14.716046 11.933616
|
||||
H 0.431193 15.065997 13.274178
|
||||
H 7.657165 5.609226 12.983662
|
||||
H 7.113550 4.871097 11.778862
|
||||
H 4.492907 4.226503 12.425723
|
||||
H 4.197120 3.813194 13.851760
|
||||
H 3.028991 5.174958 0.888880
|
||||
H 2.608925 4.123752 1.894070
|
||||
H 2.354380 1.561214 8.298628
|
||||
H 2.601814 2.111564 9.687076
|
||||
H 2.496453 14.284442 5.791230
|
||||
H 2.669671 14.716265 4.350599
|
||||
H 14.931000 9.483201 0.711861
|
||||
H 14.543448 8.311558 1.588759
|
||||
H 14.806603 3.662787 15.040418
|
||||
H 15.806913 4.791820 15.169104
|
||||
H 3.487941 1.365078 1.372072
|
||||
H 3.735668 0.223182 2.334673
|
||||
H 10.930358 1.492019 10.670189
|
||||
H 11.783438 2.701109 10.350422
|
||||
H 0.373431 0.943162 1.151333
|
||||
H -0.331325 0.562024 2.435836
|
||||
H 13.328483 5.602953 9.241365
|
||||
H 13.904987 4.690509 10.302961
|
||||
H 7.979807 1.447145 10.537237
|
||||
H 7.699278 0.361971 9.519594
|
||||
H 7.879980 3.677583 1.878957
|
||||
H 6.921010 4.830270 2.087726
|
||||
H 7.276262 13.850239 8.839522
|
||||
H 7.900170 14.017994 10.208643
|
||||
H 0.566590 12.917379 13.449771
|
||||
H 0.097504 11.663383 12.743127
|
||||
H 10.275806 6.980124 14.405182
|
||||
H 10.496386 7.665796 13.073607
|
||||
H 2.563595 6.556361 3.708934
|
||||
H 1.500251 7.112689 4.631806
|
||||
H 7.206023 7.863029 13.607998
|
||||
H 6.088301 7.261122 14.432801
|
||||
H 9.059286 1.416705 1.521847
|
||||
H 9.511490 2.498088 2.479979
|
||||
H 5.181015 8.567468 3.048333
|
||||
H 3.954045 8.698238 2.171213
|
||||
H 3.323672 1.528105 6.563885
|
||||
H 3.866094 0.442374 5.658975
|
||||
H 14.146610 12.079728 4.278314
|
||||
H 15.272574 11.219653 4.811577
|
||||
H 12.716562 12.455880 6.558777
|
||||
H 11.770411 13.059590 5.542791
|
||||
H 14.153945 2.652228 3.833869
|
||||
H 13.419264 3.899892 3.391747
|
||||
H 6.656515 10.977596 7.255036
|
||||
H 6.361994 9.501768 7.090470
|
||||
H 4.712486 5.080316 2.451678
|
||||
H 5.521694 4.441294 3.560158
|
||||
H 9.189146 10.923676 12.315377
|
||||
H 9.179345 12.154039 11.433330
|
||||
H 10.671879 0.186135 12.693725
|
||||
H 9.549978 1.142946 12.350583
|
||||
H 4.689829 14.268322 5.317390
|
||||
H 5.985844 14.953053 4.938731
|
||||
H 12.546401 14.844149 12.257863
|
||||
H 12.876821 16.308055 12.058620
|
||||
H 9.756019 13.254250 5.814793
|
||||
H 9.607961 12.048315 4.911635
|
||||
H 3.064895 11.422889 3.054873
|
||||
H 4.291140 10.542078 3.166190
|
||||
H 2.001271 10.248909 12.702851
|
||||
H 2.907174 10.590416 11.538974
|
||||
H 5.648267 1.877288 14.431286
|
||||
H 6.585421 1.061461 15.296193
|
||||
H 9.740490 12.519628 2.626387
|
||||
H 10.584255 13.059982 1.491498
|
||||
H 7.455032 1.571433 13.159709
|
||||
H 7.941730 2.809647 12.437319
|
||||
H 13.106722 3.411333 7.241976
|
||||
H 13.240150 4.919265 7.226727
|
||||
H 12.368225 4.300614 1.287626
|
||||
H 13.862495 4.466405 1.109956
|
||||
H 0.601526 14.024395 7.330255
|
||||
H 0.816229 12.561332 7.005843
|
||||
H 2.606189 15.728879 14.075552
|
||||
H 1.751050 15.909700 15.311648
|
||||
H 8.495514 5.631109 0.068638
|
||||
H 9.589849 6.084955 1.011160
|
||||
H 13.316729 9.402787 13.389684
|
||||
H 12.379524 8.213880 13.396205
|
||||
H 13.918259 10.505485 9.192801
|
||||
H 14.676156 9.235384 9.515806
|
||||
H 6.242915 3.976825 15.827883
|
||||
H 4.811725 3.679161 16.221565
|
||||
H 5.094286 2.686336 4.584564
|
||||
H 4.898319 1.984198 3.257728
|
||||
H 13.959261 6.906132 5.943560
|
||||
H 12.760208 7.707487 6.403991
|
||||
H 14.969381 3.387665 12.889672
|
||||
H 13.602198 2.792224 13.150740
|
||||
H 7.679644 4.993292 7.367401
|
||||
H 7.415258 5.972883 6.243836
|
||||
H 3.810284 5.488758 6.747876
|
||||
H 2.838344 6.376576 6.000209
|
||||
H 1.201385 4.317435 9.261147
|
||||
H 1.095921 3.984260 10.734160
|
||||
H 8.983144 9.978931 7.349300
|
||||
H 9.731317 11.166458 6.781926
|
||||
H 2.882211 11.167225 15.348581
|
||||
H 1.472398 10.982022 14.828945
|
||||
H 10.205799 9.598641 1.031516
|
||||
H 11.290942 9.189004 0.058604
|
||||
H 0.558492 1.215423 6.737713
|
||||
H 1.132569 2.597863 6.511459
|
||||
H 15.392637 5.068030 6.188591
|
||||
H 15.494223 5.717274 7.552430
|
||||
H 1.359386 8.375518 1.851964
|
||||
H 2.491619 7.530928 1.307342
|
||||
H 3.930723 12.466553 11.679082
|
||||
H 4.127627 12.165120 10.208619
|
||||
H 1.031873 14.870889 9.431517
|
||||
H 2.312758 15.486507 9.953288
|
||||
H 6.898133 0.021480 1.489743
|
||||
H 5.806915 1.068076 1.565740
|
||||
H 4.879440 12.531428 16.027803
|
||||
H 5.343283 11.696347 14.853331
|
||||
H 5.304646 5.468144 10.510363
|
||||
H 5.487486 3.966167 10.460093
|
||||
H 10.682669 0.812386 3.211437
|
||||
H 11.375385 -0.510655 2.963240
|
||||
H 6.968873 13.462683 12.205132
|
||||
H 6.748898 12.423743 11.126193
|
||||
H 11.398639 1.428458 8.050152
|
||||
H 10.636236 1.331547 6.745834
|
||||
H 5.559402 4.680155 6.660940
|
||||
H 4.741233 3.634449 7.388260
|
||||
H 10.965383 2.838195 0.718466
|
||||
H 10.526206 4.126248 0.055186
|
||||
H 2.151544 6.183022 7.979588
|
||||
H 1.693196 6.493418 9.388654
|
||||
H -0.065205 10.491692 7.613487
|
||||
H 0.934641 10.534254 6.477533
|
||||
H 1.612127 6.933760 14.819901
|
||||
H 3.084290 7.085600 14.501194
|
||||
H 14.370852 13.670525 11.760422
|
||||
H 13.655238 13.242663 10.496806
|
||||
H 5.117003 14.119782 13.262678
|
||||
H 6.094269 15.275850 13.243879
|
||||
H 1.684983 15.055245 2.332511
|
||||
H 2.318871 13.688619 2.482233
|
||||
H 3.301587 10.821578 5.287555
|
||||
H 3.569324 9.709332 6.279080
|
||||
H 9.402765 3.485324 4.269409
|
||||
H 8.068278 2.776805 4.364491
|
||||
H 5.849660 1.904585 9.354240
|
||||
H 4.458877 2.303173 8.908431
|
||||
H 5.856290 6.650150 3.713341
|
||||
H 6.956707 7.685055 3.813075
|
||||
H 14.578215 -0.136917 15.110099
|
||||
H 15.036706 1.101780 14.370293
|
||||
H 0.862260 12.331047 10.222329
|
||||
H 0.576388 10.884751 9.878239
|
||||
H 15.013369 2.687846 10.597944
|
||||
H 14.749248 1.349716 9.941024
|
||||
H 7.635604 12.750784 15.605874
|
||||
H 7.063281 13.149121 14.262122
|
||||
H 6.630981 10.323694 0.777061
|
||||
H 6.910682 8.837082 0.837471
|
||||
H 6.518696 10.163169 12.404063
|
||||
H 5.158628 10.311483 11.755901
|
||||
H 14.513415 7.228639 13.841660
|
||||
H 15.188680 7.517995 15.165361
|
||||
H 10.884896 7.694003 10.264136
|
||||
H 9.537008 8.263555 9.875929
|
||||
H 10.169920 3.541428 11.031858
|
||||
H 9.058984 4.472429 11.468839
|
||||
H 12.939998 0.748518 6.560183
|
||||
H 13.359162 -0.684568 6.310259
|
||||
H 6.806079 13.363518 2.113876
|
||||
H 8.230720 13.707514 1.734455
|
||||
H 1.376337 4.428271 4.859101
|
||||
H 0.026246 3.773603 4.657706
|
||||
H 11.202848 10.713245 9.674853
|
||||
H 11.207901 10.618858 8.163906
|
||||
H 0.837038 2.574495 2.447059
|
||||
H 0.139223 3.694244 1.704691
|
||||
H 13.344499 9.479144 4.940640
|
||||
H 12.047898 10.250105 4.812811
|
||||
H 8.179005 2.196707 8.280643
|
||||
H 8.921781 3.193061 7.416086
|
||||
H 11.996578 12.747212 15.501818
|
||||
H 11.029996 11.611989 15.239368
|
||||
H 11.753251 3.258077 14.048538
|
||||
H 11.376661 2.489403 12.799853
|
||||
H 10.727878 5.872638 11.392980
|
||||
H 12.187517 6.272930 11.359562
|
||||
H 12.694899 7.220715 3.599910
|
||||
H 12.399226 8.692890 3.407107
|
||||
H 1.995254 8.322850 11.839802
|
||||
H 0.706423 7.563149 11.608147
|
||||
H 10.003095 4.632780 8.907355
|
||||
H 10.980630 4.590207 7.752146
|
||||
H 3.257893 13.092363 14.136724
|
||||
H 2.487394 13.891684 13.107495
|
||||
H 2.594800 2.360087 13.222239
|
||||
H 3.067392 1.638961 11.977840
|
||||
H 4.204283 7.807066 12.889816
|
||||
H 4.120864 9.063058 13.730900
|
||||
&END COORD
|
||||
&KIND H
|
||||
BASIS_SET TZV2P-GTH
|
||||
POTENTIAL GTH-PBE-q1
|
||||
&END KIND
|
||||
&KIND O
|
||||
BASIS_SET TZV2P-GTH
|
||||
POTENTIAL GTH-PBE-q6
|
||||
&END KIND
|
||||
&END SUBSYS
|
||||
&END FORCE_EVAL
|
||||
|
|
@ -1,457 +0,0 @@
|
|||
&GLOBAL
|
||||
PREFERRED_DIAG_LIBRARY ELPA
|
||||
PRINT_LEVEL low
|
||||
PROJECT H2O-128_md
|
||||
RUN_TYPE MD
|
||||
&END GLOBAL
|
||||
|
||||
&MOTION
|
||||
&MD
|
||||
ENSEMBLE NVE
|
||||
STEPS 4
|
||||
TEMPERATURE 300.0
|
||||
TIMESTEP 0.5
|
||||
&END MD
|
||||
&END MOTION
|
||||
|
||||
&FORCE_EVAL
|
||||
METHOD Quickstep
|
||||
&DFT
|
||||
BASIS_SET_FILE_NAME GTH_BASIS_SETS
|
||||
POTENTIAL_FILE_NAME POTENTIAL
|
||||
&MGRID
|
||||
CUTOFF 480
|
||||
REL_CUTOFF 60
|
||||
&END MGRID
|
||||
&PRINT
|
||||
&HIRSHFELD off
|
||||
&END HIRSHFELD
|
||||
&MULLIKEN off
|
||||
&END MULLIKEN
|
||||
&END PRINT
|
||||
&QS
|
||||
EPS_DEFAULT 1.0E-14
|
||||
&END QS
|
||||
&SCF
|
||||
EPS_SCF 1.0E-7
|
||||
MAX_SCF 20
|
||||
SCF_GUESS atomic
|
||||
&OT on
|
||||
MINIMIZER CG
|
||||
PRECONDITIONER FULL_SINGLE_INVERSE
|
||||
&END OT
|
||||
&OUTER_SCF on
|
||||
EPS_SCF 1.0E-7
|
||||
MAX_SCF 3
|
||||
&END OUTER_SCF
|
||||
&PRINT
|
||||
&RESTART off
|
||||
&END RESTART
|
||||
&END PRINT
|
||||
&END SCF
|
||||
&XC
|
||||
&XC_FUNCTIONAL PBE
|
||||
&END XC_FUNCTIONAL
|
||||
&END XC
|
||||
&END DFT
|
||||
&SUBSYS
|
||||
&CELL
|
||||
ABC 15.6404 15.6404 15.6404
|
||||
&END CELL
|
||||
# 128 H2O (TIP5P,1bar,300K) a = 15.6404
|
||||
&COORD
|
||||
O 4.963362 8.433745 6.522726
|
||||
O 8.071195 10.247451 13.276063
|
||||
O 13.850862 12.652854 15.313528
|
||||
O 10.628770 14.045936 13.059901
|
||||
O 6.325463 12.328145 3.498946
|
||||
O 3.583600 12.446390 8.539707
|
||||
O 14.871126 15.358423 8.766155
|
||||
O 13.901523 10.863702 1.750201
|
||||
O 14.067166 0.862917 3.662820
|
||||
O 10.133858 15.114355 5.659292
|
||||
O 12.335899 11.027651 13.245276
|
||||
O 11.020881 3.916524 5.030404
|
||||
O 9.394684 6.531654 5.826834
|
||||
O 11.080390 7.885268 7.198950
|
||||
O 8.896688 8.249600 3.615318
|
||||
O 7.353156 1.137779 5.346406
|
||||
O 14.726780 7.918215 10.773641
|
||||
O 1.861458 11.989979 2.208095
|
||||
O 5.043121 6.543380 9.229162
|
||||
O 8.759694 11.116925 3.548469
|
||||
O 6.997656 8.373444 9.806165
|
||||
O 6.063005 12.809828 7.806901
|
||||
O 10.366591 5.779853 2.712706
|
||||
O 1.542969 4.767262 12.213947
|
||||
O 10.685570 14.507915 8.519941
|
||||
O 12.849421 13.198702 9.038657
|
||||
O 0.963120 14.402597 12.834647
|
||||
O 7.797670 4.829150 12.447033
|
||||
O 3.835427 3.788119 12.965881
|
||||
O 3.376860 4.479186 1.446663
|
||||
O 2.947460 1.489874 9.046559
|
||||
O 3.108796 14.723769 5.201095
|
||||
O 15.204514 8.599951 0.959433
|
||||
O 15.219684 4.238425 15.684030
|
||||
O 4.100649 1.057601 2.040112
|
||||
O 11.001052 2.229682 10.064311
|
||||
O 0.478278 0.949105 2.102755
|
||||
O 13.497545 5.548164 10.181923
|
||||
O 7.506276 1.277199 9.722916
|
||||
O 7.428299 4.380540 1.411980
|
||||
O 7.928952 14.363028 9.316256
|
||||
O 0.355839 11.996260 13.602596
|
||||
O 10.664734 7.760921 14.011072
|
||||
O 2.130951 6.397562 4.547882
|
||||
O 6.997688 7.117398 14.170903
|
||||
O 9.843852 1.807540 1.906473
|
||||
O 4.765738 9.146359 2.409067
|
||||
O 4.102297 1.274905 6.068037
|
||||
O 15.014340 11.743955 4.053518
|
||||
O 12.695114 13.021970 5.787211
|
||||
O 13.858302 3.507332 4.146316
|
||||
O 7.022070 10.109293 7.424303
|
||||
O 5.539291 5.159365 2.927469
|
||||
O 9.768643 11.517745 11.838411
|
||||
O 10.503632 1.060928 12.343495
|
||||
O 5.637836 14.137294 5.298814
|
||||
O 13.230577 15.494257 12.417538
|
||||
O 10.087712 12.367132 5.676113
|
||||
O 3.823444 11.248314 3.611973
|
||||
O 2.764628 9.932668 12.219621
|
||||
O 6.337327 1.214539 14.384465
|
||||
O 9.932541 13.322345 2.141626
|
||||
O 8.026468 1.856250 12.446566
|
||||
O 12.678267 4.212245 7.543967
|
||||
O 13.171058 4.494997 1.771265
|
||||
O 1.270597 13.402991 7.043142
|
||||
O 2.561666 15.503539 15.004783
|
||||
O 9.418846 5.882450 0.091388
|
||||
O 13.279532 8.467153 13.191095
|
||||
O 14.784685 10.103797 9.128104
|
||||
O 5.420783 3.626432 15.485019
|
||||
O 5.484596 2.586023 3.716333
|
||||
O 13.407464 7.649770 5.701169
|
||||
O 14.491627 2.828827 13.502603
|
||||
O 6.975558 5.474364 6.932584
|
||||
O 3.311237 6.301528 6.829047
|
||||
O 0.998842 3.600800 9.862514
|
||||
O 9.866483 10.306933 7.180898
|
||||
O 2.074137 10.679976 15.509320
|
||||
O 11.018416 9.906723 0.630304
|
||||
O 1.183950 1.843702 7.098684
|
||||
O 14.873704 5.527544 6.848733
|
||||
O 2.173299 7.943131 2.110457
|
||||
O 4.449383 11.930616 11.079086
|
||||
O 1.710425 14.756574 10.096897
|
||||
O 6.694784 0.922595 1.239003
|
||||
O 4.564438 11.918442 15.363533
|
||||
O 5.477639 4.707670 11.065326
|
||||
O 11.342444 0.223097 3.577043
|
||||
O 7.426077 12.972512 11.521810
|
||||
O 11.491853 1.563182 7.107076
|
||||
O 4.794353 4.113581 6.561312
|
||||
O 11.305735 3.619278 0.282229
|
||||
O 1.481140 5.957409 8.624482
|
||||
O 0.119546 10.931817 6.783795
|
||||
O 2.484663 6.791214 15.186771
|
||||
O 13.950657 12.916459 11.346835
|
||||
O 6.051702 14.320089 13.213208
|
||||
O 2.417817 14.602343 2.749723
|
||||
O 3.040699 10.496700 6.149311
|
||||
O 8.648120 3.218837 3.744312
|
||||
O 5.305757 2.668899 9.163911
|
||||
O 6.031135 7.542813 4.011356
|
||||
O 15.264572 0.530244 15.103544
|
||||
O 1.202379 11.443873 10.338401
|
||||
O 14.305770 2.092612 10.350492
|
||||
O 7.239758 12.387106 14.813865
|
||||
O 7.341353 9.684340 0.723854
|
||||
O 5.857541 9.676357 11.912006
|
||||
O 15.332365 7.094962 14.318822
|
||||
O 10.447327 8.207812 9.585339
|
||||
O 9.866363 4.445989 10.955351
|
||||
O 13.658983 0.219428 6.214705
|
||||
O 7.322356 13.965677 1.578063
|
||||
O 0.644540 4.039583 5.338294
|
||||
O 11.742745 10.899134 8.906616
|
||||
O 0.863237 3.520934 2.306355
|
||||
O 12.841333 10.018102 4.330247
|
||||
O 8.609050 2.288503 7.430427
|
||||
O 11.067694 12.559978 15.366360
|
||||
O 11.923672 3.212040 13.107757
|
||||
O 11.306237 6.632227 11.461951
|
||||
O 12.437417 7.860470 2.936097
|
||||
O 1.645609 7.437039 11.743266
|
||||
O 10.045665 4.639989 7.951130
|
||||
O 3.297915 13.397525 13.230354
|
||||
O 2.464454 1.557718 12.716823
|
||||
O 4.302185 8.124888 13.787389
|
||||
H 4.581468 7.718593 7.031593
|
||||
H 5.435252 7.997984 5.813033
|
||||
H 8.381737 9.538324 13.839031
|
||||
H 7.875012 10.964336 13.879239
|
||||
H 14.014609 12.142905 16.106856
|
||||
H 14.391871 12.234836 14.643601
|
||||
H 10.739569 13.533892 13.861004
|
||||
H 10.132364 13.472919 12.475551
|
||||
H 5.425531 12.003488 3.468104
|
||||
H 6.310811 13.012792 4.167733
|
||||
H 2.831114 13.037692 8.558619
|
||||
H 3.397989 11.844750 7.818728
|
||||
H 14.215688 14.710076 8.508709
|
||||
H 14.915685 15.962115 8.024669
|
||||
H 14.442896 10.979475 2.531061
|
||||
H 13.131333 10.387571 2.060586
|
||||
H 13.235552 0.480036 3.383444
|
||||
H 14.167503 0.581424 4.572175
|
||||
H 9.268459 15.423495 5.391430
|
||||
H 10.724909 15.435978 4.978521
|
||||
H 12.682383 11.900242 13.058822
|
||||
H 11.530377 10.974348 12.730956
|
||||
H 10.862047 3.493530 5.874252
|
||||
H 11.866334 3.570906 4.744068
|
||||
H 10.010906 6.860110 6.481524
|
||||
H 9.772826 5.701645 5.536446
|
||||
H 10.713257 8.747058 7.002065
|
||||
H 10.930529 7.769221 8.137196
|
||||
H 9.008071 7.846692 4.476416
|
||||
H 9.404635 7.694874 3.023287
|
||||
H 7.885169 1.417698 6.091281
|
||||
H 6.462912 1.407047 5.572662
|
||||
H 14.465524 8.122806 11.671483
|
||||
H 14.387942 7.036249 10.620165
|
||||
H 1.079976 11.549099 2.541476
|
||||
H 1.854266 11.812527 1.267515
|
||||
H 5.627954 7.254025 9.492195
|
||||
H 5.358566 6.280575 8.364489
|
||||
H 8.728012 10.160756 3.517346
|
||||
H 7.843327 11.389131 3.499416
|
||||
H 7.064983 9.034969 9.117627
|
||||
H 6.681536 8.854422 10.570991
|
||||
H 6.096247 13.255760 6.960573
|
||||
H 5.135401 12.812072 8.043075
|
||||
H 10.251809 4.879805 3.017615
|
||||
H 11.247569 6.019998 2.999828
|
||||
H 2.425379 4.423632 12.353605
|
||||
H 1.622138 5.706596 12.380127
|
||||
H 10.435334 14.464737 7.597038
|
||||
H 9.863861 14.392213 8.997057
|
||||
H 12.151749 13.846631 8.940295
|
||||
H 12.401656 12.354243 8.987406
|
||||
H 1.041376 14.716046 11.933616
|
||||
H 0.431193 15.065997 13.274178
|
||||
H 7.657165 5.609226 12.983662
|
||||
H 7.113550 4.871097 11.778862
|
||||
H 4.492907 4.226503 12.425723
|
||||
H 4.197120 3.813194 13.851760
|
||||
H 3.028991 5.174958 0.888880
|
||||
H 2.608925 4.123752 1.894070
|
||||
H 2.354380 1.561214 8.298628
|
||||
H 2.601814 2.111564 9.687076
|
||||
H 2.496453 14.284442 5.791230
|
||||
H 2.669671 14.716265 4.350599
|
||||
H 14.931000 9.483201 0.711861
|
||||
H 14.543448 8.311558 1.588759
|
||||
H 14.806603 3.662787 15.040418
|
||||
H 15.806913 4.791820 15.169104
|
||||
H 3.487941 1.365078 1.372072
|
||||
H 3.735668 0.223182 2.334673
|
||||
H 10.930358 1.492019 10.670189
|
||||
H 11.783438 2.701109 10.350422
|
||||
H 0.373431 0.943162 1.151333
|
||||
H -0.331325 0.562024 2.435836
|
||||
H 13.328483 5.602953 9.241365
|
||||
H 13.904987 4.690509 10.302961
|
||||
H 7.979807 1.447145 10.537237
|
||||
H 7.699278 0.361971 9.519594
|
||||
H 7.879980 3.677583 1.878957
|
||||
H 6.921010 4.830270 2.087726
|
||||
H 7.276262 13.850239 8.839522
|
||||
H 7.900170 14.017994 10.208643
|
||||
H 0.566590 12.917379 13.449771
|
||||
H 0.097504 11.663383 12.743127
|
||||
H 10.275806 6.980124 14.405182
|
||||
H 10.496386 7.665796 13.073607
|
||||
H 2.563595 6.556361 3.708934
|
||||
H 1.500251 7.112689 4.631806
|
||||
H 7.206023 7.863029 13.607998
|
||||
H 6.088301 7.261122 14.432801
|
||||
H 9.059286 1.416705 1.521847
|
||||
H 9.511490 2.498088 2.479979
|
||||
H 5.181015 8.567468 3.048333
|
||||
H 3.954045 8.698238 2.171213
|
||||
H 3.323672 1.528105 6.563885
|
||||
H 3.866094 0.442374 5.658975
|
||||
H 14.146610 12.079728 4.278314
|
||||
H 15.272574 11.219653 4.811577
|
||||
H 12.716562 12.455880 6.558777
|
||||
H 11.770411 13.059590 5.542791
|
||||
H 14.153945 2.652228 3.833869
|
||||
H 13.419264 3.899892 3.391747
|
||||
H 6.656515 10.977596 7.255036
|
||||
H 6.361994 9.501768 7.090470
|
||||
H 4.712486 5.080316 2.451678
|
||||
H 5.521694 4.441294 3.560158
|
||||
H 9.189146 10.923676 12.315377
|
||||
H 9.179345 12.154039 11.433330
|
||||
H 10.671879 0.186135 12.693725
|
||||
H 9.549978 1.142946 12.350583
|
||||
H 4.689829 14.268322 5.317390
|
||||
H 5.985844 14.953053 4.938731
|
||||
H 12.546401 14.844149 12.257863
|
||||
H 12.876821 16.308055 12.058620
|
||||
H 9.756019 13.254250 5.814793
|
||||
H 9.607961 12.048315 4.911635
|
||||
H 3.064895 11.422889 3.054873
|
||||
H 4.291140 10.542078 3.166190
|
||||
H 2.001271 10.248909 12.702851
|
||||
H 2.907174 10.590416 11.538974
|
||||
H 5.648267 1.877288 14.431286
|
||||
H 6.585421 1.061461 15.296193
|
||||
H 9.740490 12.519628 2.626387
|
||||
H 10.584255 13.059982 1.491498
|
||||
H 7.455032 1.571433 13.159709
|
||||
H 7.941730 2.809647 12.437319
|
||||
H 13.106722 3.411333 7.241976
|
||||
H 13.240150 4.919265 7.226727
|
||||
H 12.368225 4.300614 1.287626
|
||||
H 13.862495 4.466405 1.109956
|
||||
H 0.601526 14.024395 7.330255
|
||||
H 0.816229 12.561332 7.005843
|
||||
H 2.606189 15.728879 14.075552
|
||||
H 1.751050 15.909700 15.311648
|
||||
H 8.495514 5.631109 0.068638
|
||||
H 9.589849 6.084955 1.011160
|
||||
H 13.316729 9.402787 13.389684
|
||||
H 12.379524 8.213880 13.396205
|
||||
H 13.918259 10.505485 9.192801
|
||||
H 14.676156 9.235384 9.515806
|
||||
H 6.242915 3.976825 15.827883
|
||||
H 4.811725 3.679161 16.221565
|
||||
H 5.094286 2.686336 4.584564
|
||||
H 4.898319 1.984198 3.257728
|
||||
H 13.959261 6.906132 5.943560
|
||||
H 12.760208 7.707487 6.403991
|
||||
H 14.969381 3.387665 12.889672
|
||||
H 13.602198 2.792224 13.150740
|
||||
H 7.679644 4.993292 7.367401
|
||||
H 7.415258 5.972883 6.243836
|
||||
H 3.810284 5.488758 6.747876
|
||||
H 2.838344 6.376576 6.000209
|
||||
H 1.201385 4.317435 9.261147
|
||||
H 1.095921 3.984260 10.734160
|
||||
H 8.983144 9.978931 7.349300
|
||||
H 9.731317 11.166458 6.781926
|
||||
H 2.882211 11.167225 15.348581
|
||||
H 1.472398 10.982022 14.828945
|
||||
H 10.205799 9.598641 1.031516
|
||||
H 11.290942 9.189004 0.058604
|
||||
H 0.558492 1.215423 6.737713
|
||||
H 1.132569 2.597863 6.511459
|
||||
H 15.392637 5.068030 6.188591
|
||||
H 15.494223 5.717274 7.552430
|
||||
H 1.359386 8.375518 1.851964
|
||||
H 2.491619 7.530928 1.307342
|
||||
H 3.930723 12.466553 11.679082
|
||||
H 4.127627 12.165120 10.208619
|
||||
H 1.031873 14.870889 9.431517
|
||||
H 2.312758 15.486507 9.953288
|
||||
H 6.898133 0.021480 1.489743
|
||||
H 5.806915 1.068076 1.565740
|
||||
H 4.879440 12.531428 16.027803
|
||||
H 5.343283 11.696347 14.853331
|
||||
H 5.304646 5.468144 10.510363
|
||||
H 5.487486 3.966167 10.460093
|
||||
H 10.682669 0.812386 3.211437
|
||||
H 11.375385 -0.510655 2.963240
|
||||
H 6.968873 13.462683 12.205132
|
||||
H 6.748898 12.423743 11.126193
|
||||
H 11.398639 1.428458 8.050152
|
||||
H 10.636236 1.331547 6.745834
|
||||
H 5.559402 4.680155 6.660940
|
||||
H 4.741233 3.634449 7.388260
|
||||
H 10.965383 2.838195 0.718466
|
||||
H 10.526206 4.126248 0.055186
|
||||
H 2.151544 6.183022 7.979588
|
||||
H 1.693196 6.493418 9.388654
|
||||
H -0.065205 10.491692 7.613487
|
||||
H 0.934641 10.534254 6.477533
|
||||
H 1.612127 6.933760 14.819901
|
||||
H 3.084290 7.085600 14.501194
|
||||
H 14.370852 13.670525 11.760422
|
||||
H 13.655238 13.242663 10.496806
|
||||
H 5.117003 14.119782 13.262678
|
||||
H 6.094269 15.275850 13.243879
|
||||
H 1.684983 15.055245 2.332511
|
||||
H 2.318871 13.688619 2.482233
|
||||
H 3.301587 10.821578 5.287555
|
||||
H 3.569324 9.709332 6.279080
|
||||
H 9.402765 3.485324 4.269409
|
||||
H 8.068278 2.776805 4.364491
|
||||
H 5.849660 1.904585 9.354240
|
||||
H 4.458877 2.303173 8.908431
|
||||
H 5.856290 6.650150 3.713341
|
||||
H 6.956707 7.685055 3.813075
|
||||
H 14.578215 -0.136917 15.110099
|
||||
H 15.036706 1.101780 14.370293
|
||||
H 0.862260 12.331047 10.222329
|
||||
H 0.576388 10.884751 9.878239
|
||||
H 15.013369 2.687846 10.597944
|
||||
H 14.749248 1.349716 9.941024
|
||||
H 7.635604 12.750784 15.605874
|
||||
H 7.063281 13.149121 14.262122
|
||||
H 6.630981 10.323694 0.777061
|
||||
H 6.910682 8.837082 0.837471
|
||||
H 6.518696 10.163169 12.404063
|
||||
H 5.158628 10.311483 11.755901
|
||||
H 14.513415 7.228639 13.841660
|
||||
H 15.188680 7.517995 15.165361
|
||||
H 10.884896 7.694003 10.264136
|
||||
H 9.537008 8.263555 9.875929
|
||||
H 10.169920 3.541428 11.031858
|
||||
H 9.058984 4.472429 11.468839
|
||||
H 12.939998 0.748518 6.560183
|
||||
H 13.359162 -0.684568 6.310259
|
||||
H 6.806079 13.363518 2.113876
|
||||
H 8.230720 13.707514 1.734455
|
||||
H 1.376337 4.428271 4.859101
|
||||
H 0.026246 3.773603 4.657706
|
||||
H 11.202848 10.713245 9.674853
|
||||
H 11.207901 10.618858 8.163906
|
||||
H 0.837038 2.574495 2.447059
|
||||
H 0.139223 3.694244 1.704691
|
||||
H 13.344499 9.479144 4.940640
|
||||
H 12.047898 10.250105 4.812811
|
||||
H 8.179005 2.196707 8.280643
|
||||
H 8.921781 3.193061 7.416086
|
||||
H 11.996578 12.747212 15.501818
|
||||
H 11.029996 11.611989 15.239368
|
||||
H 11.753251 3.258077 14.048538
|
||||
H 11.376661 2.489403 12.799853
|
||||
H 10.727878 5.872638 11.392980
|
||||
H 12.187517 6.272930 11.359562
|
||||
H 12.694899 7.220715 3.599910
|
||||
H 12.399226 8.692890 3.407107
|
||||
H 1.995254 8.322850 11.839802
|
||||
H 0.706423 7.563149 11.608147
|
||||
H 10.003095 4.632780 8.907355
|
||||
H 10.980630 4.590207 7.752146
|
||||
H 3.257893 13.092363 14.136724
|
||||
H 2.487394 13.891684 13.107495
|
||||
H 2.594800 2.360087 13.222239
|
||||
H 3.067392 1.638961 11.977840
|
||||
H 4.204283 7.807066 12.889816
|
||||
H 4.120864 9.063058 13.730900
|
||||
&END COORD
|
||||
&KIND H
|
||||
BASIS_SET TZV2P-GTH
|
||||
POTENTIAL GTH-PBE-q1
|
||||
&END KIND
|
||||
&KIND O
|
||||
BASIS_SET TZV2P-GTH
|
||||
POTENTIAL GTH-PBE-q6
|
||||
&END KIND
|
||||
&END SUBSYS
|
||||
&END FORCE_EVAL
|
||||
|
|
@ -1,169 +0,0 @@
|
|||
&GLOBAL
|
||||
PREFERRED_DIAG_LIBRARY ScaLAPACK
|
||||
PRINT_LEVEL low
|
||||
PROJECT H2O-32_md
|
||||
RUN_TYPE MD
|
||||
&END GLOBAL
|
||||
|
||||
&MOTION
|
||||
&MD
|
||||
ENSEMBLE NVE
|
||||
STEPS 4
|
||||
TEMPERATURE 300.0
|
||||
TIMESTEP 0.5
|
||||
&END MD
|
||||
&END MOTION
|
||||
|
||||
&FORCE_EVAL
|
||||
METHOD Quickstep
|
||||
&DFT
|
||||
BASIS_SET_FILE_NAME GTH_BASIS_SETS
|
||||
POTENTIAL_FILE_NAME POTENTIAL
|
||||
&MGRID
|
||||
CUTOFF 480
|
||||
REL_CUTOFF 60
|
||||
&END MGRID
|
||||
&PRINT
|
||||
&HIRSHFELD off
|
||||
&END HIRSHFELD
|
||||
&MULLIKEN off
|
||||
&END MULLIKEN
|
||||
&END PRINT
|
||||
&QS
|
||||
EPS_DEFAULT 1.0E-14
|
||||
&END QS
|
||||
&SCF
|
||||
EPS_SCF 1.0E-7
|
||||
MAX_SCF 20
|
||||
SCF_GUESS atomic
|
||||
&OT on
|
||||
MINIMIZER CG
|
||||
PRECONDITIONER FULL_SINGLE_INVERSE
|
||||
&END OT
|
||||
&OUTER_SCF on
|
||||
EPS_SCF 1.0E-7
|
||||
MAX_SCF 3
|
||||
&END OUTER_SCF
|
||||
&PRINT
|
||||
&RESTART off
|
||||
&END RESTART
|
||||
&END PRINT
|
||||
&END SCF
|
||||
&XC
|
||||
&XC_FUNCTIONAL PBE
|
||||
&END XC_FUNCTIONAL
|
||||
&END XC
|
||||
&END DFT
|
||||
&SUBSYS
|
||||
&CELL
|
||||
ABC 9.8528 9.8528 9.8528
|
||||
&END CELL
|
||||
# 32 H2O (TIP5P,1bar,300K) a = 9.8528
|
||||
&COORD
|
||||
O 2.280398 9.146539 5.088696
|
||||
O 1.251703 2.406261 7.769908
|
||||
O 1.596302 6.920128 0.656695
|
||||
O 2.957518 3.771868 1.877387
|
||||
O 0.228972 5.884026 6.532308
|
||||
O 9.023431 6.119654 0.092451
|
||||
O 7.256289 8.493641 5.772041
|
||||
O 5.090422 9.467016 0.743177
|
||||
O 6.330888 7.363471 3.747750
|
||||
O 7.763819 8.349367 9.279457
|
||||
O 8.280798 3.837153 5.799282
|
||||
O 8.878250 2.025797 1.664102
|
||||
O 9.160372 0.285100 6.871004
|
||||
O 4.962043 4.134437 0.173376
|
||||
O 2.802896 8.690383 2.435952
|
||||
O 9.123223 3.549232 8.876721
|
||||
O 1.453702 1.402538 2.358278
|
||||
O 6.536550 1.146790 7.609732
|
||||
O 2.766709 0.881503 9.544263
|
||||
O 0.856426 2.075964 5.010625
|
||||
O 6.386036 1.918950 0.242690
|
||||
O 2.733023 4.452756 5.850203
|
||||
O 4.600039 9.254314 6.575944
|
||||
O 3.665373 6.210561 3.158420
|
||||
O 3.371648 6.925594 7.476036
|
||||
O 5.287920 3.270653 6.155080
|
||||
O 5.225237 6.959594 9.582991
|
||||
O 0.846293 5.595877 3.820630
|
||||
O 9.785620 8.164617 3.657879
|
||||
O 8.509982 4.430362 2.679946
|
||||
O 1.337625 8.580920 8.272484
|
||||
O 8.054437 9.221335 1.991376
|
||||
H 1.762019 9.820429 5.528454
|
||||
H 3.095987 9.107088 5.588186
|
||||
H 0.554129 2.982634 8.082024
|
||||
H 1.771257 2.954779 7.182181
|
||||
H 2.112148 6.126321 0.798136
|
||||
H 1.776389 7.463264 1.424030
|
||||
H 3.754249 3.824017 1.349436
|
||||
H 3.010580 4.524142 2.466878
|
||||
H 0.939475 5.243834 6.571945
|
||||
H 0.515723 6.520548 5.877445
|
||||
H 9.852960 6.490366 0.393593
|
||||
H 8.556008 6.860063 -0.294256
|
||||
H 7.886607 7.941321 6.234506
|
||||
H 7.793855 9.141028 5.315813
|
||||
H 4.467366 9.971162 0.219851
|
||||
H 5.758685 10.102795 0.998994
|
||||
H 6.652693 7.917443 3.036562
|
||||
H 6.711966 7.743594 4.539279
|
||||
H 7.751955 8.745180 10.150905
|
||||
H 7.829208 9.092212 8.679343
|
||||
H 8.312540 3.218330 6.528858
|
||||
H 8.508855 4.680699 6.189990
|
||||
H 9.742249 1.704975 1.922581
|
||||
H 8.799060 2.876412 2.095861
|
||||
H 9.505360 1.161677 6.701213
|
||||
H 9.920117 -0.219794 7.161006
|
||||
H 4.749903 4.186003 -0.758595
|
||||
H 5.248010 5.018415 0.403676
|
||||
H 3.576065 9.078451 2.026264
|
||||
H 2.720238 9.146974 3.273164
|
||||
H 9.085561 4.493058 9.031660
|
||||
H 9.215391 3.166305 9.749133
|
||||
H 1.999705 2.060411 1.927796
|
||||
H 1.824184 0.564565 2.081195
|
||||
H 7.430334 0.849764 7.438978
|
||||
H 6.576029 1.537017 8.482885
|
||||
H 2.415851 1.576460 8.987338
|
||||
H 2.276957 0.099537 9.289499
|
||||
H 1.160987 1.818023 4.140602
|
||||
H 0.350256 2.874437 4.860741
|
||||
H 5.768804 2.638450 0.375264
|
||||
H 7.221823 2.257514 0.563730
|
||||
H 3.260797 5.243390 5.962382
|
||||
H 3.347848 3.732214 5.988196
|
||||
H 5.328688 9.073059 5.982269
|
||||
H 5.007063 9.672150 7.334875
|
||||
H 4.566850 6.413356 3.408312
|
||||
H 3.273115 7.061666 2.963521
|
||||
H 3.878372 7.435003 6.843607
|
||||
H 3.884673 6.966316 8.283117
|
||||
H 5.918240 3.116802 5.451335
|
||||
H 5.355924 2.495093 6.711958
|
||||
H 5.071858 7.687254 10.185667
|
||||
H 6.106394 7.112302 9.241707
|
||||
H 1.637363 5.184910 4.169264
|
||||
H 0.427645 4.908936 3.301903
|
||||
H 9.971698 7.227076 3.709104
|
||||
H 10.647901 8.579244 3.629806
|
||||
H 8.046808 5.126383 2.213838
|
||||
H 7.995317 4.290074 3.474723
|
||||
H 1.872601 7.864672 7.930401
|
||||
H 0.837635 8.186808 8.987268
|
||||
H 8.314696 10.115534 2.212519
|
||||
H 8.687134 8.667252 2.448452
|
||||
&END COORD
|
||||
&KIND H
|
||||
BASIS_SET TZV2P-GTH
|
||||
POTENTIAL GTH-PBE-q1
|
||||
&END KIND
|
||||
&KIND O
|
||||
BASIS_SET TZV2P-GTH
|
||||
POTENTIAL GTH-PBE-q6
|
||||
&END KIND
|
||||
&END SUBSYS
|
||||
&END FORCE_EVAL
|
||||
|
|
@ -1,169 +0,0 @@
|
|||
&GLOBAL
|
||||
PREFERRED_DIAG_LIBRARY ELPA
|
||||
PRINT_LEVEL low
|
||||
PROJECT H2O-32_md
|
||||
RUN_TYPE MD
|
||||
&END GLOBAL
|
||||
|
||||
&MOTION
|
||||
&MD
|
||||
ENSEMBLE NVE
|
||||
STEPS 4
|
||||
TEMPERATURE 300.0
|
||||
TIMESTEP 0.5
|
||||
&END MD
|
||||
&END MOTION
|
||||
|
||||
&FORCE_EVAL
|
||||
METHOD Quickstep
|
||||
&DFT
|
||||
BASIS_SET_FILE_NAME GTH_BASIS_SETS
|
||||
POTENTIAL_FILE_NAME POTENTIAL
|
||||
&MGRID
|
||||
CUTOFF 480
|
||||
REL_CUTOFF 60
|
||||
&END MGRID
|
||||
&PRINT
|
||||
&HIRSHFELD off
|
||||
&END HIRSHFELD
|
||||
&MULLIKEN off
|
||||
&END MULLIKEN
|
||||
&END PRINT
|
||||
&QS
|
||||
EPS_DEFAULT 1.0E-14
|
||||
&END QS
|
||||
&SCF
|
||||
EPS_SCF 1.0E-7
|
||||
MAX_SCF 20
|
||||
SCF_GUESS atomic
|
||||
&OT on
|
||||
MINIMIZER CG
|
||||
PRECONDITIONER FULL_SINGLE_INVERSE
|
||||
&END OT
|
||||
&OUTER_SCF on
|
||||
EPS_SCF 1.0E-7
|
||||
MAX_SCF 3
|
||||
&END OUTER_SCF
|
||||
&PRINT
|
||||
&RESTART off
|
||||
&END RESTART
|
||||
&END PRINT
|
||||
&END SCF
|
||||
&XC
|
||||
&XC_FUNCTIONAL PBE
|
||||
&END XC_FUNCTIONAL
|
||||
&END XC
|
||||
&END DFT
|
||||
&SUBSYS
|
||||
&CELL
|
||||
ABC 9.8528 9.8528 9.8528
|
||||
&END CELL
|
||||
# 32 H2O (TIP5P,1bar,300K) a = 9.8528
|
||||
&COORD
|
||||
O 2.280398 9.146539 5.088696
|
||||
O 1.251703 2.406261 7.769908
|
||||
O 1.596302 6.920128 0.656695
|
||||
O 2.957518 3.771868 1.877387
|
||||
O 0.228972 5.884026 6.532308
|
||||
O 9.023431 6.119654 0.092451
|
||||
O 7.256289 8.493641 5.772041
|
||||
O 5.090422 9.467016 0.743177
|
||||
O 6.330888 7.363471 3.747750
|
||||
O 7.763819 8.349367 9.279457
|
||||
O 8.280798 3.837153 5.799282
|
||||
O 8.878250 2.025797 1.664102
|
||||
O 9.160372 0.285100 6.871004
|
||||
O 4.962043 4.134437 0.173376
|
||||
O 2.802896 8.690383 2.435952
|
||||
O 9.123223 3.549232 8.876721
|
||||
O 1.453702 1.402538 2.358278
|
||||
O 6.536550 1.146790 7.609732
|
||||
O 2.766709 0.881503 9.544263
|
||||
O 0.856426 2.075964 5.010625
|
||||
O 6.386036 1.918950 0.242690
|
||||
O 2.733023 4.452756 5.850203
|
||||
O 4.600039 9.254314 6.575944
|
||||
O 3.665373 6.210561 3.158420
|
||||
O 3.371648 6.925594 7.476036
|
||||
O 5.287920 3.270653 6.155080
|
||||
O 5.225237 6.959594 9.582991
|
||||
O 0.846293 5.595877 3.820630
|
||||
O 9.785620 8.164617 3.657879
|
||||
O 8.509982 4.430362 2.679946
|
||||
O 1.337625 8.580920 8.272484
|
||||
O 8.054437 9.221335 1.991376
|
||||
H 1.762019 9.820429 5.528454
|
||||
H 3.095987 9.107088 5.588186
|
||||
H 0.554129 2.982634 8.082024
|
||||
H 1.771257 2.954779 7.182181
|
||||
H 2.112148 6.126321 0.798136
|
||||
H 1.776389 7.463264 1.424030
|
||||
H 3.754249 3.824017 1.349436
|
||||
H 3.010580 4.524142 2.466878
|
||||
H 0.939475 5.243834 6.571945
|
||||
H 0.515723 6.520548 5.877445
|
||||
H 9.852960 6.490366 0.393593
|
||||
H 8.556008 6.860063 -0.294256
|
||||
H 7.886607 7.941321 6.234506
|
||||
H 7.793855 9.141028 5.315813
|
||||
H 4.467366 9.971162 0.219851
|
||||
H 5.758685 10.102795 0.998994
|
||||
H 6.652693 7.917443 3.036562
|
||||
H 6.711966 7.743594 4.539279
|
||||
H 7.751955 8.745180 10.150905
|
||||
H 7.829208 9.092212 8.679343
|
||||
H 8.312540 3.218330 6.528858
|
||||
H 8.508855 4.680699 6.189990
|
||||
H 9.742249 1.704975 1.922581
|
||||
H 8.799060 2.876412 2.095861
|
||||
H 9.505360 1.161677 6.701213
|
||||
H 9.920117 -0.219794 7.161006
|
||||
H 4.749903 4.186003 -0.758595
|
||||
H 5.248010 5.018415 0.403676
|
||||
H 3.576065 9.078451 2.026264
|
||||
H 2.720238 9.146974 3.273164
|
||||
H 9.085561 4.493058 9.031660
|
||||
H 9.215391 3.166305 9.749133
|
||||
H 1.999705 2.060411 1.927796
|
||||
H 1.824184 0.564565 2.081195
|
||||
H 7.430334 0.849764 7.438978
|
||||
H 6.576029 1.537017 8.482885
|
||||
H 2.415851 1.576460 8.987338
|
||||
H 2.276957 0.099537 9.289499
|
||||
H 1.160987 1.818023 4.140602
|
||||
H 0.350256 2.874437 4.860741
|
||||
H 5.768804 2.638450 0.375264
|
||||
H 7.221823 2.257514 0.563730
|
||||
H 3.260797 5.243390 5.962382
|
||||
H 3.347848 3.732214 5.988196
|
||||
H 5.328688 9.073059 5.982269
|
||||
H 5.007063 9.672150 7.334875
|
||||
H 4.566850 6.413356 3.408312
|
||||
H 3.273115 7.061666 2.963521
|
||||
H 3.878372 7.435003 6.843607
|
||||
H 3.884673 6.966316 8.283117
|
||||
H 5.918240 3.116802 5.451335
|
||||
H 5.355924 2.495093 6.711958
|
||||
H 5.071858 7.687254 10.185667
|
||||
H 6.106394 7.112302 9.241707
|
||||
H 1.637363 5.184910 4.169264
|
||||
H 0.427645 4.908936 3.301903
|
||||
H 9.971698 7.227076 3.709104
|
||||
H 10.647901 8.579244 3.629806
|
||||
H 8.046808 5.126383 2.213838
|
||||
H 7.995317 4.290074 3.474723
|
||||
H 1.872601 7.864672 7.930401
|
||||
H 0.837635 8.186808 8.987268
|
||||
H 8.314696 10.115534 2.212519
|
||||
H 8.687134 8.667252 2.448452
|
||||
&END COORD
|
||||
&KIND H
|
||||
BASIS_SET TZV2P-GTH
|
||||
POTENTIAL GTH-PBE-q1
|
||||
&END KIND
|
||||
&KIND O
|
||||
BASIS_SET TZV2P-GTH
|
||||
POTENTIAL GTH-PBE-q6
|
||||
&END KIND
|
||||
&END SUBSYS
|
||||
&END FORCE_EVAL
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,265 +0,0 @@
|
|||
&GLOBAL
|
||||
PREFERRED_DIAG_LIBRARY ScaLAPACK
|
||||
PRINT_LEVEL low
|
||||
PROJECT H2O-64_md
|
||||
RUN_TYPE MD
|
||||
&END GLOBAL
|
||||
|
||||
&MOTION
|
||||
&MD
|
||||
ENSEMBLE NVE
|
||||
STEPS 4
|
||||
TEMPERATURE 300.0
|
||||
TIMESTEP 0.5
|
||||
&END MD
|
||||
&END MOTION
|
||||
|
||||
&FORCE_EVAL
|
||||
METHOD Quickstep
|
||||
&DFT
|
||||
BASIS_SET_FILE_NAME GTH_BASIS_SETS
|
||||
POTENTIAL_FILE_NAME POTENTIAL
|
||||
&MGRID
|
||||
CUTOFF 480
|
||||
REL_CUTOFF 60
|
||||
&END MGRID
|
||||
&PRINT
|
||||
&HIRSHFELD off
|
||||
&END HIRSHFELD
|
||||
&MULLIKEN off
|
||||
&END MULLIKEN
|
||||
&END PRINT
|
||||
&QS
|
||||
EPS_DEFAULT 1.0E-14
|
||||
&END QS
|
||||
&SCF
|
||||
EPS_SCF 1.0E-7
|
||||
MAX_SCF 20
|
||||
SCF_GUESS atomic
|
||||
&OT on
|
||||
MINIMIZER CG
|
||||
PRECONDITIONER FULL_SINGLE_INVERSE
|
||||
&END OT
|
||||
&OUTER_SCF on
|
||||
EPS_SCF 1.0E-7
|
||||
MAX_SCF 3
|
||||
&END OUTER_SCF
|
||||
&PRINT
|
||||
&RESTART off
|
||||
&END RESTART
|
||||
&END PRINT
|
||||
&END SCF
|
||||
&XC
|
||||
&XC_FUNCTIONAL PBE
|
||||
&END XC_FUNCTIONAL
|
||||
&END XC
|
||||
&END DFT
|
||||
&SUBSYS
|
||||
&CELL
|
||||
ABC 12.4138 12.4138 12.4138
|
||||
&END CELL
|
||||
# 64 H2O (TIP5P,1bar,300K) a = 12.4138
|
||||
&COORD
|
||||
O 12.235322 1.376642 10.869880
|
||||
O 6.445390 3.706940 8.650794
|
||||
O 0.085977 2.181322 8.276663
|
||||
O 12.052554 2.671366 2.147199
|
||||
O 12.250036 4.190930 12.092014
|
||||
O 7.187422 0.959062 4.733469
|
||||
O 8.346457 7.210040 4.667644
|
||||
O 12.361546 11.527875 8.106887
|
||||
O 3.299984 4.440816 9.193275
|
||||
O 2.855829 3.759909 6.552815
|
||||
O 1.392494 6.362753 0.586172
|
||||
O 1.858645 8.694013 2.068738
|
||||
O 3.770231 12.094519 8.652183
|
||||
O 6.432508 3.669828 2.772418
|
||||
O 1.998724 1.820217 4.876440
|
||||
O 8.248581 2.404730 6.931303
|
||||
O 5.753814 3.360029 12.461534
|
||||
O 11.322212 5.649239 2.236798
|
||||
O 4.277318 2.113956 10.590808
|
||||
O 5.405015 3.349247 5.484702
|
||||
O 6.493278 11.869958 0.684912
|
||||
O 3.275250 2.346576 2.425241
|
||||
O 7.981003 6.352512 7.507970
|
||||
O 5.985990 6.512854 12.194648
|
||||
O 10.636714 11.856872 12.209540
|
||||
O 9.312283 3.670384 3.508594
|
||||
O 1.106885 5.830301 6.638695
|
||||
O 8.008007 3.326363 10.869818
|
||||
O 12.403000 9.687405 11.761901
|
||||
O 4.219782 7.085315 8.153470
|
||||
O 3.781557 8.203821 11.563272
|
||||
O 11.088898 4.532081 7.809475
|
||||
O 10.387548 8.408890 1.017882
|
||||
O 1.979016 6.418091 10.374159
|
||||
O 4.660547 0.549666 5.617403
|
||||
O 8.745880 12.256257 8.089383
|
||||
O 2.662041 10.489890 0.092980
|
||||
O 7.241661 10.471815 4.226946
|
||||
O 2.276827 0.276647 10.810417
|
||||
O 8.887733 0.946877 1.333885
|
||||
O 1.943554 8.088552 7.567650
|
||||
O 9.667942 8.056759 9.868847
|
||||
O 10.905491 8.339638 6.484782
|
||||
O 3.507733 4.862402 1.557439
|
||||
O 8.010457 8.642846 12.055969
|
||||
O 8.374446 10.035932 6.690309
|
||||
O 5.635247 6.076875 5.563993
|
||||
O 11.728434 1.601906 5.079475
|
||||
O 9.771134 9.814114 3.548703
|
||||
O 3.944355 10.563450 4.687536
|
||||
O 0.890357 6.382287 4.065806
|
||||
O 6.862447 6.425182 2.488202
|
||||
O 3.813963 6.595122 3.762649
|
||||
O 6.562448 8.295463 8.807182
|
||||
O 9.809455 0.143325 3.886553
|
||||
O 4.117074 11.661225 2.221679
|
||||
O 5.295317 8.735561 2.763183
|
||||
O 9.971999 5.379339 5.340378
|
||||
O 12.254708 8.643874 3.957116
|
||||
O 2.344274 10.761274 6.829162
|
||||
O 7.013416 0.643488 10.518797
|
||||
O 5.152349 10.233624 10.359388
|
||||
O 11.184278 5.884064 10.298279
|
||||
O 12.252335 8.974142 9.070831
|
||||
H 12.415139 2.233125 11.257611
|
||||
H 11.922476 1.573799 9.986994
|
||||
H 5.608192 3.371543 8.971482
|
||||
H 6.731226 3.060851 8.004962
|
||||
H -0.169205 1.565594 7.589645
|
||||
H -0.455440 2.954771 8.118939
|
||||
H 12.125168 2.826463 1.205443
|
||||
H 12.888828 2.969761 2.504745
|
||||
H 11.553255 4.386613 11.465566
|
||||
H 12.818281 4.960808 12.067151
|
||||
H 7.049495 1.772344 4.247898
|
||||
H 6.353019 0.798145 5.174047
|
||||
H 7.781850 7.384852 5.420566
|
||||
H 9.103203 6.754017 5.035898
|
||||
H 12.771232 11.788645 8.931744
|
||||
H 12.018035 10.650652 8.276334
|
||||
H 3.557245 3.792529 9.848846
|
||||
H 2.543844 4.884102 9.577958
|
||||
H 2.320235 4.521250 6.329813
|
||||
H 2.872128 3.749963 7.509824
|
||||
H 1.209685 7.121391 1.140501
|
||||
H 2.238885 6.038801 0.894245
|
||||
H 2.763109 8.856353 2.336735
|
||||
H 1.329379 9.047369 2.783755
|
||||
H 4.315639 11.533388 9.203449
|
||||
H 3.098742 12.433043 9.244412
|
||||
H 5.987369 3.448974 3.590530
|
||||
H 5.813096 3.419344 2.086985
|
||||
H 1.057126 1.675344 4.969379
|
||||
H 2.248496 2.292119 5.670892
|
||||
H 8.508264 1.653337 7.464411
|
||||
H 8.066015 2.034597 6.067646
|
||||
H 5.197835 2.915542 11.821572
|
||||
H 6.630900 3.329981 12.079371
|
||||
H 10.788986 6.436672 2.127933
|
||||
H 11.657923 5.463602 1.359832
|
||||
H 3.544476 1.634958 10.977765
|
||||
H 4.755770 1.455054 10.087655
|
||||
H 4.465371 3.375459 5.665294
|
||||
H 5.682663 4.264430 5.524498
|
||||
H 6.174815 11.778676 1.582954
|
||||
H 5.713640 12.089924 0.174999
|
||||
H 3.476076 1.498708 2.028983
|
||||
H 2.730229 2.134295 3.182949
|
||||
H 7.119624 5.936450 7.474030
|
||||
H 8.536492 5.799405 6.958665
|
||||
H 5.909499 5.717477 11.667621
|
||||
H 6.125402 6.196758 13.087330
|
||||
H 11.203499 12.513536 11.804844
|
||||
H 10.260930 12.300153 12.970145
|
||||
H 9.985036 3.927685 2.878172
|
||||
H 8.545584 3.468329 2.972331
|
||||
H 1.399882 6.620092 7.093246
|
||||
H 0.963561 6.112523 5.735345
|
||||
H 8.067363 3.674002 9.979955
|
||||
H 8.000737 2.375959 10.756190
|
||||
H 11.821629 10.402510 12.020482
|
||||
H 12.206854 8.983242 12.379892
|
||||
H 3.461473 7.606485 7.889688
|
||||
H 3.844478 6.304711 8.560946
|
||||
H 3.179884 7.585614 11.148494
|
||||
H 4.401957 7.652030 12.039573
|
||||
H 11.573777 5.053211 7.169515
|
||||
H 10.342076 4.186083 7.320831
|
||||
H 10.065640 8.919194 1.760981
|
||||
H 9.629585 8.322499 0.439729
|
||||
H 1.396302 6.546079 9.625630
|
||||
H 1.405516 6.479759 11.138049
|
||||
H 4.024008 1.232518 5.405828
|
||||
H 4.736858 0.579881 6.571077
|
||||
H 9.452293 12.313381 8.732772
|
||||
H 8.976559 11.502788 7.545965
|
||||
H 1.834701 10.012311 0.153462
|
||||
H 3.295197 9.836403 -0.204175
|
||||
H 7.056724 11.401702 4.095264
|
||||
H 6.499038 10.020287 3.825865
|
||||
H 1.365541 0.487338 11.013887
|
||||
H 2.501591 -0.428131 11.417871
|
||||
H 8.644279 1.812362 1.005409
|
||||
H 8.142674 0.388030 1.112955
|
||||
H 1.272659 8.365063 8.191888
|
||||
H 2.142485 8.877768 7.063867
|
||||
H 8.961493 7.826192 9.265523
|
||||
H 9.227102 8.487654 10.601118
|
||||
H 10.150144 7.758934 6.392768
|
||||
H 10.596082 9.187988 6.167290
|
||||
H 3.463106 4.096188 2.129414
|
||||
H 3.919461 4.539801 0.755791
|
||||
H 7.418998 9.394959 12.028876
|
||||
H 7.430413 7.883095 12.106546
|
||||
H 7.972905 10.220334 5.841196
|
||||
H 7.675111 9.631498 7.203725
|
||||
H 5.332446 6.381336 6.419473
|
||||
H 5.000025 6.434186 4.943466
|
||||
H 11.575078 2.271167 4.412540
|
||||
H 11.219802 0.847030 4.783357
|
||||
H 8.865342 9.721516 3.843998
|
||||
H 10.000732 10.719285 3.758898
|
||||
H 3.186196 10.476397 5.265333
|
||||
H 4.407331 11.335128 5.013723
|
||||
H 0.558187 7.255936 3.859331
|
||||
H 0.341672 5.789383 3.552346
|
||||
H 7.459933 6.526049 3.229193
|
||||
H 6.696228 5.483739 2.440372
|
||||
H 3.864872 6.313007 2.849385
|
||||
H 2.876419 6.621201 3.953862
|
||||
H 5.631529 8.079145 8.753997
|
||||
H 7.003296 7.568245 8.367822
|
||||
H 9.615413 0.527902 3.031755
|
||||
H 8.962985 0.109366 4.332162
|
||||
H 3.825854 11.139182 1.474087
|
||||
H 4.063988 11.063232 2.967211
|
||||
H 5.784391 7.914558 2.708486
|
||||
H 4.780461 8.655167 3.566110
|
||||
H 10.880659 5.444664 5.046607
|
||||
H 9.593331 4.687991 4.797350
|
||||
H 11.562317 8.960134 3.376765
|
||||
H 11.926084 8.816948 4.839320
|
||||
H 2.856874 11.297981 7.433660
|
||||
H 1.492332 11.195517 6.786033
|
||||
H 7.145820 0.090200 9.749009
|
||||
H 7.227275 0.077690 11.260665
|
||||
H 4.662021 9.538430 10.798155
|
||||
H 5.994537 9.833472 10.142985
|
||||
H 10.544299 6.595857 10.301445
|
||||
H 11.281750 5.653082 9.374494
|
||||
H 12.103020 8.841164 10.006916
|
||||
H 11.491592 8.576221 8.647557
|
||||
&END COORD
|
||||
&KIND H
|
||||
BASIS_SET TZV2P-GTH
|
||||
POTENTIAL GTH-PBE-q1
|
||||
&END KIND
|
||||
&KIND O
|
||||
BASIS_SET TZV2P-GTH
|
||||
POTENTIAL GTH-PBE-q6
|
||||
&END KIND
|
||||
&END SUBSYS
|
||||
&END FORCE_EVAL
|
||||
|
|
@ -1,265 +0,0 @@
|
|||
&GLOBAL
|
||||
PREFERRED_DIAG_LIBRARY ELPA
|
||||
PRINT_LEVEL low
|
||||
PROJECT H2O-64_md
|
||||
RUN_TYPE MD
|
||||
&END GLOBAL
|
||||
|
||||
&MOTION
|
||||
&MD
|
||||
ENSEMBLE NVE
|
||||
STEPS 4
|
||||
TEMPERATURE 300.0
|
||||
TIMESTEP 0.5
|
||||
&END MD
|
||||
&END MOTION
|
||||
|
||||
&FORCE_EVAL
|
||||
METHOD Quickstep
|
||||
&DFT
|
||||
BASIS_SET_FILE_NAME GTH_BASIS_SETS
|
||||
POTENTIAL_FILE_NAME POTENTIAL
|
||||
&MGRID
|
||||
CUTOFF 480
|
||||
REL_CUTOFF 60
|
||||
&END MGRID
|
||||
&PRINT
|
||||
&HIRSHFELD off
|
||||
&END HIRSHFELD
|
||||
&MULLIKEN off
|
||||
&END MULLIKEN
|
||||
&END PRINT
|
||||
&QS
|
||||
EPS_DEFAULT 1.0E-14
|
||||
&END QS
|
||||
&SCF
|
||||
EPS_SCF 1.0E-7
|
||||
MAX_SCF 20
|
||||
SCF_GUESS atomic
|
||||
&OT on
|
||||
MINIMIZER CG
|
||||
PRECONDITIONER FULL_SINGLE_INVERSE
|
||||
&END OT
|
||||
&OUTER_SCF on
|
||||
EPS_SCF 1.0E-7
|
||||
MAX_SCF 3
|
||||
&END OUTER_SCF
|
||||
&PRINT
|
||||
&RESTART off
|
||||
&END RESTART
|
||||
&END PRINT
|
||||
&END SCF
|
||||
&XC
|
||||
&XC_FUNCTIONAL PBE
|
||||
&END XC_FUNCTIONAL
|
||||
&END XC
|
||||
&END DFT
|
||||
&SUBSYS
|
||||
&CELL
|
||||
ABC 12.4138 12.4138 12.4138
|
||||
&END CELL
|
||||
# 64 H2O (TIP5P,1bar,300K) a = 12.4138
|
||||
&COORD
|
||||
O 12.235322 1.376642 10.869880
|
||||
O 6.445390 3.706940 8.650794
|
||||
O 0.085977 2.181322 8.276663
|
||||
O 12.052554 2.671366 2.147199
|
||||
O 12.250036 4.190930 12.092014
|
||||
O 7.187422 0.959062 4.733469
|
||||
O 8.346457 7.210040 4.667644
|
||||
O 12.361546 11.527875 8.106887
|
||||
O 3.299984 4.440816 9.193275
|
||||
O 2.855829 3.759909 6.552815
|
||||
O 1.392494 6.362753 0.586172
|
||||
O 1.858645 8.694013 2.068738
|
||||
O 3.770231 12.094519 8.652183
|
||||
O 6.432508 3.669828 2.772418
|
||||
O 1.998724 1.820217 4.876440
|
||||
O 8.248581 2.404730 6.931303
|
||||
O 5.753814 3.360029 12.461534
|
||||
O 11.322212 5.649239 2.236798
|
||||
O 4.277318 2.113956 10.590808
|
||||
O 5.405015 3.349247 5.484702
|
||||
O 6.493278 11.869958 0.684912
|
||||
O 3.275250 2.346576 2.425241
|
||||
O 7.981003 6.352512 7.507970
|
||||
O 5.985990 6.512854 12.194648
|
||||
O 10.636714 11.856872 12.209540
|
||||
O 9.312283 3.670384 3.508594
|
||||
O 1.106885 5.830301 6.638695
|
||||
O 8.008007 3.326363 10.869818
|
||||
O 12.403000 9.687405 11.761901
|
||||
O 4.219782 7.085315 8.153470
|
||||
O 3.781557 8.203821 11.563272
|
||||
O 11.088898 4.532081 7.809475
|
||||
O 10.387548 8.408890 1.017882
|
||||
O 1.979016 6.418091 10.374159
|
||||
O 4.660547 0.549666 5.617403
|
||||
O 8.745880 12.256257 8.089383
|
||||
O 2.662041 10.489890 0.092980
|
||||
O 7.241661 10.471815 4.226946
|
||||
O 2.276827 0.276647 10.810417
|
||||
O 8.887733 0.946877 1.333885
|
||||
O 1.943554 8.088552 7.567650
|
||||
O 9.667942 8.056759 9.868847
|
||||
O 10.905491 8.339638 6.484782
|
||||
O 3.507733 4.862402 1.557439
|
||||
O 8.010457 8.642846 12.055969
|
||||
O 8.374446 10.035932 6.690309
|
||||
O 5.635247 6.076875 5.563993
|
||||
O 11.728434 1.601906 5.079475
|
||||
O 9.771134 9.814114 3.548703
|
||||
O 3.944355 10.563450 4.687536
|
||||
O 0.890357 6.382287 4.065806
|
||||
O 6.862447 6.425182 2.488202
|
||||
O 3.813963 6.595122 3.762649
|
||||
O 6.562448 8.295463 8.807182
|
||||
O 9.809455 0.143325 3.886553
|
||||
O 4.117074 11.661225 2.221679
|
||||
O 5.295317 8.735561 2.763183
|
||||
O 9.971999 5.379339 5.340378
|
||||
O 12.254708 8.643874 3.957116
|
||||
O 2.344274 10.761274 6.829162
|
||||
O 7.013416 0.643488 10.518797
|
||||
O 5.152349 10.233624 10.359388
|
||||
O 11.184278 5.884064 10.298279
|
||||
O 12.252335 8.974142 9.070831
|
||||
H 12.415139 2.233125 11.257611
|
||||
H 11.922476 1.573799 9.986994
|
||||
H 5.608192 3.371543 8.971482
|
||||
H 6.731226 3.060851 8.004962
|
||||
H -0.169205 1.565594 7.589645
|
||||
H -0.455440 2.954771 8.118939
|
||||
H 12.125168 2.826463 1.205443
|
||||
H 12.888828 2.969761 2.504745
|
||||
H 11.553255 4.386613 11.465566
|
||||
H 12.818281 4.960808 12.067151
|
||||
H 7.049495 1.772344 4.247898
|
||||
H 6.353019 0.798145 5.174047
|
||||
H 7.781850 7.384852 5.420566
|
||||
H 9.103203 6.754017 5.035898
|
||||
H 12.771232 11.788645 8.931744
|
||||
H 12.018035 10.650652 8.276334
|
||||
H 3.557245 3.792529 9.848846
|
||||
H 2.543844 4.884102 9.577958
|
||||
H 2.320235 4.521250 6.329813
|
||||
H 2.872128 3.749963 7.509824
|
||||
H 1.209685 7.121391 1.140501
|
||||
H 2.238885 6.038801 0.894245
|
||||
H 2.763109 8.856353 2.336735
|
||||
H 1.329379 9.047369 2.783755
|
||||
H 4.315639 11.533388 9.203449
|
||||
H 3.098742 12.433043 9.244412
|
||||
H 5.987369 3.448974 3.590530
|
||||
H 5.813096 3.419344 2.086985
|
||||
H 1.057126 1.675344 4.969379
|
||||
H 2.248496 2.292119 5.670892
|
||||
H 8.508264 1.653337 7.464411
|
||||
H 8.066015 2.034597 6.067646
|
||||
H 5.197835 2.915542 11.821572
|
||||
H 6.630900 3.329981 12.079371
|
||||
H 10.788986 6.436672 2.127933
|
||||
H 11.657923 5.463602 1.359832
|
||||
H 3.544476 1.634958 10.977765
|
||||
H 4.755770 1.455054 10.087655
|
||||
H 4.465371 3.375459 5.665294
|
||||
H 5.682663 4.264430 5.524498
|
||||
H 6.174815 11.778676 1.582954
|
||||
H 5.713640 12.089924 0.174999
|
||||
H 3.476076 1.498708 2.028983
|
||||
H 2.730229 2.134295 3.182949
|
||||
H 7.119624 5.936450 7.474030
|
||||
H 8.536492 5.799405 6.958665
|
||||
H 5.909499 5.717477 11.667621
|
||||
H 6.125402 6.196758 13.087330
|
||||
H 11.203499 12.513536 11.804844
|
||||
H 10.260930 12.300153 12.970145
|
||||
H 9.985036 3.927685 2.878172
|
||||
H 8.545584 3.468329 2.972331
|
||||
H 1.399882 6.620092 7.093246
|
||||
H 0.963561 6.112523 5.735345
|
||||
H 8.067363 3.674002 9.979955
|
||||
H 8.000737 2.375959 10.756190
|
||||
H 11.821629 10.402510 12.020482
|
||||
H 12.206854 8.983242 12.379892
|
||||
H 3.461473 7.606485 7.889688
|
||||
H 3.844478 6.304711 8.560946
|
||||
H 3.179884 7.585614 11.148494
|
||||
H 4.401957 7.652030 12.039573
|
||||
H 11.573777 5.053211 7.169515
|
||||
H 10.342076 4.186083 7.320831
|
||||
H 10.065640 8.919194 1.760981
|
||||
H 9.629585 8.322499 0.439729
|
||||
H 1.396302 6.546079 9.625630
|
||||
H 1.405516 6.479759 11.138049
|
||||
H 4.024008 1.232518 5.405828
|
||||
H 4.736858 0.579881 6.571077
|
||||
H 9.452293 12.313381 8.732772
|
||||
H 8.976559 11.502788 7.545965
|
||||
H 1.834701 10.012311 0.153462
|
||||
H 3.295197 9.836403 -0.204175
|
||||
H 7.056724 11.401702 4.095264
|
||||
H 6.499038 10.020287 3.825865
|
||||
H 1.365541 0.487338 11.013887
|
||||
H 2.501591 -0.428131 11.417871
|
||||
H 8.644279 1.812362 1.005409
|
||||
H 8.142674 0.388030 1.112955
|
||||
H 1.272659 8.365063 8.191888
|
||||
H 2.142485 8.877768 7.063867
|
||||
H 8.961493 7.826192 9.265523
|
||||
H 9.227102 8.487654 10.601118
|
||||
H 10.150144 7.758934 6.392768
|
||||
H 10.596082 9.187988 6.167290
|
||||
H 3.463106 4.096188 2.129414
|
||||
H 3.919461 4.539801 0.755791
|
||||
H 7.418998 9.394959 12.028876
|
||||
H 7.430413 7.883095 12.106546
|
||||
H 7.972905 10.220334 5.841196
|
||||
H 7.675111 9.631498 7.203725
|
||||
H 5.332446 6.381336 6.419473
|
||||
H 5.000025 6.434186 4.943466
|
||||
H 11.575078 2.271167 4.412540
|
||||
H 11.219802 0.847030 4.783357
|
||||
H 8.865342 9.721516 3.843998
|
||||
H 10.000732 10.719285 3.758898
|
||||
H 3.186196 10.476397 5.265333
|
||||
H 4.407331 11.335128 5.013723
|
||||
H 0.558187 7.255936 3.859331
|
||||
H 0.341672 5.789383 3.552346
|
||||
H 7.459933 6.526049 3.229193
|
||||
H 6.696228 5.483739 2.440372
|
||||
H 3.864872 6.313007 2.849385
|
||||
H 2.876419 6.621201 3.953862
|
||||
H 5.631529 8.079145 8.753997
|
||||
H 7.003296 7.568245 8.367822
|
||||
H 9.615413 0.527902 3.031755
|
||||
H 8.962985 0.109366 4.332162
|
||||
H 3.825854 11.139182 1.474087
|
||||
H 4.063988 11.063232 2.967211
|
||||
H 5.784391 7.914558 2.708486
|
||||
H 4.780461 8.655167 3.566110
|
||||
H 10.880659 5.444664 5.046607
|
||||
H 9.593331 4.687991 4.797350
|
||||
H 11.562317 8.960134 3.376765
|
||||
H 11.926084 8.816948 4.839320
|
||||
H 2.856874 11.297981 7.433660
|
||||
H 1.492332 11.195517 6.786033
|
||||
H 7.145820 0.090200 9.749009
|
||||
H 7.227275 0.077690 11.260665
|
||||
H 4.662021 9.538430 10.798155
|
||||
H 5.994537 9.833472 10.142985
|
||||
H 10.544299 6.595857 10.301445
|
||||
H 11.281750 5.653082 9.374494
|
||||
H 12.103020 8.841164 10.006916
|
||||
H 11.491592 8.576221 8.647557
|
||||
&END COORD
|
||||
&KIND H
|
||||
BASIS_SET TZV2P-GTH
|
||||
POTENTIAL GTH-PBE-q1
|
||||
&END KIND
|
||||
&KIND O
|
||||
BASIS_SET TZV2P-GTH
|
||||
POTENTIAL GTH-PBE-q6
|
||||
&END KIND
|
||||
&END SUBSYS
|
||||
&END FORCE_EVAL
|
||||
|
|
@ -31,6 +31,7 @@
|
|||
&SCF ! Parameters controlling the convergence of the scf. This section should not be changed.
|
||||
EPS_SCF 1.0E-6
|
||||
MAX_SCF 300
|
||||
SCF_GUESS RESTART
|
||||
&OT T
|
||||
MINIMIZER DIIS
|
||||
PRECONDITIONER FULL_ALL
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
&SCF ! Parameters controlling the convergence of the scf. This section should not be changed.
|
||||
EPS_SCF 1.0E-6
|
||||
MAX_SCF 300
|
||||
SCF_GUESS RESTART
|
||||
&OT T
|
||||
MINIMIZER DIIS
|
||||
PRECONDITIONER FULL_ALL
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
&SCF ! Parameters controlling the convergence of the scf. This section should not be changed.
|
||||
EPS_SCF 1.0E-6
|
||||
MAX_SCF 300
|
||||
SCF_GUESS RESTART
|
||||
&OT T
|
||||
MINIMIZER DIIS
|
||||
PRECONDITIONER FULL_ALL
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
&SCF ! Parameters controlling the convergence of the scf. This section should not be changed.
|
||||
EPS_SCF 1.0E-6
|
||||
MAX_SCF 300
|
||||
SCF_GUESS RESTART
|
||||
&OT T
|
||||
MINIMIZER DIIS
|
||||
PRECONDITIONER FULL_ALL
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
&SCF ! Parameters controlling the convergence of the scf. This section should not be changed.
|
||||
EPS_SCF 1.0E-5
|
||||
MAX_SCF 100
|
||||
SCF_GUESS RESTART
|
||||
&OT T
|
||||
MINIMIZER DIIS
|
||||
PRECONDITIONER FULL_ALL
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
&GLOBAL
|
||||
PREFERRED_DIAG_LIBRARY ScaLAPACK
|
||||
PRINT_LEVEL low
|
||||
PRINT_LEVEL medium
|
||||
PROJECT H2O-512_md
|
||||
RUN_TYPE MD
|
||||
&END GLOBAL
|
||||
|
|
@ -92,9 +92,11 @@ def run_benchmark(cp2k_exe_dir, input_file, mpi_wrapper="mpiexec -np {mpi_ranks}
|
|||
|
||||
allok = True
|
||||
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
CP2K | # Threads | # Ranks | Energy
|
||||
-----+-----------+---------+------------------------""")
|
||||
-----+-----------+---------+------------------------"""
|
||||
)
|
||||
|
||||
for (omp_num_threads, mpi_ranks), energy in zip(TEST_COMBINATIONS, energies):
|
||||
version = cp2k_version(omp_num_threads, mpi_ranks)
|
||||
|
|
@ -107,9 +109,11 @@ CP2K | # Threads | # Ranks | Energy
|
|||
f"{version} | {omp_num_threads:9d} | {mpi_ranks:7d} | {energy:20.14f} {mark}"
|
||||
)
|
||||
|
||||
print(f"""\
|
||||
print(
|
||||
f"""\
|
||||
----------------------------------------------------
|
||||
mean: {mean:20.14f} +/- {var:16.12e}""")
|
||||
mean: {mean:20.14f} +/- {var:16.12e}"""
|
||||
)
|
||||
|
||||
return allok
|
||||
|
||||
|
|
|
|||
|
|
@ -119,12 +119,12 @@ with later ones.
|
|||
Running on ORNL's Cray XT5 (Jaguar) the following runtime has been obtained in a setup using 8 OMP
|
||||
threads per node (8 cores per node / 16 Gb per node).
|
||||
|
||||
| Cores | Full CP2K[s] | HFX[s] | local HFX[s] | Mem/node[Mb] |
|
||||
| ----: | -----------: | ------: | -----------: | -----------: |
|
||||
| 1024 | 6569.07 | 6488.24 | 6406.99 | 14845.00 |
|
||||
| 2048 | 1369.92 | 1314.86 | 1259.82 | 13468.00 |
|
||||
| 4096 | 722.24 | 670.18 | 631.11 | 7293.00 |
|
||||
| 8192 | 402.18 | 352.21 | 317.59 | 4306.00 |
|
||||
| 16384 | 274.41 | 213.88 | 172.88 | 2801.00 |
|
||||
| 32768 | 201.71 | 135.47 | 85.29 | 2046.00 |
|
||||
| 65536 | 255.97 | 117.33 | 41.43 | 1673.00 |
|
||||
| Cores | Full CP2K\[s\] | HFX\[s\] | local HFX\[s\] | Mem/node\[Mb\] |
|
||||
| ----: | -------------: | -------: | -------------: | -------------: |
|
||||
| 1024 | 6569.07 | 6488.24 | 6406.99 | 14845.00 |
|
||||
| 2048 | 1369.92 | 1314.86 | 1259.82 | 13468.00 |
|
||||
| 4096 | 722.24 | 670.18 | 631.11 | 7293.00 |
|
||||
| 8192 | 402.18 | 352.21 | 317.59 | 4306.00 |
|
||||
| 16384 | 274.41 | 213.88 | 172.88 | 2801.00 |
|
||||
| 32768 | 201.71 | 135.47 | 85.29 | 2046.00 |
|
||||
| 65536 | 255.97 | 117.33 | 41.43 | 1673.00 |
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
&SCF
|
||||
EPS_SCF 1.0E-6
|
||||
MAX_SCF 20
|
||||
SCF_GUESS RESTART
|
||||
&OT
|
||||
PRECONDITIONER FULL_ALL
|
||||
&END OT
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
CHOLESKY OFF
|
||||
EPS_SCF 1.0E-6
|
||||
MAX_SCF 200
|
||||
SCF_GUESS RESTART
|
||||
&END SCF
|
||||
&XC
|
||||
&WF_CORRELATION
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ To run the benchmark, CP2K needs to be compiled with libint support (`-D__LIBINT
|
|||
|
||||
## Results on Piz Dora, CSCS
|
||||
|
||||
| Input File | Configuration | Total Number of Cores | Runtime [s] |
|
||||
| ---------- | ------------------------: | --------------------: | ----------: |
|
||||
| GW.inp | 16 nodes x 36 MPI x 1 OMP | 576 | 305 |
|
||||
| Input File | Configuration | Total Number of Cores | Runtime \[s\] |
|
||||
| ---------- | ------------------------: | --------------------: | ------------: |
|
||||
| GW.inp | 16 nodes x 36 MPI x 1 OMP | 576 | 305 |
|
||||
|
||||
The timings have been obtained on CRAY-XC40 (PizDora@CSCS)
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ the additional files [`t_c_g.dat`](../../../data/t_c_g.dat) and
|
|||
|
||||
### Results on Piz Dora, CSCS
|
||||
|
||||
| Input File | Configuration | Total Number of Cores | Runtime [s] |
|
||||
| ---------- | ------------------------: | --------------------: | ----------: |
|
||||
| RI-MP2.inp | 16 nodes x 16 MPI x 1 OMP | 256 | 392 |
|
||||
| RI-RPA.inp | 16 nodes x 16 MPI x 1 OMP | 256 | 221 |
|
||||
| Input File | Configuration | Total Number of Cores | Runtime \[s\] |
|
||||
| ---------- | ------------------------: | --------------------: | ------------: |
|
||||
| RI-MP2.inp | 16 nodes x 16 MPI x 1 OMP | 256 | 392 |
|
||||
| RI-RPA.inp | 16 nodes x 16 MPI x 1 OMP | 256 | 221 |
|
||||
|
||||
\*) The timings have been obtained on CRAY-XC40 (PizDora@CSCS)
|
||||
|
|
|
|||
|
|
@ -13,6 +13,5 @@ PBE/GAPW/AE 30.2 845
|
|||
SCAN 14.2 249
|
||||
PBE0/ADMM 16.8 1306
|
||||
DC-SCAN 20.2 3525
|
||||
ccGRB-Q/SCAN 33.2 479
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,75 +0,0 @@
|
|||
&GLOBAL
|
||||
PRINT_LEVEL LOW
|
||||
PROJECT H2O-64
|
||||
RUN_TYPE MD
|
||||
&TIMINGS
|
||||
THRESHOLD 0.001
|
||||
&END TIMINGS
|
||||
&END GLOBAL
|
||||
|
||||
&MOTION
|
||||
&MD
|
||||
ENSEMBLE NVE
|
||||
STEPS 10
|
||||
TEMPERATURE 300.0
|
||||
TIMESTEP 0.5
|
||||
&END MD
|
||||
&END MOTION
|
||||
|
||||
&FORCE_EVAL
|
||||
METHOD QS
|
||||
&DFT
|
||||
BASIS_SET_FILE_NAME BASIS_ccGRB_UZH
|
||||
POTENTIAL_FILE_NAME POTENTIAL_UZH
|
||||
&MGRID
|
||||
CUTOFF 800
|
||||
REL_CUTOFF 60
|
||||
&END MGRID
|
||||
&QS
|
||||
EPS_DEFAULT 1.0E-12
|
||||
METHOD GPW
|
||||
&END QS
|
||||
&SCF
|
||||
EPS_SCF 1.E-7
|
||||
MAX_SCF 10
|
||||
SCF_GUESS ATOMIC
|
||||
&OT ON
|
||||
MINIMIZER DIIS
|
||||
PRECONDITIONER FULL_SINGLE_INVERSE
|
||||
&END OT
|
||||
&OUTER_SCF
|
||||
EPS_SCF 1.E-7
|
||||
MAX_SCF 10
|
||||
&END OUTER_SCF
|
||||
&PRINT
|
||||
&RESTART OFF
|
||||
&END RESTART
|
||||
&END PRINT
|
||||
&END SCF
|
||||
&XC
|
||||
&XC_FUNCTIONAL
|
||||
&MGGA_C_R2SCAN
|
||||
&END MGGA_C_R2SCAN
|
||||
&MGGA_X_R2SCAN
|
||||
&END MGGA_X_R2SCAN
|
||||
&END XC_FUNCTIONAL
|
||||
&END XC
|
||||
&END DFT
|
||||
&SUBSYS
|
||||
&CELL
|
||||
ABC 12.4138 12.4138 12.4138
|
||||
&END CELL
|
||||
&KIND H
|
||||
BASIS_SET ORB ccGRB-Q-q1
|
||||
POTENTIAL GTH-MGGA-q1
|
||||
&END KIND
|
||||
&KIND O
|
||||
BASIS_SET ORB ccGRB-Q-q6
|
||||
POTENTIAL GTH-MGGA-q6
|
||||
&END KIND
|
||||
&TOPOLOGY
|
||||
COORD_FILE_FORMAT xyz
|
||||
COORD_FILE_NAME geom.xyz
|
||||
&END TOPOLOGY
|
||||
&END SUBSYS
|
||||
&END FORCE_EVAL
|
||||
|
|
@ -1,189 +0,0 @@
|
|||
CP2K| version string: CP2K version 2026.1 (Development Version)
|
||||
CP2K| source code revision number: 39a6033793
|
||||
CP2K| cp2kflags: omp libint fftw3 libxc elpa parallel scalapack mpi_f08 cosma a
|
||||
CP2K| ce deepmd xsmm plumed2 spglib libdftd4 mctc-lib tblite sirius
|
||||
CP2K| libvori libbqb libtorch mimic libvdwxc hdf5 trexio libsmeagol
|
||||
CP2K| l greenx
|
||||
|
||||
GLOBAL| Total number of message passing processes 48
|
||||
GLOBAL| Number of threads for this process 2
|
||||
GLOBAL| CPU model name AMD EPYC 7401 24-Core Processor
|
||||
|
||||
MD| ***************************************************************************
|
||||
MD| Step number 10
|
||||
MD| Time [fs] 5.000000
|
||||
MD| Conserved quantity [hartree] -0.110131201702E+04
|
||||
MD| ---------------------------------------------------------------------------
|
||||
MD| Instantaneous Averages
|
||||
MD| CPU time per MD step [s] 35.218158 47.869443
|
||||
MD| Energy drift per atom [K] -0.131390165988E+01 -0.698963310316E+00
|
||||
MD| Potential energy [hartree] -0.110158135777E+04 -0.110156769201E+04
|
||||
MD| Kinetic energy [hartree] 0.269340752994E+00 0.256042491407E+00
|
||||
MD| Temperature [K] 296.862064 282.204983
|
||||
MD| ***************************************************************************
|
||||
MD| Estimated peak process memory after this step [MiB] 692
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
- -
|
||||
- T I M I N G -
|
||||
- -
|
||||
-------------------------------------------------------------------------------
|
||||
SUBROUTINE CALLS ASD SELF TIME TOTAL TIME
|
||||
MAXIMUM AVERAGE MAXIMUM AVERAGE MAXIMUM
|
||||
CP2K 1 1.0 0.019 0.023 479.099 479.111
|
||||
qs_mol_dyn_low 1 2.0 0.020 0.020 478.890 478.902
|
||||
qs_forces 11 3.9 0.002 0.002 478.816 478.828
|
||||
qs_energies 11 4.9 0.002 0.003 442.333 442.396
|
||||
scf_env_do_scf 11 5.9 0.001 0.002 413.851 413.872
|
||||
velocity_verlet 10 3.0 0.002 0.002 372.446 372.457
|
||||
scf_env_do_scf_inner_loop 99 6.8 0.005 0.014 359.191 359.203
|
||||
rebuild_ks_matrix 110 8.5 0.001 0.001 227.840 228.878
|
||||
qs_ks_build_kohn_sham_matrix 110 9.5 0.030 0.039 227.839 228.877
|
||||
qs_ks_update_qs_env 112 7.8 0.002 0.002 197.044 197.946
|
||||
sum_up_and_integrate 110 10.5 0.008 0.011 169.438 169.692
|
||||
integrate_v_rspace 220 11.5 0.015 0.018 169.282 169.526
|
||||
qs_rho_update_rho_low 110 7.9 0.002 0.002 156.297 156.689
|
||||
calculate_rho_elec 220 8.9 0.210 0.232 156.295 156.687
|
||||
grid_integrate_task_list 220 12.5 140.219 147.201 140.219 147.201
|
||||
grid_collocate_task_list 220 9.9 123.134 131.477 123.134 131.477
|
||||
dbcsr_multiply_generic 1975 12.5 0.135 0.160 71.642 73.450
|
||||
multiply_cannon 1975 13.5 0.258 0.349 55.160 58.975
|
||||
multiply_cannon_loop 1975 14.5 0.279 0.348 52.039 57.039
|
||||
init_scf_loop 13 6.8 0.001 0.001 54.630 54.638
|
||||
multiply_cannon_multrec 23700 15.5 30.767 51.243 30.787 51.262
|
||||
mp_waitall_1 182288 16.5 20.746 51.062 20.746 51.062
|
||||
qs_scf_new_mos 99 7.8 0.001 0.003 47.097 48.519
|
||||
qs_scf_loop_do_ot 99 8.8 0.001 0.002 47.096 48.517
|
||||
multiply_cannon_metrocomm3 23700 15.5 0.074 0.081 15.797 46.330
|
||||
ot_scf_mini 99 9.8 0.003 0.003 42.776 44.032
|
||||
fft_wrap_pw1pw2 2871 12.6 0.122 0.152 41.986 43.782
|
||||
fft_wrap_pw1pw2_400 1551 13.9 1.712 1.887 36.891 38.622
|
||||
qs_vxc_create 110 10.5 0.004 0.005 37.743 37.950
|
||||
xc_vxc_pw_create 110 11.5 0.199 0.252 37.740 37.947
|
||||
density_rs2pw 220 9.9 0.017 0.019 28.646 35.958
|
||||
fft3d_ps 2871 14.6 14.807 15.986 31.881 33.324
|
||||
qs_ks_update_qs_env_forces 11 4.9 0.000 0.000 31.335 31.467
|
||||
ot_mini 99 10.8 0.001 0.001 25.690 27.038
|
||||
prepare_preconditioner 13 7.8 0.000 0.000 26.319 26.529
|
||||
make_preconditioner 13 8.8 0.000 0.001 26.319 26.529
|
||||
xc_rho_set_and_dset_create 110 12.5 0.263 0.323 24.080 25.772
|
||||
init_scf_run 11 5.9 0.000 0.000 23.815 23.825
|
||||
scf_env_initial_rho_setup 11 6.9 0.000 0.001 23.815 23.824
|
||||
transfer_rs2pw 891 10.8 0.024 0.033 16.101 23.518
|
||||
mp_waitany 19844 14.1 15.159 23.172 15.159 23.172
|
||||
wfi_extrapolate 11 7.9 0.002 0.002 21.786 21.787
|
||||
xc_pw_derive 660 13.5 0.018 0.021 19.453 21.364
|
||||
potential_pw2rs 220 12.5 0.028 0.031 19.402 19.753
|
||||
transfer_rs2pw_400 231 11.8 1.350 1.798 11.391 18.677
|
||||
make_full_inverse_cholesky 13 9.8 0.000 0.001 17.807 17.993
|
||||
mp_alltoall_d11v 2283 13.5 11.289 16.957 11.289 16.957
|
||||
apply_preconditioner_dbcsr 112 12.8 0.000 0.000 15.272 16.451
|
||||
apply_single 112 13.8 0.001 0.001 15.272 16.451
|
||||
xc_functional_eval 220 13.5 0.004 0.005 14.164 15.815
|
||||
libxc_lda_eval 220 14.5 14.148 15.801 14.160 15.812
|
||||
ot_diis_step 99 11.8 0.005 0.006 15.161 15.161
|
||||
rs_gather_matrices 220 12.5 1.066 1.291 9.280 15.066
|
||||
mp_alltoall_z22v 2871 16.6 12.407 14.961 12.407 14.961
|
||||
xc_pw_divergence 110 12.5 0.009 0.011 13.089 14.726
|
||||
multiply_cannon_metrocomm4 21725 15.5 0.092 0.117 4.602 12.389
|
||||
mp_irecv_dv 62105 16.0 4.643 12.385 4.643 12.385
|
||||
transfer_pw2rs 891 13.4 0.028 0.038 11.855 11.896
|
||||
qs_ot_get_derivative 99 11.8 0.001 0.002 10.443 11.717
|
||||
cp_fm_cholesky_invert 13 10.8 11.168 11.211 11.168 11.211
|
||||
yz_to_x 1221 15.3 1.975 2.374 8.688 10.837
|
||||
make_m2s 3950 13.5 0.072 0.081 9.953 10.273
|
||||
mp_sum_l 9279 13.6 5.067 9.274 5.067 9.274
|
||||
make_images 3950 14.5 0.734 1.143 8.571 8.930
|
||||
make_full_single_inverse 13 9.8 0.002 0.003 7.885 8.086
|
||||
x_to_yz 1210 16.0 1.789 2.030 7.361 7.672
|
||||
transfer_pw2rs_400 231 14.3 3.143 3.414 6.507 6.754
|
||||
cp_dbcsr_sm_fm_multiply 45 9.4 0.002 0.002 6.539 6.554
|
||||
qs_ot_get_derivative_taylor 81 12.9 0.003 0.004 5.114 6.150
|
||||
cp_dbcsr_sm_fm_multiply_core 45 10.4 0.000 0.000 5.638 6.015
|
||||
mp_sum_d 3837 11.5 3.298 5.774 3.298 5.774
|
||||
qs_ot_get_p 112 10.5 0.001 0.002 3.745 5.453
|
||||
cp_fm_cholesky_decompose 26 10.6 5.275 5.362 5.275 5.362
|
||||
calculate_dm_sparse 110 9.7 0.001 0.002 4.805 5.290
|
||||
build_core_hamiltonian_matrix_ 11 4.9 0.001 0.002 4.564 4.829
|
||||
rs_scatter_matrices 242 9.9 1.481 1.780 4.123 4.647
|
||||
dbcsr_dot 1040 12.2 0.447 0.495 2.215 4.289
|
||||
make_images_data 3950 15.5 0.057 0.070 3.529 4.119
|
||||
pw_gather_p 1441 14.1 3.490 3.731 3.490 3.731
|
||||
hybrid_alltoall_any 4089 16.4 0.289 1.555 3.073 3.593
|
||||
transfer_pw2rs_140 220 14.5 1.238 1.324 3.288 3.395
|
||||
pw_scatter_p 1430 15.1 2.982 3.382 2.982 3.382
|
||||
qs_energies_init_hamiltonians 11 5.9 0.000 0.001 3.361 3.361
|
||||
transfer_rs2pw_140 220 11.9 1.136 1.370 3.147 3.298
|
||||
make_images_sizes 3950 15.5 0.005 0.006 2.536 3.183
|
||||
mp_alltoall_i44 3950 16.5 2.531 3.179 2.531 3.179
|
||||
pw_derive 990 13.8 2.904 3.176 2.904 3.176
|
||||
arnoldi_generalized_ev 13 10.8 0.001 0.001 3.044 3.087
|
||||
mp_alltoall_i22 607 13.6 1.709 2.928 1.709 2.928
|
||||
dbcsr_sym_matrix_vector_mult 1266 12.5 0.029 0.041 2.855 2.888
|
||||
fft_wrap_pw1pw2_140 440 13.2 0.084 0.111 2.543 2.785
|
||||
build_core_ppl_forces 11 5.9 2.474 2.781 2.474 2.781
|
||||
pw_poisson_solve 110 10.5 0.005 0.008 2.707 2.765
|
||||
gev_build_subspace 23 11.4 0.012 0.026 2.613 2.623
|
||||
copy_dbcsr_to_fm 139 10.8 0.004 0.005 1.657 2.436
|
||||
dbcsr_complete_redistribute 314 11.8 0.461 0.527 1.884 2.349
|
||||
pw_copy 2090 13.1 2.122 2.316 2.122 2.316
|
||||
make_basis_sm 13 9.4 0.001 0.001 2.302 2.310
|
||||
make_images_pack 3950 15.5 1.533 2.280 1.555 2.299
|
||||
build_core_hamiltonian_matrix 11 6.9 0.002 0.002 2.091 2.225
|
||||
ot_scf_init 13 7.8 0.002 0.002 2.116 2.131
|
||||
buffer_matrices_ensure_size 3950 14.5 1.359 1.995 1.359 1.995
|
||||
dbcsr_sym_matrix_vector_mult_l 1266 13.5 1.598 1.837 1.605 1.843
|
||||
reorthogonalize_vectors 10 9.0 0.000 0.000 1.809 1.816
|
||||
pw_poisson_set 111 11.4 0.009 0.012 1.702 1.760
|
||||
parallel_gemm_fm_cosma 95 8.9 1.694 1.752 1.694 1.752
|
||||
transfer_pw2rs_50 220 14.5 0.385 0.442 1.576 1.751
|
||||
copy_fm_to_dbcsr 175 10.8 0.001 0.002 1.303 1.723
|
||||
mp_allgather_i34 1975 14.5 1.319 1.670 1.319 1.670
|
||||
dbcsr_desymmetrize_deep 139 11.8 0.083 0.112 0.881 1.625
|
||||
fft_wrap_pw1pw2_50 440 13.2 0.016 0.018 1.451 1.553
|
||||
dbcsr_make_dense_low 8068 15.8 0.045 0.048 1.262 1.524
|
||||
rs_grid_zero 462 15.2 1.445 1.515 1.445 1.515
|
||||
qs_ot_get_orbitals 99 10.8 0.001 0.001 1.444 1.500
|
||||
make_dense_data 8068 16.8 1.139 1.368 1.193 1.453
|
||||
dbcsr_make_images_dense 3286 14.9 0.037 0.040 1.244 1.449
|
||||
build_core_ppl 11 7.9 1.313 1.443 1.313 1.443
|
||||
pw_axpy 1540 11.6 1.365 1.430 1.365 1.430
|
||||
qs_ot_get_derivative_diag 18 12.0 0.001 0.001 1.091 1.394
|
||||
mp_sendrecv_dv 20680 12.9 1.209 1.343 1.209 1.343
|
||||
qs_env_update_s_mstruct 11 6.9 0.000 0.000 1.186 1.319
|
||||
cp_dbcsr_plus_fm_fm_t 22 8.9 0.001 0.001 1.211 1.306
|
||||
transfer_rs2pw_50 220 11.9 0.243 0.261 1.170 1.283
|
||||
compute_matrix_w 11 5.9 0.000 0.000 1.178 1.246
|
||||
calculate_w_matrix_ot 11 6.9 0.001 0.002 1.178 1.246
|
||||
build_core_ppnl_forces 11 5.9 1.143 1.240 1.143 1.240
|
||||
pw_copy_to_array 1441 14.1 1.048 1.231 1.048 1.231
|
||||
mp_sum_dv 7212 14.3 0.931 1.130 0.931 1.130
|
||||
fft_wrap_pw1pw2_20 440 13.2 0.005 0.006 0.979 1.049
|
||||
mp_irecv_dm3 5412 14.1 0.461 0.959 0.461 0.959
|
||||
transfer_fm_to_dbcsr 13 9.8 0.000 0.000 0.627 0.915
|
||||
transfer_dbcsr_to_fm 13 10.8 0.001 0.002 0.806 0.868
|
||||
pw_copy_from_array 1430 15.1 0.647 0.835 0.647 0.835
|
||||
mp_alltoall_z11v 440 16.2 0.771 0.816 0.771 0.816
|
||||
calculate_rho_core 11 7.9 0.051 0.058 0.671 0.812
|
||||
dbcsr_rep_row_to_rep_col_vec 1266 13.5 0.036 0.070 0.635 0.810
|
||||
cp_fm_uplo_to_full 46 13.0 0.578 0.800 0.578 0.800
|
||||
multiply_cannon_metrocomm1 23700 15.5 0.037 0.046 0.342 0.750
|
||||
build_kinetic_matrix_low 22 6.9 0.668 0.711 0.689 0.734
|
||||
calculate_ecore_overlap 22 5.9 0.000 0.001 0.437 0.728
|
||||
build_overlap_matrix_low 22 6.9 0.645 0.687 0.675 0.716
|
||||
external_control 109 7.3 0.001 0.002 0.180 0.702
|
||||
mp_bcast_b_src 129 8.9 0.179 0.702 0.179 0.702
|
||||
dbcsr_finalize 4461 13.7 0.031 0.059 0.531 0.685
|
||||
dbcsr_copy 4672 12.8 0.486 0.546 0.562 0.672
|
||||
dbcsr_merge_all 3948 15.0 0.077 0.143 0.477 0.618
|
||||
dbcsr_col_vec_to_rep_row 1800 14.0 0.023 0.032 0.411 0.602
|
||||
mp_isendrecv_dv 20680 15.5 0.199 0.596 0.199 0.596
|
||||
calculate_first_density_matrix 1 7.0 0.000 0.000 0.585 0.592
|
||||
qs_ot_p2m_diag 20 11.0 0.002 0.004 0.550 0.553
|
||||
evaluate_core_matrix_traces 110 8.5 0.001 0.001 0.537 0.539
|
||||
calculate_ptrace_kp 220 9.5 0.001 0.001 0.536 0.538
|
||||
qs_create_task_list 11 7.9 0.000 0.000 0.493 0.517
|
||||
generate_qs_task_list 11 8.9 0.221 0.255 0.493 0.517
|
||||
transfer_pw2rs_20 220 14.5 0.083 0.097 0.456 0.510
|
||||
dbcsr_add_wm_from_matrix 418 13.0 0.036 0.108 0.388 0.485
|
||||
-------------------------------------------------------------------------------
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
# Quickstep Single Node Regression Tests
|
||||
|
||||
The purpose of these tests is to give a quick idea of the performance of a system, when only a
|
||||
single node is available. The tests should run in < 5 minutes on a modern node, and require less
|
||||
single node is available. The tests should run in \< 5 minutes on a modern node, and require less
|
||||
than 16Gb of memory.
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
PROJECT diag_cu72_broy
|
||||
! Do not compute forces to avoid performance cliff of grid_integrate_task_list on GPU.
|
||||
RUN_TYPE ENERGY
|
||||
&PRINT_ELPA ON
|
||||
&END PRINT_ELPA
|
||||
&END GLOBAL
|
||||
|
||||
&FORCE_EVAL
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
PROJECT diag_cu72_broy
|
||||
! Do not compute forces to avoid performance cliff of grid_integrate_task_list on GPU.
|
||||
RUN_TYPE ENERGY
|
||||
&PRINT_ELPA ON
|
||||
&END PRINT_ELPA
|
||||
&END GLOBAL
|
||||
|
||||
&FORCE_EVAL
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ postfix=""
|
|||
# used ranks, can be any value, by default the number of physical cores on the node
|
||||
ranks=$(lscpu | awk '/^Core\(s\) per socket:/ {cores=$NF}; /^Socket\(s\):/ {sockets=$NF}; END{print cores*sockets}')
|
||||
# adjust command for testing as needed
|
||||
command="mpirun -np $ranks ../../../install/bin/cp2k.popt"
|
||||
command="mpirun -np $ranks ../../../exe/local/cp2k.popt"
|
||||
# iterations used for testing (best value retained for benchmark result)
|
||||
maxiter=3
|
||||
|
||||
|
|
|
|||
|
|
@ -1,151 +0,0 @@
|
|||
include:
|
||||
- remote: 'https://gitlab.com/cscs-ci/recipes/-/raw/master/templates/v2/.ci-ext.yml'
|
||||
|
||||
stages:
|
||||
- deps
|
||||
- cp2k
|
||||
- test
|
||||
- benchmark
|
||||
|
||||
variables:
|
||||
REPOSITORY: cp2k_daint
|
||||
BUILDER: spack
|
||||
VERSION: psmp
|
||||
TAG: "${BUILDER}_${VERSION}"
|
||||
UBUNTU_IMAGE_NAME: "ubuntu:26.04"
|
||||
CSCS_IMAGE_NAME: "${CSCS_REGISTRY_PATH}/${REPOSITORY}:${TAG}_${CI_COMMIT_SHORT_SHA}"
|
||||
DOCKERHUB_IMAGE_NAME: "docker.io/${DOCKERHUB_USERNAME}/${REPOSITORY}:${TAG}"
|
||||
|
||||
build deps daint:
|
||||
extends: .container-builder-cscs-gh200
|
||||
stage: deps
|
||||
timeout: 6h
|
||||
before_script:
|
||||
- DEPS_IMAGE_TAG=$(cat make_cp2k.sh ci/cscs_daint_${TAG}.yaml ci/docker/build_deps_spack.Dockerfile $(find tools/spack -type f | sort) | sha256sum | head -c 16)
|
||||
- export PERSIST_IMAGE_NAME=${CSCS_REGISTRY_PATH}/base/${REPOSITORY}:${TAG}_${DEPS_IMAGE_TAG}
|
||||
- echo "DEPS_IMAGE_NAME=${PERSIST_IMAGE_NAME}" | tee build.env
|
||||
artifacts:
|
||||
reports:
|
||||
dotenv: build.env
|
||||
variables:
|
||||
DOCKER_BUILD_ARGS: '[
|
||||
"BASE_IMAGE",
|
||||
"CP2K_VERSION",
|
||||
"FEATURE_FLAGS",
|
||||
"NUM_PROCS"
|
||||
]'
|
||||
DOCKERFILE: ci/docker/build_${CI_JOB_STAGE}_${BUILDER}.Dockerfile
|
||||
BASE_IMAGE: ${UBUNTU_IMAGE_NAME}
|
||||
CP2K_VERSION: ${VERSION}
|
||||
FEATURE_FLAGS: "-ef openpmd -np 4"
|
||||
NUM_PROCS: 64
|
||||
KUBERNETES_CPU_REQUEST: 64
|
||||
KUBERNETES_CPU_LIMIT: 64
|
||||
KUBERNETES_MEMORY_REQUEST: 128Gi
|
||||
KUBERNETES_MEMORY_LIMIT: 128Gi
|
||||
|
||||
build cp2k daint:
|
||||
extends: .container-builder-cscs-gh200
|
||||
stage: cp2k
|
||||
needs: ["build deps daint"]
|
||||
timeout: 6h
|
||||
before_script:
|
||||
- echo ${DOCKERHUB_TOKEN} | podman login docker.io --username ${DOCKERHUB_USERNAME} --password-stdin
|
||||
after_script:
|
||||
- podman images
|
||||
- podman push ${PERSIST_IMAGE_NAME} ${DOCKERHUB_IMAGE_NAME}
|
||||
variables:
|
||||
DOCKER_BUILD_ARGS: '[
|
||||
"BASE_IMAGE",
|
||||
"DEPS_IMAGE",
|
||||
"FEATURE_FLAGS",
|
||||
"NUM_PROCS"
|
||||
]'
|
||||
DOCKERFILE: ci/docker/build_${CI_JOB_STAGE}_${BUILDER}.Dockerfile
|
||||
BASE_IMAGE: ${UBUNTU_IMAGE_NAME}
|
||||
DEPS_IMAGE: ${DEPS_IMAGE_NAME}
|
||||
FEATURE_FLAGS: "-ef openpmd"
|
||||
NUM_PROCS: 32
|
||||
KUBERNETES_CPU_REQUEST: 32
|
||||
KUBERNETES_CPU_LIMIT: 32
|
||||
PERSIST_IMAGE_NAME: ${CSCS_IMAGE_NAME}
|
||||
|
||||
test cp2k daint:
|
||||
extends: .baremetal-runner-daint-gh200
|
||||
stage: test
|
||||
needs: ["build cp2k daint"]
|
||||
timeout: 6h
|
||||
script:
|
||||
- podman run --shm-size=1g -v ${PWD}:/mnt ${DOCKERHUB_IMAGE_NAME} mpiexec -bind-to socket -genv OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK} -n ${SLURM_NTASKS} cp2k /opt/cp2k/benchmarks/CI/H2O-32_md.inp
|
||||
- podman run --shm-size=1g -v ${PWD}:/mnt ${DOCKERHUB_IMAGE_NAME} mpiexec -bind-to socket -genv OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK} -n ${SLURM_NTASKS} cp2k /opt/cp2k/benchmarks/CI/H2O-32_md_elpa.inp
|
||||
variables:
|
||||
SLURM_CPUS_PER_TASK: 4
|
||||
SLURM_DEBUG: 1
|
||||
SLURM_HINT: nomultithread
|
||||
SLURM_JOB_NUM_NODES: 1
|
||||
SLURM_NTASKS: 8
|
||||
SLURM_NTASKS_PER_NODE: 8
|
||||
SLURM_TIMELIMIT: 15
|
||||
USE_MPI: YES
|
||||
|
||||
regression test cp2k daint:
|
||||
extends: .baremetal-runner-daint-gh200
|
||||
stage: test
|
||||
needs: ["build cp2k daint","test cp2k daint"]
|
||||
timeout: 6h
|
||||
script:
|
||||
- git --no-pager log -1 --pretty="%nCommitSHA:%x20%H%nCommitTime:%x20%ci%nCommitAuthor:%x20%an%nCommitSubject:%x20%s%n"
|
||||
- podman run --shm-size=1g -v ${PWD}:/mnt ${DOCKERHUB_IMAGE_NAME} /opt/cp2k/tests/do_regtest.py --cp2kdatadir /opt/cp2k/install/share/cp2k/data --maxtasks ${SLURM_NTASKS} --mpiexec "mpiexec -bind-to none" --keepalive /opt/cp2k/install/bin ${VERSION} 2>&1 || true
|
||||
variables:
|
||||
SLURM_DEBUG: 1
|
||||
SLURM_HINT: nomultithread
|
||||
SLURM_JOB_NUM_NODES: 1
|
||||
SLURM_NTASKS: 288
|
||||
SLURM_TIMELIMIT: 60
|
||||
USE_MPI: YES
|
||||
|
||||
benchmark cp2k 1 daint node:
|
||||
extends: .container-runner-daint-gh200
|
||||
stage: benchmark
|
||||
needs: ["build cp2k daint","test cp2k daint"]
|
||||
timeout: 6h
|
||||
image: ${CSCS_IMAGE_NAME}
|
||||
before_script:
|
||||
- export CP2K_DATA_DIR=/opt/cp2k/install/share/cp2k/data
|
||||
- export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}
|
||||
script:
|
||||
- cp2k /opt/cp2k/benchmarks/CI/H2O-512_md.inp
|
||||
variables:
|
||||
SLURM_CPU_BIND: cores
|
||||
SLURM_CPUS_PER_TASK: 3
|
||||
SLURM_DEBUG: 1
|
||||
SLURM_HINT: nomultithread
|
||||
SLURM_JOB_NUM_NODES: 1
|
||||
SLURM_MPI_TYPE: pmi2
|
||||
SLURM_NTASKS: 72
|
||||
SLURM_NTASKS_PER_NODE: 72
|
||||
SLURM_TIMELIMIT: 30
|
||||
USE_MPI: YES
|
||||
|
||||
benchmark cp2k 1 daint node elpa:
|
||||
extends: .container-runner-daint-gh200
|
||||
stage: benchmark
|
||||
needs: ["build cp2k daint","test cp2k daint","benchmark cp2k 1 daint node"]
|
||||
timeout: 6h
|
||||
image: ${CSCS_IMAGE_NAME}
|
||||
before_script:
|
||||
- export CP2K_DATA_DIR=/opt/cp2k/install/share/cp2k/data
|
||||
- export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}
|
||||
script:
|
||||
- cp2k /opt/cp2k/benchmarks/CI/H2O-512_md_elpa.inp
|
||||
variables:
|
||||
SLURM_CPU_BIND: cores
|
||||
SLURM_CPUS_PER_TASK: 3
|
||||
SLURM_DEBUG: 1
|
||||
SLURM_HINT: nomultithread
|
||||
SLURM_JOB_NUM_NODES: 1
|
||||
SLURM_MPI_TYPE: pmi2
|
||||
SLURM_NTASKS: 72
|
||||
SLURM_NTASKS_PER_NODE: 72
|
||||
SLURM_TIMELIMIT: 30
|
||||
USE_MPI: YES
|
||||
|
|
@ -1,151 +0,0 @@
|
|||
include:
|
||||
- remote: 'https://gitlab.com/cscs-ci/recipes/-/raw/master/templates/v2/.ci-ext.yml'
|
||||
|
||||
stages:
|
||||
- deps
|
||||
- cp2k
|
||||
- test
|
||||
- benchmark
|
||||
|
||||
variables:
|
||||
REPOSITORY: cp2k_daint
|
||||
BUILDER: spack
|
||||
VERSION: psmp
|
||||
TAG: "${BUILDER}_${VERSION}_h100"
|
||||
UBUNTU_IMAGE_NAME: "docker.io/nvidia/cuda:12.9.2-devel-ubuntu24.04"
|
||||
CSCS_IMAGE_NAME: "${CSCS_REGISTRY_PATH}/${REPOSITORY}:${TAG}_${CI_COMMIT_SHORT_SHA}"
|
||||
DOCKERHUB_IMAGE_NAME: "docker.io/${DOCKERHUB_USERNAME}/${REPOSITORY}:${TAG}"
|
||||
|
||||
build deps daint:
|
||||
extends: .container-builder-cscs-gh200
|
||||
stage: deps
|
||||
timeout: 6h
|
||||
before_script:
|
||||
- DEPS_IMAGE_TAG=$(cat make_cp2k.sh ci/cscs_daint_${TAG}.yaml ci/docker/build_deps_spack.Dockerfile $(find tools/spack -type f | sort) | sha256sum | head -c 16)
|
||||
- export PERSIST_IMAGE_NAME=${CSCS_REGISTRY_PATH}/base/${REPOSITORY}:${TAG}_${DEPS_IMAGE_TAG}
|
||||
- echo "DEPS_IMAGE_NAME=${PERSIST_IMAGE_NAME}" | tee build.env
|
||||
artifacts:
|
||||
reports:
|
||||
dotenv: build.env
|
||||
variables:
|
||||
DOCKER_BUILD_ARGS: '[
|
||||
"BASE_IMAGE",
|
||||
"CP2K_VERSION",
|
||||
"FEATURE_FLAGS",
|
||||
"NUM_PROCS"
|
||||
]'
|
||||
DOCKERFILE: ci/docker/build_${CI_JOB_STAGE}_${BUILDER}.Dockerfile
|
||||
BASE_IMAGE: ${UBUNTU_IMAGE_NAME}
|
||||
CP2K_VERSION: ${VERSION}
|
||||
FEATURE_FLAGS: "-ef openpmd -gpu GH200 -np 4"
|
||||
NUM_PROCS: 64
|
||||
KUBERNETES_CPU_REQUEST: 64
|
||||
KUBERNETES_CPU_LIMIT: 64
|
||||
KUBERNETES_MEMORY_REQUEST: 256Gi
|
||||
KUBERNETES_MEMORY_LIMIT: 256Gi
|
||||
|
||||
build cp2k daint:
|
||||
extends: .container-builder-cscs-gh200
|
||||
stage: cp2k
|
||||
needs: ["build deps daint"]
|
||||
timeout: 6h
|
||||
before_script:
|
||||
- echo ${DOCKERHUB_TOKEN} | podman login docker.io --username ${DOCKERHUB_USERNAME} --password-stdin
|
||||
after_script:
|
||||
- podman images
|
||||
- podman push ${PERSIST_IMAGE_NAME} ${DOCKERHUB_IMAGE_NAME}
|
||||
variables:
|
||||
DOCKER_BUILD_ARGS: '[
|
||||
"BASE_IMAGE",
|
||||
"DEPS_IMAGE",
|
||||
"FEATURE_FLAGS",
|
||||
"NUM_PROCS"
|
||||
]'
|
||||
DOCKERFILE: ci/docker/build_${CI_JOB_STAGE}_${BUILDER}.Dockerfile
|
||||
BASE_IMAGE: ${UBUNTU_IMAGE_NAME}
|
||||
DEPS_IMAGE: ${DEPS_IMAGE_NAME}
|
||||
FEATURE_FLAGS: "-ef openpmd -gpu GH200"
|
||||
NUM_PROCS: 32
|
||||
KUBERNETES_CPU_REQUEST: 32
|
||||
KUBERNETES_CPU_LIMIT: 32
|
||||
PERSIST_IMAGE_NAME: ${CSCS_IMAGE_NAME}
|
||||
|
||||
test cp2k daint:
|
||||
extends: .baremetal-runner-daint-gh200
|
||||
stage: test
|
||||
needs: ["build cp2k daint"]
|
||||
timeout: 6h
|
||||
script:
|
||||
- podman run --device nvidia.com/gpu=0 --shm-size=1g -v ${PWD}:/mnt ${DOCKERHUB_IMAGE_NAME} mpiexec -bind-to socket -genv OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK} -n ${SLURM_NTASKS} cp2k /opt/cp2k/benchmarks/CI/H2O-32_md.inp
|
||||
- podman run --device nvidia.com/gpu=0 --shm-size=1g -v ${PWD}:/mnt ${DOCKERHUB_IMAGE_NAME} mpiexec -bind-to socket -genv OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK} -n ${SLURM_NTASKS} cp2k /opt/cp2k/benchmarks/CI/H2O-32_md_elpa.inp
|
||||
variables:
|
||||
SLURM_CPUS_PER_TASK: 4
|
||||
SLURM_DEBUG: 1
|
||||
SLURM_HINT: nomultithread
|
||||
SLURM_JOB_NUM_NODES: 1
|
||||
SLURM_NTASKS: 8
|
||||
SLURM_NTASKS_PER_NODE: 8
|
||||
SLURM_TIMELIMIT: 15
|
||||
USE_MPI: YES
|
||||
|
||||
regression test cp2k daint:
|
||||
extends: .baremetal-runner-daint-gh200
|
||||
stage: test
|
||||
needs: ["build cp2k daint"]
|
||||
timeout: 6h
|
||||
script:
|
||||
- git --no-pager log -1 --pretty="%nCommitSHA:%x20%H%nCommitTime:%x20%ci%nCommitAuthor:%x20%an%nCommitSubject:%x20%s%n"
|
||||
- podman run --device nvidia.com/gpu=all --shm-size=1g -v ${PWD}:/mnt ${DOCKERHUB_IMAGE_NAME} /opt/cp2k/tests/do_regtest.py --cp2kdatadir /opt/cp2k/install/share/cp2k/data --maxtasks ${SLURM_NTASKS} --mpiexec "mpiexec -bind-to none" --keepalive /opt/cp2k/install/bin ${VERSION} 2>&1 || true
|
||||
variables:
|
||||
SLURM_DEBUG: 1
|
||||
SLURM_HINT: nomultithread
|
||||
SLURM_JOB_NUM_NODES: 1
|
||||
SLURM_NTASKS: 224
|
||||
SLURM_TIMELIMIT: 60
|
||||
USE_MPI: YES
|
||||
|
||||
benchmark cp2k 1 daint node:
|
||||
extends: .container-runner-daint-gh200
|
||||
stage: benchmark
|
||||
needs: ["build cp2k daint","test cp2k daint"]
|
||||
timeout: 6h
|
||||
image: ${CSCS_IMAGE_NAME}
|
||||
before_script:
|
||||
- export CP2K_DATA_DIR=/opt/cp2k/install/share/cp2k/data
|
||||
- export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}
|
||||
script:
|
||||
- cp2k /opt/cp2k/benchmarks/CI/H2O-512_md.inp
|
||||
variables:
|
||||
SLURM_CPU_BIND: cores
|
||||
SLURM_CPUS_PER_TASK: 3
|
||||
SLURM_DEBUG: 1
|
||||
SLURM_HINT: nomultithread
|
||||
SLURM_JOB_NUM_NODES: 1
|
||||
SLURM_MPI_TYPE: pmi2
|
||||
SLURM_NTASKS: 72
|
||||
SLURM_NTASKS_PER_NODE: 72
|
||||
SLURM_TIMELIMIT: 30
|
||||
USE_MPI: YES
|
||||
|
||||
benchmark cp2k 1 daint node elpa:
|
||||
extends: .container-runner-daint-gh200
|
||||
stage: benchmark
|
||||
needs: ["build cp2k daint","test cp2k daint","benchmark cp2k 1 daint node"]
|
||||
timeout: 6h
|
||||
image: ${CSCS_IMAGE_NAME}
|
||||
before_script:
|
||||
- export CP2K_DATA_DIR=/opt/cp2k/install/share/cp2k/data
|
||||
- export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}
|
||||
script:
|
||||
- cp2k /opt/cp2k/benchmarks/CI/H2O-512_md_elpa.inp
|
||||
variables:
|
||||
SLURM_CPU_BIND: cores
|
||||
SLURM_CPUS_PER_TASK: 3
|
||||
SLURM_DEBUG: 1
|
||||
SLURM_HINT: nomultithread
|
||||
SLURM_JOB_NUM_NODES: 1
|
||||
SLURM_MPI_TYPE: pmi2
|
||||
SLURM_NTASKS: 72
|
||||
SLURM_NTASKS_PER_NODE: 72
|
||||
SLURM_TIMELIMIT: 30
|
||||
USE_MPI: YES
|
||||
|
|
@ -1,197 +0,0 @@
|
|||
include:
|
||||
- remote: 'https://gitlab.com/cscs-ci/recipes/-/raw/master/templates/v2/.ci-ext.yml'
|
||||
|
||||
stages:
|
||||
- deps
|
||||
- cp2k
|
||||
- test
|
||||
- benchmark
|
||||
|
||||
variables:
|
||||
REPOSITORY: cp2k_eiger
|
||||
BUILDER: spack
|
||||
VERSION: psmp
|
||||
TAG: "${BUILDER}_${VERSION}"
|
||||
UBUNTU_IMAGE_NAME: "ubuntu:26.04"
|
||||
CSCS_IMAGE_NAME: "${CSCS_REGISTRY_PATH}/${REPOSITORY}:${TAG}_${CI_COMMIT_SHORT_SHA}"
|
||||
DOCKERHUB_IMAGE_NAME: "docker.io/${DOCKERHUB_USERNAME}/${REPOSITORY}:${TAG}"
|
||||
|
||||
build deps eiger:
|
||||
extends: .container-builder-cscs-zen2
|
||||
stage: deps
|
||||
timeout: 6h
|
||||
before_script:
|
||||
- DEPS_IMAGE_TAG=$(cat make_cp2k.sh ci/cscs_eiger_${TAG}.yaml ci/docker/build_deps_spack.Dockerfile $(find tools/spack -type f | sort) | sha256sum | head -c 16)
|
||||
- export PERSIST_IMAGE_NAME=${CSCS_REGISTRY_PATH}/base/${REPOSITORY}:${TAG}_${DEPS_IMAGE_TAG}
|
||||
- echo "DEPS_IMAGE_NAME=${PERSIST_IMAGE_NAME}" | tee build.env
|
||||
artifacts:
|
||||
reports:
|
||||
dotenv: build.env
|
||||
variables:
|
||||
DOCKER_BUILD_ARGS: '[
|
||||
"BASE_IMAGE",
|
||||
"CP2K_VERSION",
|
||||
"FEATURE_FLAGS",
|
||||
"NUM_PROCS"
|
||||
]'
|
||||
DOCKERFILE: ci/docker/build_${CI_JOB_STAGE}_${BUILDER}.Dockerfile
|
||||
BASE_IMAGE: ${UBUNTU_IMAGE_NAME}
|
||||
CP2K_VERSION: ${VERSION}
|
||||
FEATURE_FLAGS: "-ef openpmd -np 4"
|
||||
NUM_PROCS: 64
|
||||
KUBERNETES_CPU_REQUEST: 64
|
||||
KUBERNETES_CPU_LIMIT: 64
|
||||
KUBERNETES_MEMORY_REQUEST: 128Gi
|
||||
KUBERNETES_MEMORY_LIMIT: 128Gi
|
||||
|
||||
build cp2k eiger:
|
||||
extends: .container-builder-cscs-zen2
|
||||
stage: cp2k
|
||||
needs: ["build deps eiger"]
|
||||
timeout: 6h
|
||||
before_script:
|
||||
- echo ${DOCKERHUB_TOKEN} | podman login docker.io --username ${DOCKERHUB_USERNAME} --password-stdin
|
||||
after_script:
|
||||
- podman images
|
||||
- podman push ${PERSIST_IMAGE_NAME} ${DOCKERHUB_IMAGE_NAME}
|
||||
variables:
|
||||
DOCKER_BUILD_ARGS: '[
|
||||
"BASE_IMAGE",
|
||||
"DEPS_IMAGE",
|
||||
"FEATURE_FLAGS",
|
||||
"NUM_PROCS"
|
||||
]'
|
||||
DOCKERFILE: ci/docker/build_${CI_JOB_STAGE}_${BUILDER}.Dockerfile
|
||||
BASE_IMAGE: ${UBUNTU_IMAGE_NAME}
|
||||
DEPS_IMAGE: ${DEPS_IMAGE_NAME}
|
||||
FEATURE_FLAGS: "-ef openpmd"
|
||||
NUM_PROCS: 32
|
||||
KUBERNETES_CPU_REQUEST: 32
|
||||
KUBERNETES_CPU_LIMIT: 32
|
||||
PERSIST_IMAGE_NAME: ${CSCS_IMAGE_NAME}
|
||||
|
||||
test cp2k eiger:
|
||||
extends: .baremetal-runner-eiger-zen2
|
||||
stage: test
|
||||
needs: ["build cp2k eiger"]
|
||||
timeout: 6h
|
||||
script:
|
||||
- podman run --shm-size=1g -v ${PWD}:/mnt ${DOCKERHUB_IMAGE_NAME} mpiexec -genv OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK} -n ${SLURM_NTASKS} cp2k /opt/cp2k/benchmarks/CI/H2O-32_md.inp
|
||||
- podman run --shm-size=1g -v ${PWD}:/mnt ${DOCKERHUB_IMAGE_NAME} mpiexec -genv OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK} -n ${SLURM_NTASKS} cp2k /opt/cp2k/benchmarks/CI/H2O-32_md_elpa.inp
|
||||
variables:
|
||||
SLURM_CONSTRAINT: mc
|
||||
SLURM_CPUS_PER_TASK: 4
|
||||
SLURM_DEBUG: 1
|
||||
SLURM_HINT: nomultithread
|
||||
SLURM_JOB_NUM_NODES: 1
|
||||
SLURM_NTASKS: 8
|
||||
SLURM_NTASKS_PER_NODE: 8
|
||||
SLURM_TIMELIMIT: 15
|
||||
USE_MPI: YES
|
||||
|
||||
regression test cp2k eiger:
|
||||
extends: .baremetal-runner-eiger-zen2
|
||||
stage: test
|
||||
needs: ["build cp2k eiger","test cp2k eiger"]
|
||||
timeout: 6h
|
||||
script:
|
||||
- git --no-pager log -1 --pretty="%nCommitSHA:%x20%H%nCommitTime:%x20%ci%nCommitAuthor:%x20%an%nCommitSubject:%x20%s%n"
|
||||
- podman run --shm-size=1g -v ${PWD}:/mnt ${DOCKERHUB_IMAGE_NAME} /opt/cp2k/tests/do_regtest.py --cp2kdatadir /opt/cp2k/install/share/cp2k/data --maxtasks ${SLURM_NTASKS} --mpiexec "mpiexec -bind-to none" --keepalive /opt/cp2k/install/bin ${VERSION} 2>&1 || true
|
||||
variables:
|
||||
SLURM_CONSTRAINT: mc
|
||||
SLURM_DEBUG: 1
|
||||
SLURM_HINT: nomultithread
|
||||
SLURM_JOB_NUM_NODES: 1
|
||||
SLURM_NTASKS: 128
|
||||
SLURM_TIMELIMIT: 60
|
||||
USE_MPI: YES
|
||||
|
||||
benchmark cp2k 1 eiger node:
|
||||
extends: .container-runner-eiger-zen2
|
||||
stage: benchmark
|
||||
needs: ["build cp2k eiger","test cp2k eiger","regression test cp2k eiger"]
|
||||
timeout: 6h
|
||||
image: ${CSCS_IMAGE_NAME}
|
||||
before_script:
|
||||
- export CP2K_DATA_DIR=/opt/cp2k/install/share/cp2k/data
|
||||
script:
|
||||
- cp2k.popt /opt/cp2k/benchmarks/CI/H2O-128_md.inp
|
||||
variables:
|
||||
SLURM_CONSTRAINT: mc
|
||||
SLURM_CPUS_PER_TASK: 1
|
||||
SLURM_DEBUG: 1
|
||||
SLURM_HINT: nomultithread
|
||||
SLURM_JOB_NUM_NODES: 1
|
||||
SLURM_MPI_TYPE: pmi2
|
||||
SLURM_NTASKS: 128
|
||||
SLURM_NTASKS_PER_NODE: 128
|
||||
SLURM_TIMELIMIT: 30
|
||||
USE_MPI: YES
|
||||
|
||||
benchmark cp2k 1 eiger node elpa:
|
||||
extends: .container-runner-eiger-zen2
|
||||
stage: benchmark
|
||||
needs: ["build cp2k eiger","test cp2k eiger","regression test cp2k eiger","benchmark cp2k 1 eiger node"]
|
||||
timeout: 6h
|
||||
image: ${CSCS_IMAGE_NAME}
|
||||
before_script:
|
||||
- export CP2K_DATA_DIR=/opt/cp2k/install/share/cp2k/data
|
||||
script:
|
||||
- cp2k.popt /opt/cp2k/benchmarks/CI/H2O-128_md_elpa.inp
|
||||
variables:
|
||||
SLURM_CONSTRAINT: mc
|
||||
SLURM_CPUS_PER_TASK: 1
|
||||
SLURM_DEBUG: 1
|
||||
SLURM_HINT: nomultithread
|
||||
SLURM_JOB_NUM_NODES: 1
|
||||
SLURM_MPI_TYPE: pmi2
|
||||
SLURM_NTASKS: 128
|
||||
SLURM_NTASKS_PER_NODE: 128
|
||||
SLURM_TIMELIMIT: 30
|
||||
USE_MPI: YES
|
||||
|
||||
benchmark cp2k 2 eiger nodes:
|
||||
extends: .container-runner-eiger-zen2
|
||||
stage: benchmark
|
||||
needs: ["build cp2k eiger","test cp2k eiger","regression test cp2k eiger"]
|
||||
timeout: 6h
|
||||
image: ${CSCS_IMAGE_NAME}
|
||||
before_script:
|
||||
- export CP2K_DATA_DIR=/opt/cp2k/install/share/cp2k/data
|
||||
- export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}
|
||||
script:
|
||||
- cp2k /opt/cp2k/benchmarks/CI/H2O-512_md.inp
|
||||
variables:
|
||||
SLURM_CONSTRAINT: mc
|
||||
SLURM_CPUS_PER_TASK: 1
|
||||
SLURM_DEBUG: 1
|
||||
SLURM_HINT: nomultithread
|
||||
SLURM_JOB_NUM_NODES: 2
|
||||
SLURM_MPI_TYPE: pmi2
|
||||
SLURM_NTASKS: 256
|
||||
SLURM_NTASKS_PER_NODE: 128
|
||||
SLURM_TIMELIMIT: 30
|
||||
USE_MPI: YES
|
||||
|
||||
benchmark cp2k 2 eiger nodes elpa:
|
||||
extends: .container-runner-eiger-zen2
|
||||
stage: benchmark
|
||||
needs: ["build cp2k eiger","test cp2k eiger","regression test cp2k eiger","benchmark cp2k 2 eiger nodes"]
|
||||
timeout: 6h
|
||||
image: ${CSCS_IMAGE_NAME}
|
||||
before_script:
|
||||
- export CP2K_DATA_DIR=/opt/cp2k/install/share/cp2k/data
|
||||
- export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}
|
||||
script:
|
||||
- cp2k /opt/cp2k/benchmarks/CI/H2O-512_md_elpa.inp
|
||||
variables:
|
||||
SLURM_CONSTRAINT: mc
|
||||
SLURM_CPUS_PER_TASK: 1
|
||||
SLURM_DEBUG: 1
|
||||
SLURM_HINT: nomultithread
|
||||
SLURM_JOB_NUM_NODES: 2
|
||||
SLURM_MPI_TYPE: pmi2
|
||||
SLURM_NTASKS: 256
|
||||
SLURM_NTASKS_PER_NODE: 128
|
||||
SLURM_TIMELIMIT: 30
|
||||
USE_MPI: YES
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
include:
|
||||
- remote: 'https://gitlab.com/cscs-ci/recipes/-/raw/master/templates/v2/.ci-ext.yml'
|
||||
|
||||
stages:
|
||||
- deps
|
||||
- cp2k
|
||||
- test
|
||||
|
||||
variables:
|
||||
REPOSITORY: cp2k_eiger
|
||||
BUILDER: spack
|
||||
VERSION: ssmp
|
||||
TAG: "${BUILDER}_${VERSION}"
|
||||
UBUNTU_IMAGE_NAME: "ubuntu:26.04"
|
||||
CSCS_IMAGE_NAME: "${CSCS_REGISTRY_PATH}/${REPOSITORY}:${TAG}_${CI_COMMIT_SHORT_SHA}"
|
||||
DOCKERHUB_IMAGE_NAME: "docker.io/${DOCKERHUB_USERNAME}/${REPOSITORY}:${TAG}"
|
||||
|
||||
build deps eiger:
|
||||
extends: .container-builder-cscs-zen2
|
||||
stage: deps
|
||||
timeout: 6h
|
||||
before_script:
|
||||
- DEPS_IMAGE_TAG=$(cat make_cp2k.sh ci/cscs_eiger_${TAG}.yaml ci/docker/build_deps_spack.Dockerfile $(find tools/spack -type f | sort) | sha256sum | head -c 16)
|
||||
- export PERSIST_IMAGE_NAME=${CSCS_REGISTRY_PATH}/base/${REPOSITORY}:${TAG}_${DEPS_IMAGE_TAG}
|
||||
- echo "DEPS_IMAGE_NAME=${PERSIST_IMAGE_NAME}" | tee build.env
|
||||
artifacts:
|
||||
reports:
|
||||
dotenv: build.env
|
||||
variables:
|
||||
DOCKER_BUILD_ARGS: '[
|
||||
"BASE_IMAGE",
|
||||
"CP2K_VERSION",
|
||||
"FEATURE_FLAGS",
|
||||
"NUM_PROCS"
|
||||
]'
|
||||
DOCKERFILE: ci/docker/build_${CI_JOB_STAGE}_${BUILDER}.Dockerfile
|
||||
BASE_IMAGE: ${UBUNTU_IMAGE_NAME}
|
||||
CP2K_VERSION: ${VERSION}
|
||||
FEATURE_FLAGS: "-np 4"
|
||||
NUM_PROCS: 64
|
||||
KUBERNETES_CPU_REQUEST: 64
|
||||
KUBERNETES_CPU_LIMIT: 64
|
||||
KUBERNETES_MEMORY_REQUEST: 64Gi
|
||||
KUBERNETES_MEMORY_LIMIT: 64Gi
|
||||
|
||||
build cp2k eiger:
|
||||
extends: .container-builder-cscs-zen2
|
||||
stage: cp2k
|
||||
needs: ["build deps eiger"]
|
||||
timeout: 6h
|
||||
before_script:
|
||||
- echo ${DOCKERHUB_TOKEN} | podman login docker.io --username ${DOCKERHUB_USERNAME} --password-stdin
|
||||
after_script:
|
||||
- podman images
|
||||
- podman push ${PERSIST_IMAGE_NAME} ${DOCKERHUB_IMAGE_NAME}
|
||||
variables:
|
||||
DOCKER_BUILD_ARGS: '[
|
||||
"BASE_IMAGE",
|
||||
"DEPS_IMAGE",
|
||||
"FEATURE_FLAGS",
|
||||
"NUM_PROCS"
|
||||
]'
|
||||
DOCKERFILE: ci/docker/build_${CI_JOB_STAGE}_${BUILDER}.Dockerfile
|
||||
BASE_IMAGE: ${UBUNTU_IMAGE_NAME}
|
||||
DEPS_IMAGE: ${DEPS_IMAGE_NAME}
|
||||
FEATURE_FLAGS: ""
|
||||
NUM_PROCS: 32
|
||||
KUBERNETES_CPU_REQUEST: 32
|
||||
KUBERNETES_CPU_LIMIT: 32
|
||||
PERSIST_IMAGE_NAME: ${CSCS_IMAGE_NAME}
|
||||
|
||||
test cp2k eiger:
|
||||
extends: .baremetal-runner-eiger-zen2
|
||||
stage: test
|
||||
needs: ["build cp2k eiger"]
|
||||
timeout: 6h
|
||||
script:
|
||||
- podman run --env OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK} --shm-size=1g -v ${PWD}:/mnt ${DOCKERHUB_IMAGE_NAME} cp2k /opt/cp2k/benchmarks/CI/H2O-32_md.inp
|
||||
variables:
|
||||
SLURM_CONSTRAINT: mc
|
||||
SLURM_CPUS_PER_TASK: 8
|
||||
SLURM_DEBUG: 1
|
||||
SLURM_HINT: nomultithread
|
||||
SLURM_JOB_NUM_NODES: 1
|
||||
SLURM_NTASKS: 1
|
||||
SLURM_NTASKS_PER_NODE: 1
|
||||
SLURM_TIMELIMIT: 15
|
||||
|
||||
regression test cp2k eiger:
|
||||
extends: .baremetal-runner-eiger-zen2
|
||||
stage: test
|
||||
needs: ["build cp2k eiger","test cp2k eiger"]
|
||||
timeout: 6h
|
||||
script:
|
||||
- git --no-pager log -1 --pretty="%nCommitSHA:%x20%H%nCommitTime:%x20%ci%nCommitAuthor:%x20%an%nCommitSubject:%x20%s%n"
|
||||
- podman run --shm-size=1g -v ${PWD}:/mnt ${DOCKERHUB_IMAGE_NAME} /opt/cp2k/tests/do_regtest.py --cp2kdatadir /opt/cp2k/install/share/cp2k/data --maxtasks ${SLURM_NTASKS} --mpiexec "mpiexec -bind-to none" --keepalive /opt/cp2k/install/bin ${VERSION} 2>&1 || true
|
||||
variables:
|
||||
SLURM_CONSTRAINT: mc
|
||||
SLURM_DEBUG: 1
|
||||
SLURM_HINT: nomultithread
|
||||
SLURM_JOB_NUM_NODES: 1
|
||||
SLURM_NTASKS: 128
|
||||
SLURM_TIMELIMIT: 60
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
# Dockerfile for CP2K continuous integration (CI) runs
|
||||
#
|
||||
# A stand-alone build in this folder can be performed with:
|
||||
# podman build --build-arg DEPS_IMAGE=<image id> --shm-size=1g -f build_cp2k_spack.Dockerfile ../../
|
||||
#
|
||||
# Stage 2: Build CP2K
|
||||
|
||||
ARG BASE_IMAGE=${BASE_IMAGE:-ubuntu:26.04}
|
||||
ARG DEPS_IMAGE=${DEPS_IMAGE:-}
|
||||
|
||||
FROM "${DEPS_IMAGE}" AS build_cp2k
|
||||
|
||||
# Setup CUDA environment
|
||||
ENV CUDA_HOME=/usr/local/cuda
|
||||
ENV LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"
|
||||
|
||||
# Retrieve the number of available CPU cores
|
||||
ARG NUM_PROCS
|
||||
ENV NUM_PROCS=${NUM_PROCS:-32}
|
||||
|
||||
ARG FEATURE_FLAGS
|
||||
ENV FEATURE_FLAGS=${FEATURE_FLAGS:-}
|
||||
|
||||
# Build CP2K
|
||||
WORKDIR /opt/cp2k
|
||||
COPY ./src ./src
|
||||
COPY ./data ./data
|
||||
COPY ./tools/build_utils ./tools/build_utils
|
||||
COPY ./cmake ./cmake
|
||||
COPY ./CMakeLists.txt .
|
||||
|
||||
RUN ./make_cp2k.sh -cray -cv ${CP2K_VERSION} -uc no -j${NUM_PROCS} ${FEATURE_FLAGS}
|
||||
|
||||
# Stage 3: Install CP2K
|
||||
|
||||
FROM "${BASE_IMAGE}" AS install_cp2k
|
||||
|
||||
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
|
||||
g++ gcc gfortran \
|
||||
python3 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /opt/cp2k
|
||||
|
||||
# Install CP2K dependencies built with spack
|
||||
COPY --from=build_cp2k /opt/cp2k/spack/spack/opt/spack ./spack/spack/opt/spack
|
||||
|
||||
# Install CP2K
|
||||
COPY --from=build_cp2k /opt/cp2k/install ./install
|
||||
|
||||
# Install CP2K regression tests
|
||||
COPY ./tests ./tests
|
||||
COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
|
||||
|
||||
# Install CP2K/Quickstep CI benchmarks
|
||||
COPY ./benchmarks/CI ./benchmarks/CI
|
||||
|
||||
# Do not rely only on LD_LIBRARY_PATH because it is fragile
|
||||
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
|
||||
RUN ldconfig
|
||||
|
||||
# Create entrypoint and finalise container build
|
||||
WORKDIR /mnt
|
||||
ENTRYPOINT ["/opt/cp2k/install/bin/launch"]
|
||||
CMD ["cp2k", "--help", "--version"]
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
# Dockerfile for CP2K continuous integration (CI) runs
|
||||
#
|
||||
# A stand-alone build in this folder can be performed with:
|
||||
# podman build --shm-size=1g -f build_deps_spack.Dockerfile ../../
|
||||
#
|
||||
# Stage 1: Create a base image providing the dependencies for building a CP2K binary
|
||||
|
||||
ARG BASE_IMAGE=${BASE_IMAGE:-ubuntu:26.04}
|
||||
|
||||
FROM "${BASE_IMAGE}" AS build_deps
|
||||
|
||||
# Install packages required to build the CP2K dependencies with Spack
|
||||
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
|
||||
bzip2 \
|
||||
ca-certificates \
|
||||
cmake \
|
||||
g++ gcc gfortran \
|
||||
git \
|
||||
gnupg \
|
||||
libssh-dev \
|
||||
libssl-dev \
|
||||
libtool \
|
||||
libtool-bin \
|
||||
lsb-release \
|
||||
make \
|
||||
patch \
|
||||
pkgconf \
|
||||
python3 \
|
||||
python3-dev \
|
||||
python3-pip \
|
||||
python3-venv \
|
||||
unzip \
|
||||
wget \
|
||||
xxd \
|
||||
xz-utils \
|
||||
zstd \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Setup CUDA environment
|
||||
ENV CUDA_HOME=/usr/local/cuda
|
||||
ENV LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"
|
||||
|
||||
# Retrieve the number of available CPU cores
|
||||
ARG NUM_PROCS
|
||||
ENV NUM_PROCS=${NUM_PROCS:-32}
|
||||
|
||||
ARG CP2K_VERSION
|
||||
ENV CP2K_VERSION=${CP2K_VERSION:-psmp}
|
||||
|
||||
ARG FEATURE_FLAGS
|
||||
ENV FEATURE_FLAGS=${FEATURE_FLAGS:-}
|
||||
|
||||
# Build CP2K dependencies
|
||||
WORKDIR /opt/cp2k
|
||||
COPY ./tools/spack ./tools/spack
|
||||
COPY ./tools/docker ./tools/docker
|
||||
COPY ./make_cp2k.sh .
|
||||
|
||||
RUN ./make_cp2k.sh -bd_only -cray -cv ${CP2K_VERSION} -uc no -ue -j${NUM_PROCS} ${FEATURE_FLAGS}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
|
|
|||
189
cmake/CheckFortranSourceRuns.cmake
Normal file
189
cmake/CheckFortranSourceRuns.cmake
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
CheckFortranSourceRuns
|
||||
----------------------
|
||||
|
||||
Check if given Fortran source compiles and links into an executable and can
|
||||
subsequently be run.
|
||||
|
||||
.. command:: check_fortran_source_runs
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
check_fortran_source_runs(<code> <resultVar>
|
||||
[SRC_EXT <extension>])
|
||||
|
||||
Check that the source supplied in ``<code>`` can be compiled as a Fortran source
|
||||
file, linked as an executable and then run. The ``<code>`` must be a Fortran program
|
||||
containing at least an ``end`` statement--for example:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
check_fortran_source_runs("real :: x[*]; call co_sum(x); end" F2018coarrayOK)
|
||||
|
||||
This command can help avoid costly build processes when a compiler lacks support
|
||||
for a necessary feature, or a particular vendor library is not compatible with
|
||||
the Fortran compiler version being used. Some of these failures only occur at runtime
|
||||
instead of linktime, and a trivial runtime example can catch the issue before the
|
||||
main build process.
|
||||
|
||||
If the ``<code>`` could be built and run
|
||||
successfully, the internal cache variable specified by ``<resultVar>`` will
|
||||
be set to 1, otherwise it will be set to an value that evaluates to boolean
|
||||
false (e.g. an empty string or an error message).
|
||||
|
||||
By default, the test source file will be given a ``.F90`` file extension. The
|
||||
``SRC_EXT`` option can be used to override this with ``.<extension>`` instead.
|
||||
|
||||
The underlying check is performed by the :command:`try_run` command. The
|
||||
compile and link commands can be influenced by setting any of the following
|
||||
variables prior to calling ``check_fortran_source_runs()``:
|
||||
|
||||
``CMAKE_REQUIRED_FLAGS``
|
||||
Additional flags to pass to the compiler. Note that the contents of
|
||||
:variable:`CMAKE_Fortran_FLAGS <CMAKE_<LANG>_FLAGS>` and its associated
|
||||
configuration-specific variable are automatically added to the compiler
|
||||
command before the contents of ``CMAKE_REQUIRED_FLAGS``.
|
||||
|
||||
``CMAKE_REQUIRED_DEFINITIONS``
|
||||
A :ref:`;-list <CMake Language Lists>` of compiler definitions of the form
|
||||
``-DFOO`` or ``-DFOO=bar``. A definition for the name specified by
|
||||
``<resultVar>`` will also be added automatically.
|
||||
|
||||
``CMAKE_REQUIRED_INCLUDES``
|
||||
A :ref:`;-list <CMake Language Lists>` of header search paths to pass to
|
||||
the compiler. These will be the only header search paths used by
|
||||
``try_run()``, i.e. the contents of the :prop_dir:`INCLUDE_DIRECTORIES`
|
||||
directory property will be ignored.
|
||||
|
||||
``CMAKE_REQUIRED_LINK_OPTIONS``
|
||||
A :ref:`;-list <CMake Language Lists>` of options to add to the link
|
||||
command (see :command:`try_run` for further details).
|
||||
|
||||
``CMAKE_REQUIRED_LIBRARIES``
|
||||
A :ref:`;-list <CMake Language Lists>` of libraries to add to the link
|
||||
command. These can be the name of system libraries or they can be
|
||||
:ref:`Imported Targets <Imported Targets>` (see :command:`try_run` for
|
||||
further details).
|
||||
|
||||
``CMAKE_REQUIRED_QUIET``
|
||||
If this variable evaluates to a boolean true value, all status messages
|
||||
associated with the check will be suppressed.
|
||||
|
||||
The check is only performed once, with the result cached in the variable
|
||||
named by ``<resultVar>``. Every subsequent CMake run will re-use this cached
|
||||
value rather than performing the check again, even if the ``<code>`` changes.
|
||||
In order to force the check to be re-evaluated, the variable named by
|
||||
``<resultVar>`` must be manually removed from the cache.
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
include_guard(GLOBAL)
|
||||
|
||||
macro(CHECK_Fortran_SOURCE_RUNS SOURCE VAR)
|
||||
if(NOT DEFINED "${VAR}")
|
||||
set(_SRC_EXT)
|
||||
set(_key)
|
||||
foreach(arg ${ARGN})
|
||||
if("${arg}" MATCHES "^(SRC_EXT)$")
|
||||
set(_key "${arg}")
|
||||
elseif(_key)
|
||||
list(APPEND _${_key} "${arg}")
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown argument:\n ${arg}\n")
|
||||
endif()
|
||||
endforeach()
|
||||
if(NOT _SRC_EXT)
|
||||
set(_SRC_EXT F90)
|
||||
endif()
|
||||
if(CMAKE_REQUIRED_LINK_OPTIONS)
|
||||
set(CHECK_Fortran_SOURCE_COMPILES_ADD_LINK_OPTIONS
|
||||
LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
|
||||
else()
|
||||
set(CHECK_Fortran_SOURCE_COMPILES_ADD_LINK_OPTIONS)
|
||||
endif()
|
||||
if(CMAKE_REQUIRED_LIBRARIES)
|
||||
set(CHECK_Fortran_SOURCE_COMPILES_ADD_LIBRARIES
|
||||
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
|
||||
else()
|
||||
set(CHECK_Fortran_SOURCE_COMPILES_ADD_LIBRARIES)
|
||||
endif()
|
||||
if(CMAKE_REQUIRED_INCLUDES)
|
||||
set(CHECK_Fortran_SOURCE_COMPILES_ADD_INCLUDES
|
||||
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
|
||||
else()
|
||||
set(CHECK_Fortran_SOURCE_COMPILES_ADD_INCLUDES)
|
||||
endif()
|
||||
file(WRITE
|
||||
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}"
|
||||
"${SOURCE}\n")
|
||||
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(CHECK_START "Performing Test ${VAR}")
|
||||
endif()
|
||||
try_run(
|
||||
${VAR}_EXITCODE ${VAR}_COMPILED ${CMAKE_BINARY_DIR}
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}
|
||||
COMPILE_DEFINITIONS
|
||||
-D${VAR} ${CMAKE_REQUIRED_DEFINITIONS}
|
||||
${CHECK_Fortran_SOURCE_COMPILES_ADD_LINK_OPTIONS}
|
||||
${CHECK_Fortran_SOURCE_COMPILES_ADD_LIBRARIES}
|
||||
CMAKE_FLAGS
|
||||
-DCOMPILE_DEFINITIONS:STRING=${CMAKE_REQUIRED_FLAGS}
|
||||
-DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
|
||||
"${CHECK_Fortran_SOURCE_COMPILES_ADD_INCLUDES}"
|
||||
COMPILE_OUTPUT_VARIABLE OUTPUT
|
||||
RUN_OUTPUT_VARIABLE RUN_OUTPUT)
|
||||
|
||||
# if it did not compile make the return value fail code of 1
|
||||
if(NOT ${VAR}_COMPILED)
|
||||
set(${VAR}_EXITCODE 1)
|
||||
endif()
|
||||
# if the return value was 0 then it worked
|
||||
if("${${VAR}_EXITCODE}" EQUAL 0)
|
||||
set(${VAR}
|
||||
1
|
||||
CACHE INTERNAL "Test ${VAR}")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(CHECK_PASS "Success")
|
||||
endif()
|
||||
file(
|
||||
APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Performing Fortran SOURCE FILE Test ${VAR} succeeded with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
"...and run output:\n"
|
||||
"${RUN_OUTPUT}\n"
|
||||
"Return value: ${${VAR}}\n"
|
||||
"Source file was:\n${SOURCE}\n")
|
||||
else()
|
||||
if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
|
||||
set(${VAR} "${${VAR}_EXITCODE}")
|
||||
else()
|
||||
set(${VAR}
|
||||
""
|
||||
CACHE INTERNAL "Test ${VAR}")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(CHECK_FAIL "Failed")
|
||||
endif()
|
||||
file(
|
||||
APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Performing Fortran SOURCE FILE Test ${VAR} failed with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
"...and run output:\n"
|
||||
"${RUN_OUTPUT}\n"
|
||||
"Return value: ${${VAR}_EXITCODE}\n"
|
||||
"Source file was:\n${SOURCE}\n")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
|
@ -1,13 +1,12 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
||||
set(CP2K_C_COMPILER_LIST
|
||||
"GNU;Intel;IntelLLVM;NAG;Cray;PGI;NVHPC;Clang;AppleClang")
|
||||
set(CP2K_Fortran_COMPILER_LIST "GNU;Intel;IntelLLVM;NAG;Cray;PGI;NVHPC")
|
||||
set(CP2K_C_COMPILER_LIST "GNU;Intel;NAG;Cray;PGI;Clang;AppleClang")
|
||||
set(CP2K_Fortran_COMPILER_LIST "GNU;Intel;NAG;Cray;PGI")
|
||||
|
||||
if(NOT CMAKE_C_COMPILER_ID IN_LIST CP2K_C_COMPILER_LIST)
|
||||
message(
|
||||
|
|
@ -32,154 +31,27 @@ if(NOT CMAKE_Fortran_COMPILER_ID IN_LIST CP2K_Fortran_COMPILER_LIST)
|
|||
"-- CMAKE_Fortran_COMPILER full path: ${CMAKE_Fortran_COMPILER}\n")
|
||||
endif()
|
||||
|
||||
# ================================ GNU Compilers ===============================
|
||||
|
||||
# Baseline
|
||||
# OpenACC support with CCE is EOL: causes
|
||||
# https://github.com/cp2k/dbcsr/issues/261 eventually check compiler version
|
||||
# (similar to -h system_alloc)
|
||||
add_compile_options(
|
||||
"$<$<COMPILE_LANG_AND_ID:Fortran,GNU>:-std=f2008;-ffree-form;-fimplicit-none>"
|
||||
"$<$<COMPILE_LANG_AND_ID:Fortran,GNU>:-g;-fno-omit-frame-pointer;-fbacktrace>"
|
||||
"$<$<COMPILE_LANG_AND_ID:Fortran,GNU>:$<$<VERSION_GREATER:$<Fortran_COMPILER_VERSION>,10>:-fallow-argument-mismatch>>"
|
||||
"$<$<COMPILE_LANG_AND_ID:Fortran,GNU>:-Wno-deprecated-declarations;-Wno-maybe-uninitialized;-Wuninitialized;-Wuse-without-only>"
|
||||
)
|
||||
add_compile_options(
|
||||
"$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-g;-fno-omit-frame-pointer>"
|
||||
"$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wno-deprecated-declarations;-Wno-vla-parameter>"
|
||||
)
|
||||
add_compile_options(
|
||||
"$<$<COMPILE_LANG_AND_ID:C,GNU>:-g;-fno-omit-frame-pointer>"
|
||||
"$<$<COMPILE_LANG_AND_ID:C,GNU>:-Wno-deprecated-declarations;-Wno-vla-parameter>"
|
||||
"$<$<COMPILE_LANG_AND_ID:Fortran,GNU>:-mtune=native;-ffree-line-length-512;-ffree-form;-std=f2008;-fimplicit-none;-Werror=aliasing;-Werror=ampersand;-Werror=c-binding-type;-Werror=conversion;-Werror=intrinsic-shadow;-Werror=intrinsics-std;-Werror=line-truncation;-Werror=tabs;-Werror=target-lifetime;-Werror=underflow;-Werror=unused-but-set-variable;-Werror=unused-variable>"
|
||||
"$<$<AND:$<COMPILE_LANG_AND_ID:Fortran,GNU>,$<VERSION_GREATER_EQUAL:${CMAKE_Fortran_COMPILER_VERSION},11>>:-fallow-argument-mismatch>"
|
||||
"$<$<COMPILE_LANG_AND_ID:Fortran,Intel>:-free -stand=f18 -fpp -heap-arrays>"
|
||||
"$<$<COMPILE_LANG_AND_ID:Fortran,PGI>:-Mfreeform -Mextend -Mallocatable=03>"
|
||||
"$<$<COMPILE_LANG_AND_ID:Fortran,NAG>:-f2008 -free -Warn=reallocation -Warn=subnormal>"
|
||||
"$<$<COMPILE_LANG_AND_ID:C,Cray>:-hnoacc -h nomessage=1234>"
|
||||
"$<$<COMPILE_LANG_AND_ID:Fortran,Cray>:-f free -M3105 -ME7212 -hnoacc -M1234>"
|
||||
)
|
||||
|
||||
# -- Apple Silicon + GCC: -march=native expands internally to -march=apple-m1
|
||||
# (invalid). Use -mcpu=native instead.
|
||||
set(_CP2K_GNU_NATIVE_TUNE "-march=native;-mtune=native")
|
||||
if(APPLE
|
||||
AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64"
|
||||
AND (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU"
|
||||
OR CMAKE_C_COMPILER_ID STREQUAL "GNU"
|
||||
OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
|
||||
set(_CP2K_GNU_NATIVE_TUNE "-mcpu=native")
|
||||
endif()
|
||||
if(APPLE)
|
||||
add_definitions(-D__MACOSX)
|
||||
endif()
|
||||
if(APPLE OR BSD)
|
||||
add_definitions(-D__NO_STATM_ACCESS)
|
||||
endif()
|
||||
|
||||
# Release
|
||||
add_compile_options(
|
||||
"$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-O3;${_CP2K_GNU_NATIVE_TUNE};-funroll-loops>"
|
||||
"$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:CXX,GNU>>:-O3;${_CP2K_GNU_NATIVE_TUNE};-funroll-loops>"
|
||||
"$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:C,GNU>>:-O3;${_CP2K_GNU_NATIVE_TUNE};-funroll-loops>"
|
||||
)
|
||||
|
||||
# Generic
|
||||
add_compile_options(
|
||||
"$<$<AND:$<CONFIG:GENERIC>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-O3;-mtune=generic;-funroll-loops>"
|
||||
"$<$<AND:$<CONFIG:GENERIC>,$<COMPILE_LANG_AND_ID:CXX,GNU>>:-O3;-mtune=generic;-funroll-loops>"
|
||||
"$<$<AND:$<CONFIG:GENERIC>,$<COMPILE_LANG_AND_ID:C,GNU>>:-O3;-mtune=generic;-funroll-loops>"
|
||||
)
|
||||
|
||||
# Debug
|
||||
|
||||
# TODO: Replace deprecated MASTER constructs with MASKED (only available since
|
||||
# GCC 12) and remove "-Wno-error=deprecated-openmp" once GCC 11 support is
|
||||
# dropped.
|
||||
add_compile_options(
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-O1;${_CP2K_GNU_NATIVE_TUNE}>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:CXX,GNU>>:-O1;${_CP2K_GNU_NATIVE_TUNE}>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:C,GNU>>:-O1;${_CP2K_GNU_NATIVE_TUNE};-Wall;-Wextra;-Werror>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:C,GNU>,$<VERSION_GREATER_EQUAL:$<C_COMPILER_VERSION>,16>>:-Wno-error=deprecated-openmp>"
|
||||
)
|
||||
# FIXME: GCC 16 diagnoses legacy character-length mismatches that were not
|
||||
# reported by earlier GCC versions. Restore "-Werror=character-truncation" after
|
||||
# auditing and resolving them.
|
||||
add_compile_options(
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-fsanitize=leak;-Werror=realloc-lhs>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-fcheck=all,no-array-temps;-finline-matmul-limit=0>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-ffpe-trap=invalid,zero,overflow>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-finit-derived;-finit-real=snan;-finit-integer=-42>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-Werror=aliasing;-Werror=ampersand;-Werror=c-binding-type>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-Werror=intrinsics-std;-Werror=intrinsic-shadow>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-Werror=line-truncation;-Werror=tabs;-Werror=target-lifetime>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-Werror=underflow;-Werror=unused-but-set-variable;-Werror=unused-variable>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-Werror=unused-dummy-argument;-Werror=unused-parameter>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-Werror=unused-label;-Werror=conversion;-Werror=zerotrip>"
|
||||
)
|
||||
add_compile_definitions("$<$<CONFIG:DEBUG>:__HAS_IEEE_EXCEPTIONS;__CHECK_DIAG>")
|
||||
add_link_options(
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-fsanitize=leak>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:CXX,GNU>>:-fsanitize=leak>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:C,GNU>>:-fsanitize=leak>")
|
||||
|
||||
# Conventions
|
||||
add_compile_options(
|
||||
"$<$<CONFIG:CONVENTIONS>:-O1;${_CP2K_GNU_NATIVE_TUNE}>"
|
||||
"$<$<AND:$<CONFIG:CONVENTIONS>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-Wno-pedantic;-Wall;-Wextra;-Wsurprising>"
|
||||
"$<$<AND:$<CONFIG:CONVENTIONS>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-Warray-temporaries;-Wconversion-extra;-Wimplicit-interface>"
|
||||
"$<$<AND:$<CONFIG:CONVENTIONS>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-Wimplicit-procedure;-Wreal-q-constant;-Walign-commons>"
|
||||
"$<$<AND:$<CONFIG:CONVENTIONS>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-Wfunction-elimination;-Wrealloc-lhs;-Wcompare-reals;-Wzerotrip>"
|
||||
# Writes a lot of output. Make sure to use:
|
||||
# -DCMAKE_Fortran_COMPILER_LAUNCHER="redirect_gfortran_output.py"
|
||||
"$<$<AND:$<CONFIG:CONVENTIONS>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-fdump-fortran-original>"
|
||||
)
|
||||
|
||||
# Coverage
|
||||
add_compile_options(
|
||||
"$<$<CONFIG:COVERAGE>:-coverage;-fkeep-static-functions;-O1;${_CP2K_GNU_NATIVE_TUNE}>"
|
||||
)
|
||||
add_compile_definitions("$<$<CONFIG:COVERAGE>:__NO_ABORT>")
|
||||
|
||||
# Address Sanitizer
|
||||
add_compile_options(
|
||||
"$<$<CONFIG:ASAN>:-fsanitize=address;-no-pie;-O3;${_CP2K_GNU_NATIVE_TUNE};-funroll-loops>"
|
||||
)
|
||||
add_link_options("$<$<CONFIG:ASAN>:-fsanitize=address>")
|
||||
|
||||
# =========================== Intel oneAPI Compilers ===========================
|
||||
|
||||
# Baseline
|
||||
add_compile_options(
|
||||
"$<$<COMPILE_LANG_AND_ID:Fortran,Intel,IntelLLVM>:-g;-traceback>"
|
||||
"$<$<COMPILE_LANG_AND_ID:Fortran,Intel>:-free;-stand;f08;-fpp;-qopenmp;-heap-arrays;-D__MAX_CONTR=4>"
|
||||
"$<$<COMPILE_LANG_AND_ID:Fortran,Intel>:-fp-model;consistent;-fpscomp;logicals>"
|
||||
"$<$<COMPILE_LANG_AND_ID:Fortran,IntelLLVM>:-free;-stand;f08;-fpp;-qopenmp;-D__MAX_CONTR=4>"
|
||||
"$<$<COMPILE_LANG_AND_ID:Fortran,IntelLLVM>:-fp-model;consistent;-fpscomp;logicals>"
|
||||
)
|
||||
|
||||
# Release
|
||||
add_compile_options(
|
||||
"$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:Fortran,IntelLLVM>>:-O3;-xHOST;-D__HAS_IEEE_EXCEPTIONS>"
|
||||
"$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:Fortran,Intel>>:-O2;-xHOST;-D__HAS_IEEE_EXCEPTIONS>"
|
||||
"$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:CXX,IntelLLVM>>:-O3;-xHOST>"
|
||||
"$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:C,IntelLLVM>>:-O3;-xHOST>")
|
||||
|
||||
# Debug
|
||||
add_compile_options(
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,IntelLLVM>>:-O0;-debug>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,Intel>>:-O0;-debug>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:CXX,IntelLLVM>>:-O0;-g>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:C,IntelLLVM>>:-O0;-g>")
|
||||
|
||||
# =============================== Other Compilers ==============================
|
||||
|
||||
# Baseline
|
||||
add_compile_options(
|
||||
"$<$<COMPILE_LANG_AND_ID:Fortran,PGI,NVHPC>:-Mfreeform;-Mextend;-Mallocatable=03>"
|
||||
"$<$<COMPILE_LANG_AND_ID:Fortran,NAG>:-f2008;-free;-Warn=reallocation;-Warn=subnormal>"
|
||||
"$<$<COMPILE_LANG_AND_ID:Fortran,Cray>:-f;free;-M3105;-ME7212;-hnoacc;-M1234>"
|
||||
)
|
||||
add_compile_options(
|
||||
"$<$<COMPILE_LANG_AND_ID:C,Cray>:-hnoacc;-h;nomessage=1234>")
|
||||
|
||||
# Release
|
||||
add_compile_options(
|
||||
"$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:Fortran,PGI,NVHPC>>:-fast>"
|
||||
"$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-O3;-g;-funroll-loops>"
|
||||
"$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:Fortran,PGI>>:-fast>"
|
||||
"$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:Fortran,Intel>>:-O3;-g>"
|
||||
"$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:Fortran,Cray>>:-O2;-G2>"
|
||||
"$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:Fortran,NAG>>:-gline>")
|
||||
add_compile_options(
|
||||
"$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:C,PGI,NVHPC>>:-fast>"
|
||||
"$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:Fortran,NAG>>:-gline>"
|
||||
"$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:C,GNU>>:-O3;-g;-funroll-loops;-Wall>"
|
||||
"$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:C,PGI>>:-fast>"
|
||||
"$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:C,Intel>>:-O3;-g>"
|
||||
"$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:C,Cray>>:-O3>"
|
||||
"$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:C,NAG>>:-gline>"
|
||||
|
|
@ -188,27 +60,31 @@ add_compile_options(
|
|||
"$<$<NOT:$<BOOL:OpenMP_FOUND>>:$<$<AND:$<CONFIG:RELEASE>,$<COMPILE_LANG_AND_ID:Fortran,NAG>>:-gline>>"
|
||||
)
|
||||
|
||||
# Debug
|
||||
add_compile_options(
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,PGI,NVHPC>>:-g>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,Cray>>:-G2>")
|
||||
add_compile_options(
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:C,PGI,NVHPC>>:-fast>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:C,Intel>>:-O2;-g>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-fbacktrace;-ffree-form;-fimplicit-none;-std=f2008;-fsanitize=leak;-fcheck=all,no-array-temps;-ffpe-trap=invalid,zero,overflow;-finit-derived;-finit-real=snan;-finit-integer=-42;-Werror=realloc-lhs;-finline-matmul-limit=0>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,PGI>>:-g>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,Intel>>:-O2;-debug>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,Cray>>:-G2>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:C,GNU>>:-O2;-ggdb;-Wall;-fsanitize=undefined;-fsanitize=address;-fsanitize-recover=all;-Wall;-Wextra;-Werror;-Wno-vla-parameter;-Wno-deprecated-declarations>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:C,PGI>>:-fast>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:C,Intel>>:-O3;-g>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:C,Cray>>:-G2>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:C,NAG>>:-g;-C>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:C,Clang>>:-O1;-g;-fno-omit-frame-pointer>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:C,AppleClang>>:-O0;-g>"
|
||||
"$<$<AND:$<CONFIG:DEBUG>,$<COMPILE_LANG_AND_ID:Fortran,NAG>>:-C=all>")
|
||||
|
||||
# =================================== Tweaks ===================================
|
||||
# Workaround https://gitlab.kitware.com/cmake/cmake/-/issues/27231
|
||||
if(TARGET MPI::MPI_Fortran)
|
||||
get_target_property(opts MPI::MPI_Fortran INTERFACE_COMPILE_OPTIONS)
|
||||
set_target_properties(
|
||||
MPI::MPI_Fortran PROPERTIES INTERFACE_COMPILE_OPTIONS
|
||||
"$<$<COMPILE_LANGUAGE:Fortran>:${opts}>")
|
||||
unset(opts)
|
||||
add_compile_options(
|
||||
"$<$<AND:$<CONFIG:COVERAGE>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-O0;-g;--coverage;-fno-omit-frame-pointer;-fcheck=all;-ffpe-trap=invalid,zero,overflow;-fbacktrace;-finit-real=snan;-finit-integer=-42;-finit-derived;-Werror=realloc-lhs;-finline-matmul-limit=0>"
|
||||
"$<$<AND:$<CONFIG:COVERAGE>,$<COMPILE_LANG_AND_ID:C,GNU>>:-O0;-g;--coverage;-Wall>"
|
||||
)
|
||||
|
||||
if(NOT CP2K_USE_MPI OR NOT "${MPI_Fortran_LIBRARY_VERSION_STRING}" MATCHES "Open
|
||||
MPI")
|
||||
add_compile_options(
|
||||
"$<$<AND:$<CONFIG:COVERAGE>,$<COMPILE_LANG_AND_ID:Fortran,GNU>>:-fsanitize=leak>"
|
||||
"$<$<AND:$<CONFIG:COVERAGE>,$<COMPILE_LANG_AND_ID:C,GNU>>:-O0;-g;--coverage;-Wall>"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
|
||||
|
|
@ -232,10 +108,3 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Cray" AND CMAKE_C_COMPILER_VERSION
|
|||
list(FILTER CMAKE_C_IMPLICIT_LINK_LIBRARIES EXCLUDE REGEX "tcmalloc")
|
||||
list(FILTER CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES EXCLUDE REGEX "tcmalloc")
|
||||
endif()
|
||||
|
||||
# Suppress GFortran runtime warnings when LIBXS provides the wrapper
|
||||
if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU"
|
||||
AND CP2K_USE_LIBXS
|
||||
AND NOT APPLE)
|
||||
add_link_options("-Wl,--wrap=_gfortran_runtime_warning_at")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
|
|
|||
|
|
@ -1,44 +0,0 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
||||
if(NOT DEFINED OUTPUT_FILE)
|
||||
message(FATAL_ERROR "OUTPUT_FILE is not defined")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED SOURCE_DIR)
|
||||
set(SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/..")
|
||||
endif()
|
||||
|
||||
string(TIMESTAMP CP2K_BUILD_TIMESTAMP "%Y-%m-%d %H:%M:%S")
|
||||
|
||||
# Get the latest abbreviated commit hash of the working branch. As a fall back,
|
||||
# e.g. in a container without a .git directory, try reading a file named
|
||||
# "REVISION". Running this here (rather than once at configure time) means a new
|
||||
# commit is picked up on the next build, without having to re-run cmake.
|
||||
execute_process(
|
||||
COMMAND bash -c "git log -1 --format=%h || cat REVISION"
|
||||
WORKING_DIRECTORY "${SOURCE_DIR}"
|
||||
ERROR_QUIET
|
||||
OUTPUT_VARIABLE CP2K_GIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT CP2K_GIT_HASH)
|
||||
set(CP2K_GIT_HASH "unknown")
|
||||
endif()
|
||||
|
||||
set(CP2K_BUILD_INFO_CONTENT
|
||||
"#define __COMPILE_DATE \"${CP2K_BUILD_TIMESTAMP}\"\n#define __COMPILE_REVISION \"${CP2K_GIT_HASH}\"\n"
|
||||
)
|
||||
|
||||
if(EXISTS "${OUTPUT_FILE}")
|
||||
file(READ "${OUTPUT_FILE}" CP2K_OLD_BUILD_INFO_CONTENT)
|
||||
else()
|
||||
set(CP2K_OLD_BUILD_INFO_CONTENT "")
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_BUILD_INFO_CONTENT STREQUAL CP2K_OLD_BUILD_INFO_CONTENT)
|
||||
file(WRITE "${OUTPUT_FILE}" "${CP2K_BUILD_INFO_CONTENT}")
|
||||
endif()
|
||||
30
cmake/GitSubmodule.cmake
Normal file
30
cmake/GitSubmodule.cmake
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
||||
# Call to ensure that the git submodule in location `path` is loaded. If the
|
||||
# submodule is not loaded, an error message that describes how to update the
|
||||
# submodules is printed. Sets the variable name_avail to `ON` if the submodule
|
||||
# is available, or `OFF` otherwise. copyright github.com/arbor-sim
|
||||
|
||||
function(check_git_submodule name path)
|
||||
set(success_var "${name}_avail")
|
||||
set(${success_var}
|
||||
ON
|
||||
PARENT_SCOPE)
|
||||
|
||||
get_filename_component(dotgit "${path}/.git" ABSOLUTE)
|
||||
if(NOT EXISTS ${dotgit})
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"\nThe git submodule for ${name} is not available.\n"
|
||||
"To check out all submodules use the following commands:\n"
|
||||
" git submodule init\n"
|
||||
" git submodule update\n"
|
||||
"Or download submodules recursively when checking out:\n"
|
||||
" git clone --recursive https://github.com/cp2k/cp2k.git\n")
|
||||
endif()
|
||||
endfunction()
|
||||
|
|
@ -1,217 +1,128 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS "3.24")
|
||||
message(FATAL_ERROR "CP2K requires CMake 3.24 or newer.")
|
||||
endif()
|
||||
|
||||
cmake_minimum_required(VERSION 3.22)
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
if(NOT TARGET cp2k::cp2k)
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/modules"
|
||||
${CMAKE_MODULE_PATH})
|
||||
|
||||
# Store CXX compiler id used in MKL package
|
||||
# store CXX compiler id. Used in MKL package.
|
||||
set(CP2K_CXX_COMPILER_ID @CMAKE_CXX_COMPILER_ID@)
|
||||
if(NOT CMAKE_CXX_COMPILER_ID)
|
||||
if(NOT ${CMAKE_CXX_COMPILER_ID})
|
||||
set(CMAKE_CXX_COMPILER_ID ${CP2K_CXX_COMPILER_ID})
|
||||
endif()
|
||||
|
||||
# Define LAPACK and BLAS TARGETS
|
||||
set(CP2K_BLAS_VENDOR @CP2K_BLAS_VENDOR@)
|
||||
set(CP2K_SCALAPACK_VENDOR @CP2K_SCALAPACK_VENDOR@)
|
||||
set(CP2K_BLAS_LINK_LIBRARIES @CP2K_BLAS_LINK_LIBRARIES@)
|
||||
set(CP2K_LAPACK_LINK_LIBRARIES @CP2K_LAPACK_LINK_LIBRARIES@)
|
||||
set(CP2K_SCALAPACK_LINK_LIBRARIES @CP2K_SCALAPACK_LINK_LIBRARIES@)
|
||||
set(CP2K_USE_FFTW3_WITH_MKL @CP2K_USE_FFTW3_WITH_MKL@)
|
||||
set(CP2K_CONFIG_PACKAGE ON)
|
||||
find_dependency(Lapack REQUIRED)
|
||||
|
||||
set(CP2K_USE_MPI @CP2K_USE_MPI@)
|
||||
if(CP2K_USE_MPI)
|
||||
find_dependency(MPI REQUIRED)
|
||||
# define lapack and blas TARGETS
|
||||
|
||||
if(@CP2K_USE_MPI@)
|
||||
find_dependency(SCALAPACK REQUIRED)
|
||||
endif()
|
||||
unset(CP2K_CONFIG_PACKAGE)
|
||||
|
||||
set(cp2k_VERSION @cp2k_VERSION@)
|
||||
|
||||
find_dependency(DBCSR 2.8 REQUIRED)
|
||||
find_dependency(DBCSR 2.5 REQUIRED)
|
||||
|
||||
set(CP2K_USE_LIBXS @CP2K_USE_LIBXS@)
|
||||
set(CP2K_USE_LIBXSMM @CP2K_USE_LIBXSMM@)
|
||||
if(CP2K_USE_LIBXS)
|
||||
find_dependency(libxs REQUIRED)
|
||||
if(CP2K_USE_LIBXSMM)
|
||||
find_dependency(libxsmm REQUIRED)
|
||||
endif()
|
||||
if(@CP2K_USE_LIBXSMM@)
|
||||
find_dependency(LibXSMM REQUIRED)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_OPENCL @CP2K_USE_OPENCL@)
|
||||
if(CP2K_USE_OPENCL)
|
||||
find_dependency(OpenCL REQUIRED)
|
||||
find_dependency(libxstream REQUIRED)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_HIP @CP2K_USE_HIP@)
|
||||
if(CP2K_USE_HIP)
|
||||
# Find HIP
|
||||
if(@CP2K_USE_HIP@)
|
||||
# Find hip
|
||||
find_dependency(hipfft REQUIRED IMPORTED CONFIG)
|
||||
find_dependency(hipblas REQUIRED IMPORTED CONFIG)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_CUDA @CP2K_USE_CUDA@)
|
||||
if(CP2K_USE_CUDA)
|
||||
if(@CP2K_USE_CUDA@)
|
||||
find_dependency(CUDAToolkit REQUIRED)
|
||||
endif()
|
||||
set(CP2K_USE_ELPA @CP2K_USE_ELPA@)
|
||||
if(CP2K_USE_ELPA)
|
||||
if(@CP2K_USE_ELPA@)
|
||||
find_dependency(Elpa REQUIRED)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_DLAF @CP2K_USE_DLAF@)
|
||||
if(CP2K_USE_DLAF)
|
||||
find_dependency(DLAFFortran 0.4.0 REQUIRED)
|
||||
if(@CP2K_USE_DLAF@)
|
||||
find_dependency(DLAF REQUIRED)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_LIBXC @CP2K_USE_LIBXC@)
|
||||
if(CP2K_USE_LIBXC)
|
||||
find_dependency(Libxc 7 REQUIRED CONFIG)
|
||||
if(@CP2K_USE_LIBXC@)
|
||||
find_dependency(LibXC 6 REQUIRED EXACT)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_GAUXC @CP2K_USE_GAUXC@)
|
||||
if(CP2K_USE_GAUXC)
|
||||
find_dependency(gauxc REQUIRED CONFIG)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_COSMA @CP2K_USE_COSMA@)
|
||||
if(CP2K_USE_COSMA)
|
||||
if(@CP2K_USE_COSMA@)
|
||||
find_dependency(cosma REQUIRED)
|
||||
if(NOT TARGET cp2k::cosma)
|
||||
add_library(cp2k::cosma INTERFACE IMPORTED)
|
||||
target_link_libraries(cp2k::cosma INTERFACE cosma::cosma_prefixed_pxgemm
|
||||
cosma::cosma)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_FFTW3 @CP2K_USE_FFTW3@)
|
||||
if(CP2K_USE_FFTW3)
|
||||
if(@CP2K_USE_MPI@)
|
||||
find_dependency(MPI REQUIRED)
|
||||
endif()
|
||||
|
||||
if(@CP2K_USE_FFTW3_@)
|
||||
find_dependency(Fftw REQUIRED)
|
||||
endif()
|
||||
# QUIP
|
||||
if(@CP2K_USE_QUIP@)
|
||||
find_dependency(Quip REQUIRED)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_LIBINT2 @CP2K_USE_LIBINT2@)
|
||||
if(CP2K_USE_LIBINT2)
|
||||
# libint
|
||||
|
||||
if(@CP2K_USE_LIBINT2@)
|
||||
find_dependency(Libint2 REQUIRED)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_LIBFCI @CP2K_USE_LIBFCI@)
|
||||
if(CP2K_USE_LIBFCI)
|
||||
find_dependency(libfci REQUIRED)
|
||||
# spglib
|
||||
|
||||
if(@CP2K_USE_SPGLIB@)
|
||||
find_dependency(LibSPG REQUIRED)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_SPGLIB @CP2K_USE_SPGLIB@)
|
||||
if(CP2K_USE_SPGLIB)
|
||||
find_dependency(Spglib REQUIRED CONFIG)
|
||||
if(@CP2K_USE_SPLA@)
|
||||
find_dependency(SPLA REQUIRED)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_SPLA @CP2K_USE_SPLA@)
|
||||
if(CP2K_USE_SPLA)
|
||||
find_dependency(SPLA REQUIRED CONFIG)
|
||||
if(@CP2K_USE_SIRIUS@)
|
||||
find_dependency(sirius REQUIRED)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_SIRIUS @CP2K_USE_SIRIUS@)
|
||||
if(CP2K_USE_SIRIUS)
|
||||
find_dependency(sirius 7.7.0 REQUIRED)
|
||||
if(@CP2K_USE_SUPERLU@)
|
||||
find_dependency(SuperLU REQUIRED)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_PLUMED @CP2K_USE_PLUMED@)
|
||||
if(CP2K_USE_PLUMED)
|
||||
if(@CP2K_USE_METIS@)
|
||||
find_dependency(Metis)
|
||||
endif()
|
||||
|
||||
if(@CP2K_USE_PEXSI@)
|
||||
# PEXSI 1.2 uses cmake as build system
|
||||
find_dependency(PEXSI REQUIRED)
|
||||
endif()
|
||||
|
||||
if(@CP2K_USE_PLUMED@)
|
||||
find_dependency(Plumed REQUIRED)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_LIBTORCH @CP2K_USE_LIBTORCH@)
|
||||
if(CP2K_USE_LIBTORCH)
|
||||
if(@CP2K_USE_LIBTORCH@)
|
||||
find_dependency(Torch REQUIRED)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_HDF5 @CP2K_USE_HDF5@)
|
||||
if(CP2K_USE_HDF5)
|
||||
find_dependency(HDF5 REQUIRED COMPONENTS C Fortran)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_DFTD4 @CP2K_USE_DFTD4@)
|
||||
if(CP2K_USE_DFTD4)
|
||||
find_dependency(dftd4 REQUIRED)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_DEEPMD @CP2K_USE_DEEPMD@)
|
||||
if(CP2K_USE_DEEPMD)
|
||||
find_dependency(DeePMD REQUIRED CONFIG)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_PEXSI @CP2K_USE_PEXSI@)
|
||||
if(CP2K_USE_PEXSI)
|
||||
find_dependency(PEXSI REQUIRED CONFIG)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_ACE @CP2K_USE_ACE@)
|
||||
if(CP2K_USE_ACE)
|
||||
find_dependency(pace REQUIRED)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_LIBSMEAGOL @CP2K_USE_LIBSMEAGOL@)
|
||||
if(CP2K_USE_LIBSMEAGOL)
|
||||
find_dependency(libsmeagol REQUIRED)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_MIMIC @CP2K_USE_MIMIC@)
|
||||
if(CP2K_USE_MIMIC)
|
||||
find_dependency(MiMiC REQUIRED)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_OPENPMD @CP2K_USE_OPENPMD@)
|
||||
if(CP2K_USE_OPENPMD)
|
||||
find_dependency(openPMD 0.16.1 REQUIRED)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_VORI @CP2K_USE_VORI@)
|
||||
if(CP2K_USE_VORI)
|
||||
find_dependency(LibVORI REQUIRED)
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_GREENX @CP2K_USE_GREENX@)
|
||||
if(CP2K_USE_GREENX)
|
||||
find_dependency(greenX REQUIRED CONFIG)
|
||||
if(NOT TARGET cp2k::greenx)
|
||||
add_library(cp2k::greenx INTERFACE IMPORTED)
|
||||
target_link_libraries(cp2k::greenx INTERFACE greenX::GXCommon
|
||||
greenX::LibGXAC
|
||||
greenX::LibGXMiniMax)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_TBLITE @CP2K_USE_TBLITE@)
|
||||
if(CP2K_USE_TBLITE)
|
||||
find_dependency(tblite REQUIRED)
|
||||
if(NOT TARGET cp2k::tblite)
|
||||
add_library(cp2k::tblite INTERFACE IMPORTED)
|
||||
target_link_libraries(
|
||||
cp2k::tblite INTERFACE tblite::tblite mctc-lib::mctc-lib dftd4::dftd4
|
||||
toml-f::toml-f s-dftd3::s-dftd3)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CP2K_USE_TREXIO @CP2K_USE_TREXIO@)
|
||||
if(CP2K_USE_TREXIO)
|
||||
find_dependency(TrexIO REQUIRED)
|
||||
endif()
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/cp2kTargets.cmake")
|
||||
|
||||
# Clean-up module path
|
||||
# Clean-up module path.
|
||||
list(REMOVE_ITEM CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/modules")
|
||||
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
|
@ -20,10 +20,25 @@ else()
|
|||
message(STATUS "FYPP preprocessor found.")
|
||||
endif()
|
||||
|
||||
# https://gitlab.kitware.com/cmake/cmake/issues/18188
|
||||
if((CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") AND (CMAKE_VERSION
|
||||
VERSION_GREATER_EQUAL 3.16))
|
||||
if((CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
|
||||
AND (CMAKE_GENERATOR STREQUAL "Ninja")
|
||||
AND (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16))
|
||||
set(fypp_flags --line-numbering --line-marker-format=gfortran5)
|
||||
elseif(CMAKE_BUILD_TYPE MATCHES COVERAGE)
|
||||
message(
|
||||
WARNING
|
||||
"Coverage build requested but your environment does not support Line Control directives in Fypp"
|
||||
)
|
||||
message(
|
||||
WARNING
|
||||
"You need CMake 3.16+, Ninja (CMake-patched) and gfortran 5+ for this to work!"
|
||||
)
|
||||
# otherwise the referenced lines in the Coverage report point to either the
|
||||
# original (unexpanded files) or to the Fypped sources which may then not be
|
||||
# picked up by the postprocessing tools. CMake 3.16+ and Ninja are needed
|
||||
# since older CMake (or CMake with make) are unable to parse Line Control
|
||||
# directives within line-continued USE stmts, see
|
||||
# https://gitlab.kitware.com/cmake/cmake/issues/18188
|
||||
endif()
|
||||
|
||||
function(ADD_FYPP_SOURCES OUTVAR)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
|
@ -53,7 +53,7 @@ find_package_handle_standard_args(
|
|||
CP2K_ARMPL_ILP64_MP_LINK_LIBRARIES)
|
||||
|
||||
# add target to link against
|
||||
if(NOT TARGET cp2k::BLAS::Armpl::armpl)
|
||||
if(NOT TARGET Armpl::armpl)
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
|
@ -15,13 +15,13 @@ include(cp2k_utils)
|
|||
cp2k_set_default_paths(ATLAS "Atlas")
|
||||
|
||||
cp2k_find_libraries(ATLAS "atlas")
|
||||
cp2k_include_dirs(ATLAS "cblas.h atlas/cblas.h")
|
||||
cp2k_include_dirs(FFTW3 "cblas.h atlas/cblas.h")
|
||||
# check if found
|
||||
find_package_handle_standard_args(Atlas REQUIRED_VARS CP2K_ATLAS_INCLUDE_DIRS
|
||||
CP2K_ATLAS_LINK_LIBRARIES)
|
||||
|
||||
# add target to link against
|
||||
if(CP2K_ATLAS_FOUND)
|
||||
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)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
|
@ -9,6 +9,13 @@
|
|||
#
|
||||
# authors : Mathieu Taillefumier
|
||||
|
||||
if(NOT
|
||||
(CMAKE_C_COMPILER_LOADED
|
||||
OR CMAKE_CXX_COMPILER_LOADED
|
||||
OR CMAKE_Fortran_COMPILER_LOADED))
|
||||
message(FATAL_ERROR "FindBLAS requires Fortran, C, or C++ to be enabled.")
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_CONFIG_PACKAGE)
|
||||
set(CP2K_BLAS_VENDOR_LIST
|
||||
# cmake-format: sortable
|
||||
|
|
@ -27,6 +34,8 @@ if(NOT CP2K_CONFIG_PACKAGE)
|
|||
list(REMOVE_ITEM __BLAS_VENDOR_LIST "auto")
|
||||
list(REMOVE_ITEM __BLAS_VENDOR_LIST "CUSTOM")
|
||||
|
||||
# set(CP2K_BLAS_VENDOR "auto" CACHE STRING "Blas library for computations on
|
||||
# host")
|
||||
set_property(CACHE CP2K_BLAS_VENDOR PROPERTY STRINGS ${CP2K_BLAS_VENDOR_LIST})
|
||||
|
||||
if(NOT ${CP2K_BLAS_VENDOR} IN_LIST CP2K_BLAS_VENDOR_LIST)
|
||||
|
|
@ -37,16 +46,8 @@ if(NOT CP2K_CONFIG_PACKAGE)
|
|||
# cmake-format: sortable
|
||||
"sequential" "thread" "gnu-thread" "intel-thread" "tbb-thread" "openmp")
|
||||
|
||||
if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL
|
||||
"GNU")
|
||||
set(_cp2k_blas_threading_default "gnu-thread")
|
||||
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel|IntelLLVM")
|
||||
set(_cp2k_blas_threading_default "intel-thread")
|
||||
else()
|
||||
set(_cp2k_blas_threading_default "openmp")
|
||||
endif()
|
||||
set(CP2K_BLAS_THREADING
|
||||
"${_cp2k_blas_threading_default}"
|
||||
"sequential"
|
||||
CACHE STRING "threaded blas library")
|
||||
set_property(CACHE CP2K_BLAS_THREADING PROPERTY STRINGS
|
||||
${CP2K_BLAS_THREAD_LIST})
|
||||
|
|
@ -124,16 +125,12 @@ else()
|
|||
set(CP2K_BLAS_FOUND ON)
|
||||
endif()
|
||||
|
||||
# cleanup list (regularly contains empty items)
|
||||
list(FILTER CP2K_BLAS_LINK_LIBRARIES EXCLUDE REGEX "^$")
|
||||
|
||||
# we exclude the CP2K_BLAS_INCLUDE_DIRS from the list of mandatory variables as
|
||||
# having the fortran interface is usually enough. C, C++ and others languages
|
||||
# might require this information though
|
||||
|
||||
find_package_handle_standard_args(
|
||||
${CMAKE_FIND_PACKAGE_NAME} REQUIRED_VARS CP2K_BLAS_LINK_LIBRARIES
|
||||
CP2K_BLAS_VENDOR CP2K_BLAS_FOUND)
|
||||
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)
|
||||
|
|
@ -142,17 +139,6 @@ endif()
|
|||
set_target_properties(cp2k::BLAS::blas PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
"${CP2K_BLAS_LINK_LIBRARIES}")
|
||||
|
||||
# Compatibility: many external packages expect BLAS::BLAS
|
||||
if(NOT TARGET BLAS::BLAS)
|
||||
add_library(BLAS::BLAS INTERFACE IMPORTED)
|
||||
set_property(TARGET BLAS::BLAS PROPERTY INTERFACE_LINK_LIBRARIES
|
||||
"${CP2K_BLAS_LINK_LIBRARIES}")
|
||||
if(CP2K_BLAS_INCLUDE_DIRS)
|
||||
set_property(TARGET BLAS::BLAS PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CP2K_BLAS_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CP2K_BLAS_INCLUDE_DIRS)
|
||||
set_target_properties(
|
||||
cp2k::BLAS::blas PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
|
|
@ -163,4 +149,3 @@ mark_as_advanced(CP2K_BLAS_INCLUDE_DIRS)
|
|||
mark_as_advanced(CP2K_BLAS_LINK_LIBRARIES)
|
||||
mark_as_advanced(CP2K_BLAS_VENDOR)
|
||||
mark_as_advanced(CP2K_BLAS_FOUND)
|
||||
mark_as_advanced(CP2K_BLAS_VENDOR_LIST)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
|
@ -16,7 +16,7 @@ include(cp2k_utils)
|
|||
cp2k_set_default_paths(BLIS "BLIS")
|
||||
|
||||
if(DEFINED AOCL_ROOT)
|
||||
list(APPEND CP2K_BLIS_ROOT "${AOCL_ROOT}" "$ENV{AOCL_ROOT}")
|
||||
list(CP2K_BLIS_ROOT "${AOCL_ROOT}" "$ENV{AOCL_ROOT}")
|
||||
endif()
|
||||
|
||||
# one day blis will have a pkg-config file
|
||||
|
|
@ -46,7 +46,7 @@ endif()
|
|||
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)
|
||||
add_library(cp2k::BLAS::Blis::blas alias cp2k::BLAS::Blis::blis)
|
||||
endif()
|
||||
|
||||
set_property(TARGET cp2k::BLAS::Blis::blis
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
|
@ -12,20 +12,16 @@
|
|||
include(FindPackageHandleStandardArgs)
|
||||
include(cp2k_utils)
|
||||
|
||||
cp2k_set_default_paths(CAL "Cal")
|
||||
cp2k_set_default_paths(LIBCAL "Cal")
|
||||
|
||||
cp2k_find_libraries(CAL "cal")
|
||||
cp2k_include_dirs(CAL "cal.h")
|
||||
cp2k_find_libraries(LIBCAL "cal")
|
||||
cp2k_include_dirs(LIBCAL "cal.h")
|
||||
|
||||
find_package_handle_standard_args(Cal DEFAULT_MSG CP2K_CAL_LINK_LIBRARIES
|
||||
CP2K_CAL_INCLUDE_DIRS)
|
||||
|
||||
if(NOT CP2K_CAL_FOUND)
|
||||
message(FATAL_ERROR "Cal required by CuSolverMP")
|
||||
endif()
|
||||
|
||||
if(NOT TARGET cp2k::CAL::cal)
|
||||
add_library(cp2k::CAL::cal INTERFACE IMPORTED)
|
||||
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
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
|
@ -12,65 +12,21 @@
|
|||
include(FindPackageHandleStandardArgs)
|
||||
include(cp2k_utils)
|
||||
|
||||
find_package(ucc REQUIRED)
|
||||
|
||||
# First, find CuSolverMP library and headers
|
||||
find_package(Cal Required)
|
||||
cp2k_set_default_paths(CUSOLVER_MP "CUSOLVER_MP")
|
||||
cp2k_find_libraries(CUSOLVER_MP "cusolverMp")
|
||||
cp2k_include_dirs(CUSOLVER_MP "cusolverMp.h")
|
||||
|
||||
# CuSolverMP 0.7+ uses NCCL for communication, older versions use Cal. We need
|
||||
# to detect the version to require the correct communication library.
|
||||
if(CP2K_CUSOLVER_MP_INCLUDE_DIRS)
|
||||
file(STRINGS "${CP2K_CUSOLVER_MP_INCLUDE_DIRS}/cusolverMp.h" _ver_major_line
|
||||
REGEX "^#define CUSOLVERMP_VER_MAJOR")
|
||||
file(STRINGS "${CP2K_CUSOLVER_MP_INCLUDE_DIRS}/cusolverMp.h" _ver_minor_line
|
||||
REGEX "^#define CUSOLVERMP_VER_MINOR")
|
||||
|
||||
string(REGEX MATCH "[0-9]+" _ver_major "${_ver_major_line}")
|
||||
string(REGEX MATCH "[0-9]+" _ver_minor "${_ver_minor_line}")
|
||||
|
||||
if(_ver_major STREQUAL "" OR _ver_minor STREQUAL "")
|
||||
message(FATAL_ERROR "Could not determine CuSolverMP version from header")
|
||||
endif()
|
||||
|
||||
message(STATUS "Found CuSolverMP version: ${_ver_major}.${_ver_minor}")
|
||||
|
||||
# CuSolverMP 0.7+ uses NCCL, older versions use Cal
|
||||
if(_ver_major GREATER 0 OR _ver_minor GREATER_EQUAL 7)
|
||||
find_package(Nccl REQUIRED)
|
||||
set(CP2K_CUSOLVERMP_USE_NCCL
|
||||
ON
|
||||
CACHE BOOL "CuSolverMP uses NCCL for communication")
|
||||
else()
|
||||
find_package(Cal REQUIRED)
|
||||
set(CP2K_CUSOLVERMP_USE_NCCL
|
||||
OFF
|
||||
CACHE BOOL "CuSolverMP uses Cal for communication")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(
|
||||
CuSolverMP DEFAULT_MSG CP2K_CUSOLVER_MP_LINK_LIBRARIES
|
||||
CP2K_CUSOLVER_MP_INCLUDE_DIRS)
|
||||
|
||||
if(NOT CP2K_CUSOLVER_MP_FOUND)
|
||||
message(FATAL_ERROR "CuSolverMP requested, but not found")
|
||||
endif()
|
||||
|
||||
if(NOT TARGET cp2k::CUSOLVER_MP::cusolver_mp)
|
||||
if(CP2K_CUSOLVER_MP_FOUND AND NOT TARGET cp2k::CUSOLVER_MP::cusolver_mp)
|
||||
add_library(cp2k::CUSOLVER_MP::cusolver_mp INTERFACE IMPORTED)
|
||||
|
||||
if(CP2K_CUSOLVERMP_USE_NCCL)
|
||||
set(_comm_lib "cp2k::NCCL::nccl")
|
||||
else()
|
||||
set(_comm_lib "cp2k::CAL::cal")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
cp2k::CUSOLVER_MP::cusolver_mp
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
"${CP2K_CUSOLVER_MP_LINK_LIBRARIES};${_comm_lib};cp2k::UCC::ucc")
|
||||
"${CP2K_CUSOLVER_MP_LINK_LIBRARIES};cp2k::CAL::cal")
|
||||
set_target_properties(
|
||||
cp2k::CUSOLVER_MP::cusolver_mp
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CP2K_CUSOLVER_MP_INCLUDE_DIRS}")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
|
@ -91,7 +91,7 @@ foreach(lib_name "fftw3" "fftw3l" "fftw3q" "fftw3f")
|
|||
endif()
|
||||
endforeach()
|
||||
|
||||
set(CP2K_FFTW3_FOUND ${Fftw_FOUND})
|
||||
set(CP2K_FFTW3_FOUND ON)
|
||||
mark_as_advanced(
|
||||
CP2K_FFTW3_FOUND
|
||||
CP2K_FFTW3_ROOT
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
|
@ -35,6 +35,10 @@ find_package_handle_standard_args(
|
|||
FlexiBLAS DEFAULT_MSG CP2K_FLEXIBLAS_INCLUDE_DIRS
|
||||
CP2K_FLEXIBLAS_LINK_LIBRARIES)
|
||||
|
||||
if(NOT CP2K_FLEXIBLAS_FOUND)
|
||||
set(CP2K_BLAS_VENDOR "FlexiBLAS")
|
||||
endif()
|
||||
|
||||
if(CP2K_FLEXIBLAS_FOUND)
|
||||
if(NOT TARGET cp2k::BLAS::FlexiBLAS::flexiblas)
|
||||
add_library(cp2k::BLAS::FlexiBLAS::flexiblas INTERFACE IMPORTED)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
|
@ -42,25 +42,20 @@ if(NOT CP2K_CONFIG_PACKAGE)
|
|||
CP2K_LAPACK_LINK_LIBRARIES
|
||||
NAMES "lapack" "lapack64"
|
||||
PATH_SUFFIXES "openblas" "openblas64" "openblas-pthread"
|
||||
"openblas-openmp" "lib" "lib64")
|
||||
"openblas-openmp" "lib" "lib64"
|
||||
NO_DEFAULT_PATH)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# check if found
|
||||
find_package_handle_standard_args(${CMAKE_FIND_PACKAGE_NAME}
|
||||
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)
|
||||
endif()
|
||||
# Compatibility: some external packages (e.g. tblite/multicharge) expect
|
||||
# LAPACK::LAPACK
|
||||
if(NOT TARGET LAPACK::LAPACK)
|
||||
add_library(LAPACK::LAPACK ALIAS cp2k::LAPACK::lapack)
|
||||
endif()
|
||||
|
||||
set_property(TARGET cp2k::LAPACK::lapack PROPERTY INTERFACE_LINK_LIBRARIES
|
||||
${CP2K_LAPACK_LINK_LIBRARIES})
|
||||
|
|
@ -71,4 +66,4 @@ if(CP2K_LAPACK_INCLUDE_DIRS)
|
|||
endif()
|
||||
|
||||
# prevent clutter in cache
|
||||
mark_as_advanced(CP2K_LAPACK_LINK_LIBRARIES CP2K_LAPACK_INCLUDE_DIRS)
|
||||
mark_as_advanced(CP2K_LAPACK_LIBRARIES CP2K_LAPACK_INCLUDE_DIRS)
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
include(cp2k_utils)
|
||||
|
||||
cp2k_set_default_paths(LIBFCI "LibFCI")
|
||||
cp2k_find_libraries(LIBFCI "fci")
|
||||
|
||||
if(CP2K_LIBFCI_INCLUDE_DIRS)
|
||||
find_package_handle_standard_args(
|
||||
LibFCI DEFAULT_MSG CP2K_LIBFCI_LINK_LIBRARIES CP2K_LIBFCI_INCLUDE_DIRS)
|
||||
else()
|
||||
find_package_handle_standard_args(LibFCI DEFAULT_MSG
|
||||
CP2K_LIBFCI_LINK_LIBRARIES)
|
||||
endif()
|
||||
|
||||
if(LibFCI_FOUND)
|
||||
if(NOT TARGET libfci::fci)
|
||||
add_library(libfci::fci INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
libfci::fci PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
"${CP2K_LIBFCI_LINK_LIBRARIES}")
|
||||
if(CP2K_LIBFCI_INCLUDE_DIRS)
|
||||
set_target_properties(
|
||||
libfci::fci PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CP2K_LIBFCI_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced(CP2K_LIBFCI_ROOT CP2K_LIBFCI_INCLUDE_DIRS
|
||||
CP2K_LIBFCI_LINK_LIBRARIES CP2K_LIBFCI_LIBRARIES)
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
||||
# Copyright (c) 2025- ETH Zurich
|
||||
#
|
||||
# author: Marcello Puligheddu, Sergey Chulkov
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
include(cp2k_utils)
|
||||
|
||||
cp2k_find_libraries(LIBGINT "cp2kGint")
|
||||
cp2k_include_dirs(LIBGINT "libgint.mod")
|
||||
|
||||
if(CP2K_LIBGINT_INCLUDE_DIRS)
|
||||
find_package_handle_standard_args(
|
||||
LibGint DEFAULT_MSG CP2K_LIBGINT_LINK_LIBRARIES CP2K_LIBGINT_INCLUDE_DIRS)
|
||||
else()
|
||||
find_package_handle_standard_args(LibGint DEFAULT_MSG
|
||||
CP2K_LIBGINT_LINK_LIBRARIES)
|
||||
endif()
|
||||
|
||||
if(NOT TARGET cp2k::LibGint::libGint)
|
||||
add_library(cp2k::LibGint::libGint INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
cp2k::LibGint::libGint PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
"${CP2K_LIBGINT_LINK_LIBRARIES}")
|
||||
if(CP2K_LIBGINT_INCLUDE_DIRS)
|
||||
set_target_properties(
|
||||
cp2k::LibGint::libGint PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CP2K_LIBGINT_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced(CP2K_LIBGINT_ROOT CP2K_LIBGINT_INCLUDE_DIRS
|
||||
CP2K_LIBGINT_LINK_LIBRARIES CP2K_LIBGINT_LIBRARIES)
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
|
@ -14,6 +14,7 @@ include(cp2k_utils)
|
|||
|
||||
cp2k_set_default_paths(LIBVORI "LibVORI")
|
||||
cp2k_find_libraries(LIBVORI vori)
|
||||
# cp2k_include_dirs(LIBVORI )
|
||||
|
||||
if(CP2K_LIBVORI_INCLUDE_DIRS)
|
||||
find_package_handle_standard_args(
|
||||
|
|
@ -23,17 +24,15 @@ else()
|
|||
CP2K_LIBVORI_LINK_LIBRARIES)
|
||||
endif()
|
||||
|
||||
if(CP2K_LIBVORI_FOUND)
|
||||
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_LIBVORI_LINK_LIBRARIES}")
|
||||
if(CP2K_LIBVORI_INCLUDE_DIRS)
|
||||
set_target_properties(
|
||||
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_LIBVORI_INCLUDE_DIRS}")
|
||||
endif()
|
||||
cp2k::VORI::vori PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CP2K_LIBVORI_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
|||
62
cmake/modules/FindLibXC.cmake
Normal file
62
cmake/modules/FindLibXC.cmake
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
include(cp2k_utils)
|
||||
|
||||
cp2k_set_default_paths(LIBXC "LibXC")
|
||||
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(CP2K_LIBXC IMPORTED_TARGET GLOBAL libxcf90 libxcf03
|
||||
libxc>=${LibXC_FIND_VERSION})
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_LIBXC_FOUND)
|
||||
# Revert pkg_check_modules side effects
|
||||
cp2k_set_default_paths(LIBXC "LibXC")
|
||||
foreach(_var xc xcf03 xcf90)
|
||||
string(TOUPPER LIB${_var} _var_up)
|
||||
cp2k_find_libraries(${_var_up} ${_var})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(CP2K_LIBXC_FOUND
|
||||
AND CP2K_LIBXCF90_FOUND
|
||||
AND CP2K_LIBXCF03_FOUND)
|
||||
set(CP2K_LIBXC_LINK_LIBRARIES
|
||||
"${CP2K_LIBXCF03_LIBRARIES};${CP2K_LIBXCF90_LIBRARIES};${CP2K_LIBXC_LIBRARIES}"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_LIBXC_INCLUDE_DIRS)
|
||||
cp2k_include_dirs(LIBXC "xc.h;libxc/xc.h")
|
||||
endif()
|
||||
|
||||
if(CP2K_LIBXC_INCLUDE_DIRS)
|
||||
find_package_handle_standard_args(
|
||||
LibXC DEFAULT_MSG CP2K_LIBXC_FOUND CP2K_LIBXC_LINK_LIBRARIES
|
||||
CP2K_LIBXC_INCLUDE_DIRS)
|
||||
else()
|
||||
find_package_handle_standard_args(LibXC DEFAULT_MSG CP2K_LIBXC_FOUND
|
||||
CP2K_LIBXC_LINK_LIBRARIES)
|
||||
endif()
|
||||
if(CP2K_LIBXC_FOUND)
|
||||
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_INCLUDE_DIRS}")
|
||||
endif()
|
||||
target_link_libraries(cp2k::Libxc::xc INTERFACE ${CP2K_LIBXC_LINK_LIBRARIES})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(CP2K_LIBXC_FOUND CP2K_LIBXC_LINK_LIBRARIES
|
||||
CP2K_LIBXC_INCLUDE_DIRS)
|
||||
84
cmake/modules/FindLibXSMM.cmake
Normal file
84
cmake/modules/FindLibXSMM.cmake
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
include(cp2k_utils)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
cp2k_set_default_paths(LIBXSMM "LibXSMM")
|
||||
set(CP2K_LIBXSMMEXT_ROOT "${CP2K_LIBXSMM_PREFIX}")
|
||||
set(CP2K_LIBXSMMF_ROOT "${CP2K_LIBXSMM_PREFIX}")
|
||||
set(CP2K_LIBXSMMNOBLAS_ROOT "${CP2K_LIBXSMM_PREFIX}")
|
||||
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(CP2K_LIBXSMM IMPORTED_TARGET GLOBAL libxsmm)
|
||||
pkg_check_modules(CP2K_LIBXSMMEXT IMPORTED_TARGET GLOBAL libxsmmext)
|
||||
pkg_check_modules(CP2K_LIBXSMMF IMPORTED_TARGET GLOBAL libxsmmf)
|
||||
pkg_check_modules(CP2K_LIBXSMMNOBLAS IMPORTED_TARGET GLOBAL libxsmmnoblas)
|
||||
|
||||
# i need to do it twice because of dbcsr build option
|
||||
pkg_check_modules(LIBXSMM QUIET IMPORTED_TARGET GLOBAL libxsmm)
|
||||
pkg_check_modules(LIBXSMMEXT QUIET IMPORTED_TARGET GLOBAL libxsmmext)
|
||||
pkg_check_modules(LIBXSMMF QUIET IMPORTED_TARGET GLOBAL libxsmmf)
|
||||
pkg_check_modules(LIBXSMMNOBLAS QUIET IMPORTED_TARGET GLOBAL libxsmmnoblas)
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_LIBXSMM_FOUND)
|
||||
# Reset after pkg_check_modules side effects
|
||||
foreach(__lib xsmm xsmmf xsmmext xsmmnoblas)
|
||||
string(TOUPPER "LIB${__lib}" __lib_search_up)
|
||||
if(NOT CP2K_${__lib_search_up}_FOUND)
|
||||
cp2k_find_libraries(${__lib_search_up} ${__lib})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_LIBXSMM_INCLUDE_DIRS)
|
||||
cp2k_include_dirs(LIBXSMM "libxsmm.h;include/libxsmm.h")
|
||||
endif()
|
||||
|
||||
if(CP2K_LIBXSMM_INCLUDE_DIRS)
|
||||
find_package_handle_standard_args(
|
||||
LibXSMM
|
||||
DEFAULT_MSG
|
||||
CP2K_LIBXSMM_INCLUDE_DIRS
|
||||
CP2K_LIBXSMMNOBLAS_LINK_LIBRARIES
|
||||
CP2K_LIBXSMMEXT_LINK_LIBRARIES
|
||||
CP2K_LIBXSMMF_LINK_LIBRARIES
|
||||
CP2K_LIBXSMM_LINK_LIBRARIES)
|
||||
else()
|
||||
find_package_handle_standard_args(
|
||||
LibXSMM DEFAULT_MSG CP2K_LIBXSMMNOBLAS_LINK_LIBRARIES
|
||||
CP2K_LIBXSMMEXT_LINK_LIBRARIES CP2K_LIBXSMMF_LINK_LIBRARIES
|
||||
CP2K_LIBXSMM_LINK_LIBRARIES)
|
||||
endif()
|
||||
|
||||
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)
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
cp2k::LibXSMM::${__lib} PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
"${${__lib_search_up}_LINK_LIBRARIES}")
|
||||
|
||||
if(CP2K_LIBXSMM_INCLUDE_DIRS)
|
||||
set_target_properties(
|
||||
cp2k::LibXSMM::${__lib}
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CP2K_LIBXSMM_INCLUDE_DIRS};${CP2K_LIBXSMM_PREFIX}/include"
|
||||
)
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
CP2K_LIBXSMM_INCLUDE_DIRS CP2K_LIBXSMMNOBLAS_LINK_LIBRARIES
|
||||
CP2K_LIBXSMMEXT_LINK_LIBRARIES CP2K_LIBXSMMF_LINK_LIBRARIES
|
||||
CP2K_LIBXSMM_LINK_LIBRARIES)
|
||||
61
cmake/modules/FindLibint2.cmake
Normal file
61
cmake/modules/FindLibint2.cmake
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
||||
# Copyright (c) 2022- ETH Zurich
|
||||
#
|
||||
# authors : Mathieu Taillefumier
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
include(cp2k_utils)
|
||||
|
||||
cp2k_set_default_paths(LIBINT2 "Libint2")
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(CP2K_LIBINT2 IMPORTED_TARGET GLOBAL libint2)
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_LIBINT2_FOUND)
|
||||
cp2k_find_libraries(LIBINT2 int2)
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_LIBINT2_INCLUDE_DIRS)
|
||||
cp2k_include_dirs(LIBINT2 "libint2.h;libint2/atom.h")
|
||||
endif()
|
||||
|
||||
find_file(
|
||||
CP2K_LIBINT2_MOD_FILE
|
||||
NAMES "libint_f.mod"
|
||||
PATHS "${CP2K_LIBINT2_ROOT}/include" "${CP2K_LIBINT2_ROOT}/include/libint2")
|
||||
|
||||
if(NOT CP2K_LIBINT2_MOD_FILE)
|
||||
message(FATAL_ERROR "Libint2 : Fortran support is missing")
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(
|
||||
Libint2 CP2K_LIBINT2_FOUND CP2K_LIBINT2_INCLUDE_DIRS
|
||||
CP2K_LIBINT2_LINK_LIBRARIES)
|
||||
|
||||
if(CP2K_LIBINT2_FOUND)
|
||||
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_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
cp2k::Libint2::int2 PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
${CP2K_LIBINT2_LINK_LIBRARIES})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(CP2K_LIBINT2_FOUND CP2K_LIBINT2_LINK_LIBRARIES
|
||||
CP2K_LIBINT2_INCLUDE_DIRS)
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
|
@ -321,6 +321,8 @@ foreach(_libtype "ST" "DYN")
|
|||
TOLOWER "${_mpi_impl}_${_iface}_${_bits}_${_threading}_${_libtype}"
|
||||
_tgt_config)
|
||||
|
||||
set(_scalapack_tgt cp2k::BLAS::MKL::scalapack_${_tgt_config})
|
||||
|
||||
if(_mkl_blacs_lib
|
||||
AND TARGET ${_mkl_tgt}
|
||||
AND TARGET MPI::MPI_CXX
|
||||
|
|
@ -346,10 +348,7 @@ foreach(_libtype "ST" "DYN")
|
|||
|
||||
if(_mkl_scalapack_lib AND NOT TARGET
|
||||
cp2k::BLAS::MKL::scalapack_${_tgt_config})
|
||||
set(_scalapack_libs "${_mkl_scalapack_lib}")
|
||||
if(TARGET cp2k::BLAS::MKL::blacs_${_tgt_config})
|
||||
list(APPEND _scalapack_libs cp2k::BLAS::MKL::blacs_${_tgt_config})
|
||||
endif()
|
||||
set(_scalapack_libs "${_mkl_scalapack_lib}" "${_blacs_tgt}")
|
||||
add_library(cp2k::BLAS::MKL::scalapack_${_tgt_config} INTERFACE
|
||||
IMPORTED)
|
||||
set_target_properties(
|
||||
|
|
@ -376,12 +375,19 @@ if(MKL_FOUND)
|
|||
set(BLAS_mkl_INTFACE "intel")
|
||||
endif()
|
||||
|
||||
if(CP2K_BLAS_THREADING STREQUAL "sequential")
|
||||
set(BLAS_mkl_thread__ "seq")
|
||||
elseif(CP2K_BLAS_THREADING MATCHES
|
||||
"^(thread|gnu-thread|intel-thread|openmp)$")
|
||||
if(CP2K_BLAS_THREADING MATCHES "thread|gnu-thread")
|
||||
set(BLAS_mkl_thread__ "omp")
|
||||
elseif(CP2K_BLAS_THREADING STREQUAL "tbb-thread")
|
||||
endif()
|
||||
|
||||
if(CP2K_BLAS_THREADING MATCHES "sequential")
|
||||
set(BLAS_mkl_thread__ "seq")
|
||||
endif()
|
||||
|
||||
if(CP2K_BLAS_THREADING MATCHES "intel-thread")
|
||||
set(BLAS_mkl_thread__ "intel")
|
||||
endif()
|
||||
|
||||
if(CP2K_BLAS_THREADING MATCHES "tbb")
|
||||
set(BLAS_mkl_thread__ "tbb")
|
||||
endif()
|
||||
|
||||
|
|
|
|||
35
cmake/modules/FindMetis.cmake
Normal file
35
cmake/modules/FindMetis.cmake
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
||||
# Copyright (c) 2022- ETH Zurich
|
||||
#
|
||||
# authors : Mathieu Taillefumier
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
include(cp2k_utils)
|
||||
|
||||
cp2k_set_default_paths(METIS "Metis")
|
||||
|
||||
cp2k_find_libraries(FLEXIBLAS "metis")
|
||||
cp2k_include_dirs(FFTW3 "metis.h")
|
||||
|
||||
# check that METIS has been found
|
||||
# ---------------------------------
|
||||
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)
|
||||
set_target_properties(
|
||||
cp2k::metis::metis
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CP2K_METIS_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${CP2K_METIS_LINK_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
mark_as_advanced(CP2K_METIS_LINK_LIBRARIES)
|
||||
mark_as_advanced(CP2K_METIS_INCLUDE_DIRS)
|
||||
mark_as_advanced(CP2K_METIS_FOUND)
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
include(cp2k_utils)
|
||||
|
||||
# ! Use PkgConfig to look for modules named mclf and mcl, LOOK for .pc files
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(CP2K_MIMIC IMPORTED_TARGET GLOBAL mclf mcl)
|
||||
endif()
|
||||
|
||||
# ! Using CP2K_UTILS
|
||||
if(NOT CP2K_MIMIC_FOUND)
|
||||
cp2k_set_default_paths(MIMIC "MiMiC")
|
||||
cp2k_find_libraries(MIMIC mclf)
|
||||
cp2k_find_libraries(MIMICc mcl)
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_MIMIC_FOUND)
|
||||
find_library(CP2K_MIMIC_LIBRARIES mclf PATH_SUFFIXES MiMiC)
|
||||
find_library(CP2K_MIMICc_LIBRARIES mcl PATH_SUFFIXES MiMiC)
|
||||
if(CP2K_MIMIC_LIBRARIES AND CP2K_MIMICc_LIBRARIES)
|
||||
set(CP2K_MIMIC_FOUND True)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CP2K_MIMIC_FOUND)
|
||||
set(CP2K_MIMIC_LINK_LIBRARIES
|
||||
"${CP2K_MIMIC_LIBRARIES};${CP2K_MIMICc_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_MIMIC_INCLUDE_DIRS)
|
||||
cp2k_include_dirs(MIMIC "mcl.mod")
|
||||
endif()
|
||||
|
||||
if(NOT CP2K_MIMIC_INCLUDE_DIRS)
|
||||
find_path(CP2K_MIMIC_INCLUDE_DIRS "mcl.mod" PATH_SUFFIXES MiMiC)
|
||||
endif()
|
||||
|
||||
if(CP2K_MIMIC_INCLUDE_DIRS)
|
||||
find_package_handle_standard_args(
|
||||
MiMiC DEFAULT_MSG CP2K_MIMIC_FOUND CP2K_MIMIC_LINK_LIBRARIES
|
||||
CP2K_MIMIC_INCLUDE_DIRS)
|
||||
else()
|
||||
find_package_handle_standard_args(MiMiC DEFAULT_MSG CP2K_MIMIC_FOUND
|
||||
CP2K_MIMIC_LINK_LIBRARIES)
|
||||
endif()
|
||||
|
||||
if(CP2K_MIMIC_FOUND)
|
||||
if(NOT TARGET CP2K::MIMIC::mclf)
|
||||
add_library(CP2K::MIMIC::mclf INTERFACE IMPORTED)
|
||||
add_library(CP2K::MIMIC::mcl INTERFACE IMPORTED)
|
||||
endif()
|
||||
|
||||
if(CP2K_MIMIC_INCLUDE_DIRS)
|
||||
set_target_properties(
|
||||
CP2K::MIMIC::mclf CP2K::MIMIC::mcl
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CP2K_MIMIC_INCLUDE_DIRS}")
|
||||
endif()
|
||||
target_link_libraries(CP2K::MIMIC::mclf
|
||||
INTERFACE "${CP2K_MIMIC_LINK_LIBRARIES}")
|
||||
target_link_libraries(CP2K::MIMIC::mcl
|
||||
INTERFACE "${CP2K_MIMIC_LINK_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
mark_as_advanced(CP2K_MIMIC_FOUND CP2K_MIMIC_LINK_LIBRARIES
|
||||
CP2K_MIMIC_INCLUDE_DIRS)
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
include(FindPackageHandleStandardArgs)
|
||||
include(cp2k_utils)
|
||||
|
||||
cp2k_set_default_paths(NVHPC "NVHPC")
|
||||
cp2k_set_default_paths(CP2K_NVHPC "NVHPC")
|
||||
|
||||
find_library(
|
||||
CP2K_NVHPC_BLAS_LP64
|
||||
|
|
@ -55,39 +55,36 @@ find_path(
|
|||
find_package_handle_standard_args(
|
||||
NVHPCBlas
|
||||
DEFAULT_MSG
|
||||
CP2K_NVHPC_BLAS_INCLUDE_DIRS_ilp64
|
||||
CP2K_NVHPC_INCLUDE_DIRS_ipl64
|
||||
CP2K_NVHPC_BLAS_INCLUDE_DIRS_lp64
|
||||
CP2K_NVHPC_BLAS_ILP64
|
||||
CP2K_NVHPC_BLAS_LP64
|
||||
CP2K_NVHPC_LAPACK_ILP64
|
||||
CP2K_NVHPC_LAPACK_LP64)
|
||||
|
||||
set(CP2K_NVHPCBLAS_FOUND ${NVHPCBlas_FOUND})
|
||||
set(CP2K_BLAS_VENDOR "NVHPCBlas")
|
||||
set(CP2K_NVHPCBLAS_FOUND "ON")
|
||||
|
||||
if(CP2K_NVHPCBLAS_FOUND)
|
||||
set(CP2K_BLAS_VENDOR "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")
|
||||
set(CP2K_NVHPC_BLAS_LINK_LIBRARIES
|
||||
"${CP2K_NVHPC_LAPACK_ILP64};${CP2K_NVHPC_BLAS_ILP64}")
|
||||
set(CP2K_NVHPC_BLAS_INCLUDE_DIRS "${CP2K_NVHPC_BLAS_INCLUDE_DIRS_ilp64}")
|
||||
else()
|
||||
set(CP2K_NVHPC_BLAS_LINK_LIBRARIES
|
||||
"${CP2K_NVHPC_LAPACK_LP64};${CP2K_NVHPC_BLAS_LP64}")
|
||||
set(CP2K_NVHPC_BLAS_INCLUDE_DIRS "${CP2K_NVHPC_BLAS_INCLUDE_DIRS_lp64}")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
cp2k::BLAS::NVHPCBlas::nvhpcblas
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES "${CP2K_NVHPC_BLAS_LINK_LIBRARIES}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${CP2K_NVHPC_BLAS_INCLUDE_DIRS}")
|
||||
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")
|
||||
set(CP2K_NVHPC_BLAS_LINK_LIBRARIES
|
||||
"${CP2K_NVHPC_LAPACK_ILP64} ${CP2K_NVHPC_BLAS_ILP64}")
|
||||
set(CP2K_NVHPC_BLAS_INCLUDE_DIRS "${CP2K_NVHPC_INCLUDE_DIRS_ipl64}")
|
||||
else()
|
||||
set(CP2K_NVHPC_BLAS_LINK_LIBRARIES "${CP2K_NVHPC_LAPACK_LP64}
|
||||
${CP2K_NVHPC_BLAS_LP64}")
|
||||
set(CP2K_NVHPC_BLAS_INCLUDE_DIRS "${CP2K_NVHPC_INCLUDE_DIRS_pl64}")
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
cp2k::BLAS::NVHPCBlas::nvhpcblas
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES "${CP2K_NVHPC_BLAS_LINK_LIBRARIES}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${CP2K_NVHPC_BLAS_INCLUDE_DIRS}")
|
||||
|
||||
mark_as_advanced(CP2K_NVHPCBLAS_FOUND CP2K_NVHPC_BLAS_INCLUDE_DIRS
|
||||
CP2K_NVHPC_BLAS_LINK_LIBRARIES CP2K_BLAS_VENDOR)
|
||||
|
|
|
|||
|
|
@ -1,31 +0,0 @@
|
|||
#!-------------------------------------------------------------------------------------------------!
|
||||
#! CP2K: A general program to perform molecular dynamics simulations !
|
||||
#! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
|
||||
#! !
|
||||
#! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
#!-------------------------------------------------------------------------------------------------!
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
include(cp2k_utils)
|
||||
|
||||
cp2k_set_default_paths(NCCL "Nccl")
|
||||
|
||||
cp2k_find_libraries(NCCL "nccl")
|
||||
cp2k_include_dirs(NCCL "nccl.h")
|
||||
|
||||
find_package_handle_standard_args(Nccl DEFAULT_MSG CP2K_NCCL_LINK_LIBRARIES
|
||||
CP2K_NCCL_INCLUDE_DIRS)
|
||||
|
||||
if(CP2K_NCCL_FOUND AND NOT TARGET cp2k::NCCL::nccl)
|
||||
add_library(cp2k::NCCL::nccl INTERFACE IMPORTED)
|
||||
set_target_properties(
|
||||
cp2k::NCCL::nccl PROPERTIES INTERFACE_LINK_LIBRARIES
|
||||
"${CP2K_NCCL_LINK_LIBRARIES}")
|
||||
set_target_properties(
|
||||
cp2k::NCCL::nccl PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${CP2K_NCCL_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
mark_as_advanced(CP2K_NCCL_LINK_LIBRARIES)
|
||||
mark_as_advanced(CP2K_NCCL_INCLUDE_DIRS)
|
||||
mark_as_advanced(CP2K_NCCL_FOUND)
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue