forked from MatthewRHermes/mrh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
345 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
|
||
# Definition of MACROS | ||
|
||
BASE_LIBGPU=../../src | ||
|
||
BINROOT=./ | ||
EXE=a.out | ||
SHELL=/bin/sh | ||
CXX = g++ | ||
CXXFLAGS= | ||
FC=gfortran | ||
FCFLAGS= | ||
LD = $(CXX) | ||
LDFLAGS = -fPIC -shared | ||
AR = ar rcs | ||
CPP = cpp -P -traditional | ||
INSTALL=../ | ||
|
||
CUDA_CXX = nvcc | ||
CUDA_CXXFLAGS = | ||
|
||
ARCH ?= polaris-gnu-nvcc | ||
include $(BASE_LIBGPU)/arch/$(ARCH) | ||
|
||
CXXFLAGS += -I$(BASE_LIBGPU) | ||
CUDA_CXXFLAGS += -I$(BASE_LIBGPU) | ||
|
||
$(info ARCH is [${ARCH}]) | ||
|
||
# -- subset of src files with cuda kernels | ||
CUDA_SRC = pm_cuda.cpp offload.cpp | ||
CUDA_OBJ = $(CUDA_SRC:.cpp=.o) | ||
|
||
CSRC = $(filter-out $(CUDA_SRC), $(wildcard *.cpp)) | ||
INC = $(wildcard *.h) | ||
COBJ = $(CSRC:.cpp=.o) | ||
|
||
FSRC = $(wildcard *.F) | ||
MOD = $(FSRC:.F=.mod) | ||
FOBJ = $(FSRC:.F=.o) | ||
|
||
# -- only copy source files; headers referenced with compiler flag | ||
$(shell cp ../../src/pm*.cpp ./) | ||
|
||
# | ||
# -- target : Dependencies | ||
# -- Rule to create target | ||
|
||
$(EXE): $(COBJ) $(CUDA_OBJ) $(FOBJ) $(MOD) | ||
$(LD) $(LDFLAGS) -o $@ $(COBJ) $(CUDA_OBJ) $(LIB) | ||
|
||
install: $(EXE) | ||
cp $(EXE) $(INSTALL) | ||
# cp $(MOD) $(FOBJ) $(INSTALL)/include | ||
|
||
#################################################################### | ||
|
||
$(COBJ): %.o: %.cpp | ||
$(CXX) $(CXXFLAGS) -c $< | ||
|
||
$(FOBJ): %.o: %.F90 | ||
$(FC) $(FCFLAGS) -c $< | ||
|
||
$(MOD): %.mod: %.F90 | ||
$(FC) $(FCFLAGS) -c $< | ||
|
||
$(CUDA_OBJ): %.o: %.cpp | ||
$(CUDA_CXX) -x cu $(CUDA_CXXFLAGS) -c $< -o $@ | ||
|
||
# | ||
# -- Remove *.o and *~ from the directory | ||
clean: | ||
rm -f *.o *.mod *~ ./$(EXE) | ||
rm -f $(INSTALL)/$(EXE) | ||
rm -rf $(EXE).dSYM | ||
# | ||
# -- Remove *.o, *~, and executable from the directory | ||
realclean: | ||
rm -f *.o *.mod *~ ./$(EXE) | ||
rm -f $(INSTALL)/$(EXE) | ||
rm -rf $(EXE).dSYM | ||
rm -f *.optrpt | ||
rm -f pm*.h pm*.cpp | ||
|
||
# | ||
# -- Simple dependencies |
Oops, something went wrong.