exafmm / Makefile.include

.SUFFIXES: .cxx .cu .o
.PHONY: docs
## ExaFMM path
EXAFMM_INCLUDE_PATH = ../include
EXAFMM_LIBRARY_PATH = ../lib

### choose kernel
EQUATION = Laplace
#EQUATION = Yukawa
#EQUATION = Helmholtz
#EQUATION = Stokes

### choose basis of multipole/local expansion
BASIS	= Cartesian
#BASIS	= Spherical
#BASIS	= Planewave

### choose device to use
DEVICE	= CPU
#DEVICE	= GPU
#DEVICE	= MIC

### GCC compiler
CXX	= mpicxx -ggdb3 -Wall -Wextra -Wshadow -Wuninitialized -O3 -msse4.2 -ffast-math -funroll-loops -fforce-addr -fbounds-check
### Intel compiler
#CXX	= mpicxx -Wall -xHOST -O3 -funroll-loops -finline-functions -ansi-alias
### BG/P compiler
#CXX	= mpixlcxx_r -qarch=450 -qtune=450 -O3

### Base flags
CXX	+= -I$(EXAFMM_INCLUDE_PATH)
LFLAGS	= -L$(EXAFMM_LIBRARY_PATH)
LFLAGS	+= -DCOMcenter # Use center of mass as center of expansion
LFLAGS	+= -DCOMkernel # Use center of mass kernel that skips dipoles (Use with -DCOMcenter)
LFLAGS	+= -DERROR_OPT # Use error optimized theta
LFLAGS	+= -DUSE_BMAX # Use Bmax in multipole acceptance criteria
LFLAGS	+= -DUSE_RMAX # Use Rmax in multipole acceptance criteria
LFLAGS	+= -DDUAL # Use dual tree traversal (turn off every option above before turning this off)
#LFLAGS	+= -DAUTO # Use autotuned selection between P2P or M2L (needs improvement)

### Debugging flags
LFLAGS += -DASSERT # Turns on asserttions (otherwise define an empty macro function)
#LFLAGS	+= -DCOUNT # Count number calls to P2P and M2L

### Intel TBB flags (doesn't work with OpenMP) : TBB is available from http://threadingbuildingblocks.org/download.php
LFLAGS	+= -std=c++0x -DTBB -ltbb

### MassiveThreads flags (doesn't work with OpenMP) : MassiveThreads is available from http://code.google.com/p/massivethreads/
#LFLAGS	+= -std=c++0x -DMTHREAD -lmyth

### PAPI flags
#LFLAGS	+= -DPAPI -lpapi

### VTK flags : VTK is available from http://www.vtk.org/VTK/resources/software.html
### VTK path
#VTK_INCLUDE_PATH = /usr/include/vtk-5.8
#VTK_LIBRARY_PATH = /usr/lib/vtk-5.8
#CXX	+= -I$(VTK_INCLUDE_PATH)
#LFLAGS	= -L$(VTK_LIBRARY_PATH) -DVTK -lvtkRendering -lvtkGraphics -lvtkFiltering -lvtkViews -lvtkCommon -lvtkWidgets -lvtkIO

ifeq ($(DEVICE),GPU)
### CUDA path
CUDA_INSTALL_PATH = /usr/local/cuda
CUDA_SDK_PATH = /usr/local/cuda_sdk/C
### CUDA compiler
NVCC	= nvcc --compiler-bindir=/usr/bin/g++-4.4 -Xcompiler -fopenmp --ptxas-options=-v\
	-O3 -use_fast_math -arch=sm_21\
	-I$(EXAFMM_INCLUDE_PATH) -I$(CUDA_INSTALL_PATH)/include -I$(CUDA_SDK_PATH)/common/inc
### CUDA flags
LFLAGS  += -L$(CUDA_INSTALL_PATH)/lib64 -L$(CUDA_SDK_PATH)/lib -lcuda -lcudart -lcutil_x86_64 -lstdc++ -ldl -lm
endif

KERNELS	= ../kernels/$(EQUATION)$(BASIS)$(DEVICE).o

.cxx.o  :
	$(CXX) -c $? -o $@ $(LFLAGS)
.cu.o   :
	$(NVCC) -c $? -o $@ $(LFLAGS)

help:
	@make -C .. help
clean:
	@make -C .. clean
cleandat:
	@make -C .. cleandat
cleanlib:
	@make -C .. cleanlib
cleanall:
	@make -C .. cleanall
commit:
	@make -C .. commit
save:
	@make -C .. save
revert:
	@make -C .. revert
docs:
	@make -C .. docs
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.