git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11823 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2014-04-18 14:14:25 +00:00
parent 8fcc38d608
commit 35b51e753d
2 changed files with 159 additions and 0 deletions

55
src/MAKE/Makefile.bgq Normal file
View File

@ -0,0 +1,55 @@
# bgq = IBM Blue Gene/Q, multiple compiler options, native MPI, ALCF FFTW2
SHELL = /bin/bash
.SUFFIXES: .cpp .u
# ---------------------------------------------------------------------
# build rules and dependencies
# no need to edit this section
# select which compiler by editing Makefile.bgq.details
include ../MAKE/Makefile.bgq.details
include Makefile.package.settings
include Makefile.package
EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC)
EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH)
EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(JPG_LIB) $(PKG_SYSLIB)
# Path to src files
vpath %.cpp ..
vpath %.h ..
# Link target
$(EXE): $(OBJ)
$(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE)
$(SIZE) $(EXE)
# Library targets
lib: $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ)
shlib: $(OBJ)
$(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \
$(OBJ) $(EXTRA_LIB) $(LIB)
# Compilation rules
%.o:%.cpp
$(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $<
%.d:%.cpp
ifneq ($(COMPILER),XLC)
$(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@
endif
# Individual dependencies
DEPENDS = $(OBJ:.o=.d)
sinclude $(DEPENDS)

View File

@ -0,0 +1,104 @@
# multiple compiler options for BGQ
# ---------------------------------------------------------------------
# compiler/linker settings
# specify flags and libraries needed for your compiler
# uncomment one and only one of the following three lines
# to choose a compiler toolchain
#COMPILER = GCC
#COMPILER = LLVM
COMPILER = XLC
ifeq ($(COMPILER),XLC)
CC = /bgsys/drivers/ppcfloor/comm/xl.ndebug/bin/mpixlcxx_r
CCFLAGS = -O3 -qarch=qp -qtune=qp -qsmp=omp -qsimd=auto -qhot=level=2 -qprefetch -qunroll=yes
FC = /bgsys/drivers/ppcfloor/comm/xl.ndebug/bin/mpixlf90_r
FFLAGS = -O3 -qarch=qp -qtune=qp -qsimd=auto -qhot=level=2 -qprefetch -qunroll=yes -qsmp=omp -qextname -qnosave
DEPFLAGS = -M -qmakedep=gcc
endif
ifeq ($(COMPILER),GCC)
CC = /bgsys/drivers/ppcfloor/comm/gcc.legacy/bin/mpicxx
CCFLAGS = -O3 -fopenmp
FC = /bgsys/drivers/ppcfloor/comm/gcc.legacy/bin/mpif90
FFLAGS = -O3 -fopenmp
DEPFLAGS = -M
endif
ifeq ($(COMPILER),LLVM)
#CC = bgclang++
CC = /home/projects/llvm/mpi/bgclang/bin/mpiclang++
CCFLAGS = -O3 -fopenmp
DEPFLAGS = -M
FC = /bin/false
FFLAGS = LLVM does not have a Fortran front-end!
endif
LINK = $(CC)
LINKFLAGS = $(CCFLAGS)
ifeq ($(COMPILER),XLC)
MASS_LIB = ${IBM_MAIN_DIR}/xlmass/bg/7.3/bglib64
XLF_LIB = ${IBM_MAIN_DIR}/xlf/bg/14.1/bglib64
XLSMP_LIB = ${IBM_MAIN_DIR}/xlsmp/bg/3.1/bglib64
LIB += -L${MASS_LIB} -L${XLF_LIB} -L${XLSMP_LIB}
LIB += -lmassv -lmass
LIB += -lxlf90_r -lxlsmp -lxlopt -lxlfmath -lxl
endif
ifeq ($(COMPILER),GCC)
# libm is definitely slower than libmass...
LIB += -lm -lgfortran
endif
ifeq ($(COMPILER),LLVM)
SLEEF_DIR = /home/projects/llvm/sleef
LIB += -L${SLEEF_DIR}/lib -lsleef
endif
SIZE = size
ARCHIVE = ar
ARFLAGS = -rc
# BGQ should not use shared libraries
SHFLAGS =
SHLIBFLAGS =
# ---------------------------------------------------------------------
# LAMMPS-specific settings
# specify settings for LAMMPS features you will use
# if you change any -D setting, do full re-compile after "make clean"
# LAMMPS ifdef settings, OPTIONAL
# see possible settings in doc/Section_start.html#2_2 (step 4)
LMP_INC = -DLAMMPS_GZIP
# MPI library
# see discussion in doc/Section_start.html#2_2 (step 5)
MPI_PATH =
MPI_PATH =
MPI_LIB =
MPI_INC += -DMPICH_SKIP_MPICXX
MPI_LIB += #/home/jhammond/OSPRI/branches/marpn/wrap/libmpiarbrpn.a
# FFT library, OPTIONAL
# see discussion in doc/Section_start.html#2_2 (step 6)
FFT_INC = -I/soft/libraries/alcf/current/xl/FFTW2/include -DFFT_FFTW -DFFTW_SIZE
FFT_PATH = #/soft/libraries/alcf/current/xl/FFTW2
FFT_LIB = -L/soft/libraries/alcf/current/xl/FFTW2/lib -ldfftw
# JPEG library, OPTIONAL
# see discussion in doc/Section_start.html#2_2 (step 7)
# only needed if -DLAMMPS_JPEG listed with LMP_INC
JPG_INC =
JPG_PATH =
JPG_LIB =