forked from cp2k/cp2k
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Linux-x86-64-gfortran-opencl.psmp
89 lines (74 loc) · 2.66 KB
/
Linux-x86-64-gfortran-opencl.psmp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# 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__SCALAPACK
#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