Rename arch file and make it sourceable

This commit is contained in:
Matthias Krack 2022-02-25 19:35:46 +01:00
parent 887bb64ae0
commit 22356be07c

View file

@ -1,19 +1,34 @@
# Tested with: Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.1.1.217 Build 20200306
# Author: Matthias Krack (matthias.krack@psi.ch, PSI, January 2021)
#!/bin/bash
#
# CP2K (Intel/MKL x86_64) minimal arch file for CRAY XC40
#
# Tested with: Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.3.0
# on Cray XC40 (Piz Daint, CSCS, multi-core partition)
# Cray XC40 (Piz Daint, CSCS, multi-core partition)
# Program environments:
# module add daint-mc
# module rm PrgEnv-cray
# module add PrgEnv-intel
# Author: Matthias Krack (25.02.2022)
# \
if [[ "${0}" == "${BASH_SOURCE}" ]]; then \
echo "ERROR: Script ${0##*/} must be sourced"; \
echo "Usage: source ${0##*/}"; \
exit 1; \
fi; \
this_file=${BASH_SOURCE##*/}; \
module add daint-mc; \
module rm PrgEnv-cray; \
module add PrgEnv-intel; \
module rm intel; \
module add intel-classic; \
module list; \
make -j ARCH=${this_file%%.*} VERSION=${this_file##*.} realclean; \
make -j ARCH=${this_file%%.*} VERSION=${this_file##*.}; \
return
CC = cc
FC = ftn
LD = ftn
AR = ar -r
CFLAGS = -O3 -fopenmp -fp-model precise -funroll-loops -g -qopenmp-simd -traceback
CFLAGS = -O2 -fopenmp -fp-model precise -funroll-loops -g -qopenmp-simd -traceback
DFLAGS = -D__FFTW3
DFLAGS += -D__MAX_CONTR=4
@ -30,8 +45,8 @@ FCFLAGS += -free
FCFLAGS += -I$(MKLROOT)/include
FCFLAGS += -I$(MKLROOT)/include/fftw
LDFLAGS = $(FCFLAGS) -static-intel
LDFLAGS_C = -nofor_main
LDFLAGS = $(FCFLAGS)
LDFLAGS_C = -nofor-main
MKL_LIB = $(MKLROOT)/lib/intel64