mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-29 06:35:28 -04:00
Facilitate build of a (generic) statically linked CP2k binary
This commit is contained in:
parent
2e6367024a
commit
8301c5214c
1 changed files with 26 additions and 23 deletions
|
|
@ -3,35 +3,38 @@
|
|||
# CP2K (GNU) arch file for a serial static x86_64 binary
|
||||
#
|
||||
# Tested with: GNU 11.2.0, FFTW 3.3.10, LIBINT 2.6.0, LIBBVORI 210412,
|
||||
# LIBXC 5.1.7, OpenBLAS 0.3.19, SPGLIB 1.16.2
|
||||
# LIBXC 5.2.2, OpenBLAS 0.3.19, SPGLIB 1.16.2
|
||||
#
|
||||
# Usage: Source this arch file and then run make as instructed after a
|
||||
# CP2K toolchain installation has been performed successfully with
|
||||
# > cd tools/toolchain
|
||||
# > ./install_cp2k_toolchain.sh --mpi-mode=no --with-gcc=install
|
||||
# or for a generic target with
|
||||
# > ./install_cp2k_toolchain.sh --generic --mpi-mode=no --with-gcc=install
|
||||
# Usage: Source this arch file and then run make as instructed.
|
||||
# Add "generic" as argument to compile for a generic x86_64 target.
|
||||
#
|
||||
# Author: Matthias Krack (matthias.krack@psi.ch, PSI, December 2021)
|
||||
# Author: Matthias Krack (28.02.2022)
|
||||
#
|
||||
# \
|
||||
if [[ "${0}" == "${BASH_SOURCE}" ]]; then \
|
||||
if [[ "${0}" == "${BASH_SOURCE}" ]]; then \
|
||||
echo "ERROR: Script ${0##*/} must be sourced"; \
|
||||
echo "Usage: source ${0##*/}"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
this_file=${BASH_SOURCE##*/}; \
|
||||
if [[ -f "${PWD}/tools/toolchain/install/setup" ]]; then \
|
||||
printf "Sourcing ${PWD}/tools/toolchain/install/setup ... "; \
|
||||
source ${PWD}/tools/toolchain/install/setup; \
|
||||
printf "done\n"; \
|
||||
fi; \
|
||||
echo "Check the output above for error messages and consistency!"; \
|
||||
echo "If everything is OK, you can build a CP2K production binary with"; \
|
||||
echo " make -j ARCH=${this_file%%.*} VERSION=${this_file##*.}"; \
|
||||
echo "or build a CP2K binary for a generic target using"; \
|
||||
echo " make -j ARCH=${this_file%%.*} VERSION=${this_file##*.} GENERIC=yes"; \
|
||||
return
|
||||
cd tools/toolchain; \
|
||||
if [[ "${1}" == "generic" ]]; then \
|
||||
./install_cp2k_toolchain.sh -j 16 --generic --mpi-mode=no --with-gcc=install; \
|
||||
else \
|
||||
./install_cp2k_toolchain.sh -j 16 --mpi-mode=no --with-gcc=install; \
|
||||
fi; \
|
||||
source ./install/setup; \
|
||||
cd ../..; \
|
||||
echo; \
|
||||
echo "Check the output above for error messages and consistency!"; \
|
||||
echo "If everything is OK, you can build a CP2K production binary with"; \
|
||||
if [[ "${1}" == "generic" ]]; then \
|
||||
echo " make -j 16 ARCH=${this_file%%.*} VERSION=${this_file##*.} GENERIC=yes"; \
|
||||
else \
|
||||
echo " make -j 16 ARCH=${this_file%%.*} VERSION=${this_file##*.}"; \
|
||||
fi; \
|
||||
echo "Further checks are performed, if DO_CHECKS=yes is added."; \
|
||||
return
|
||||
|
||||
# Set options
|
||||
DO_CHECKS := no
|
||||
|
|
@ -39,7 +42,7 @@ GENERIC := no
|
|||
USE_FFTW := 3.3.10
|
||||
USE_LIBINT := 2.6.0
|
||||
USE_LIBVORI := 210412
|
||||
USE_LIBXC := 5.1.7
|
||||
USE_LIBXC := 5.2.2
|
||||
USE_OPENBLAS := 0.3.19
|
||||
USE_SPGLIB := 1.16.2
|
||||
|
||||
|
|
@ -53,9 +56,9 @@ LD := gfortran
|
|||
AR := ar -r
|
||||
|
||||
ifeq ($(GENERIC), yes)
|
||||
CFLAGS := -O2 -fopenmp -g -mtune=generic
|
||||
CFLAGS := -O2 -fopenmp -fopenmp-simd -ftree-vectorize -funroll-loops -g -mtune=generic
|
||||
else
|
||||
CFLAGS := -O3 -fopenmp -funroll-loops -g -march=native -mtune=native
|
||||
CFLAGS := -O2 -fopenmp -fopenmp-simd -ftree-vectorize -funroll-loops -g -mtune=native
|
||||
endif
|
||||
|
||||
DFLAGS += -D__MAX_CONTR=$(strip $(MAX_CONTR))
|
||||
Loading…
Add table
Add a link
Reference in a new issue