# tbird = Dell cluster with dual 3.6 GHz Xeons, Intel mpicxx, native MPI, FFTW

SHELL = /bin/sh
.IGNORE:

# this Makefile builds LAMMPS for openMPI running on Tbird
# as of April 09, you want these modules loaded, which are not the default:
#   mpi/openmpi-1.2.8_intel-11.0-f074-c074
#   misc/env-openmpi-1.2
#   compilers/intel-11.0-f074-c074
#   libraries/intel-mkl
#   libraries/intel_fftw-10.0.4.023
#   libraries/intel-mkl-11.0.074
# you can determine which modules are loaded by typing:
#   module list
# you can load these modules by putting
#   these lines in your .cshrc or other start-up shell file
#   or by typing them before you build LAMMPS:
#     module switch mpi mpi/openmpi-1.2.8_intel-11.0-f074-c074
#     module load libraries/intel_fftw-10.0.4.023
#     module load libraries/intel-mkl-11.0.074
# these same modules need to be loaded to submit a LAMMPS job,
#   either interactively or via a batch script

# System-specific settings

# LINKFORT & FORTLIB settings can be blank if not using LAMMPS Fortran libs
# LINKGPU & GPULIB settings can be blank if not using LAMMPS gpu lib

include		Makefile.package

CC =		mpicxx
CCFLAGS =	-O -DFFT_FFTW -I$(FFTW_INCLUDE) $(PKGINC)
DEPFLAGS =	-M
LINK =		mpicxx
LINKFORT =	
LINKGPU =	
LINKFLAGS =	-O $(PKGPATH) $(LINKFORT) $(LINKGPU)
USRLIB =	$(BLASLIB) $(FFTW_LINK_LINE) -lstdc++ $(PKGLIB)
FORTLIB =	
GPULIB =	
SYSLIB =	-lm $(FORTLIB) $(GPULIB)
SIZE =		size
ARCHIVE =       ar
ARFLAGS =       -rc

# Link rule

$(EXE):	$(OBJ)
	$(LINK) $(LINKFLAGS) $(OBJ) $(USRLIB) $(SYSLIB) -o $(EXE)
	$(SIZE) $(EXE)

# Library target
 
lib:    $(OBJ)
	$(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ)

# Compilation rules

%.o:%.cpp
	$(CC) $(CCFLAGS) -c $<

%.d:%.cpp
	$(CC) $(CCFLAGS) $(DEPFLAGS) $< > $@

# Individual dependencies

DEPENDS = $(OBJ:.o=.d)
include $(DEPENDS)
