1# intel_cpu_openmpi = INTEL package, OpenMPI with compiler set to Intel icc
2
3SHELL = /bin/sh
4
5# ---------------------------------------------------------------------
6# compiler/linker settings
7# specify flags and libraries needed for your compiler
8
9export OMPI_CXX = icc
10CC =		mpicxx -std=c++11
11OPTFLAGS =      -xHost -O2 -fp-model fast=2 -no-prec-div -qoverride-limits \
12                -qopt-zmm-usage=high
13CCFLAGS =	-qopenmp -qno-offload -ansi-alias -restrict \
14                -DLMP_INTEL_USELRT -DLMP_USE_MKL_RNG $(OPTFLAGS) \
15                -I$(MKLROOT)/include
16SHFLAGS =	-fPIC
17DEPFLAGS =	-M
18
19LINK =		mpicxx -std=c++11
20LINKFLAGS =	-qopenmp $(OPTFLAGS) -L$(MKLROOT)/lib/intel64/
21LIB =           -ltbbmalloc -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core
22SIZE =		size
23
24ARCHIVE =	ar
25ARFLAGS =	-rc
26SHLIBFLAGS =	-shared
27
28# ---------------------------------------------------------------------
29# LAMMPS-specific settings, all OPTIONAL
30# specify settings for LAMMPS features you will use
31# if you change any -D setting, do full re-compile after "make clean"
32
33# LAMMPS ifdef settings
34# see possible settings in Section 3.5 of the manual
35
36LMP_INC =	-DLAMMPS_GZIP
37
38# MPI library
39# see discussion in Section 3.4 of the manual
40# MPI wrapper compiler/linker can provide this info
41# can point to dummy MPI library in src/STUBS as in Makefile.serial
42# use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts
43# INC = path for mpi.h, MPI compiler settings
44# PATH = path for MPI library
45# LIB = name of MPI library
46
47MPI_INC =       -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -I/usr/local/include
48MPI_PATH =
49MPI_LIB =
50
51# FFT library
52# see discussion in Section 3.5.2 of manual
53# can be left blank to use provided KISS FFT library
54# INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings
55# PATH = path for FFT library
56# LIB = name of FFT library
57
58FFT_INC =      -DFFT_MKL -DFFT_SINGLE
59FFT_PATH =
60FFT_LIB =
61
62# JPEG and/or PNG library
63# see discussion in Section 3.5.4 of manual
64# only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC
65# INC = path(s) for jpeglib.h and/or png.h
66# PATH = path(s) for JPEG library and/or PNG library
67# LIB = name(s) of JPEG library and/or PNG library
68
69JPG_INC =
70JPG_PATH =
71JPG_LIB =
72
73# ---------------------------------------------------------------------
74# build rules and dependencies
75# do not edit this section
76
77include Makefile.package.settings
78include Makefile.package
79
80EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC)
81EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH)
82EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(JPG_LIB) $(PKG_SYSLIB)
83EXTRA_CPP_DEPENDS = $(PKG_CPP_DEPENDS)
84EXTRA_LINK_DEPENDS = $(PKG_LINK_DEPENDS)
85
86# Path to src files
87
88vpath %.cpp ..
89vpath %.h ..
90
91# Link target
92
93$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS)
94	$(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@
95	$(SIZE) $@
96
97# Library targets
98
99$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS)
100	@rm -f ../$(ARLIB)
101	$(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ)
102	@rm -f $(ARLIB)
103	@ln -s ../$(ARLIB) $(ARLIB)
104
105$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS)
106	$(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \
107		$(OBJ) $(EXTRA_LIB) $(LIB)
108	@rm -f $(SHLIB)
109	@ln -s ../$(SHLIB) $(SHLIB)
110
111# Compilation rules
112
113%.o:%.cpp
114	$(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $<
115
116# Individual dependencies
117
118depend : fastdep.exe $(SRC)
119	@./fastdep.exe $(EXTRA_INC) -- $^ > .depend || exit 1
120
121fastdep.exe: ../DEPEND/fastdep.c
122	cc -O -o $@ $<
123
124sinclude .depend
125