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