-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
42 lines (33 loc) · 1003 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
DIR_MAIN = ./
DIR_BUILD = $(DIR_MAIN)build/
DIR_H = $(DIR_BUILD)include/
DIR_OBJ = $(DIR_BUILD)obj/
DIR_SRC = $(DIR_BUILD)src/
DEBUG =
OPTIMIZATION = -O2 -funroll-loops -finline-functions
FLOWTRACE =
CFLAGS = $(DEBUG) $(OPTIMIZATION) $(FLOWTRACE)
COMPILER = mpicxx
LIBS = -lfftw3_mpi -lfftw3 -lgsl -lgslcblas
INCLUDES = -I build/include/
CPP := $(wildcard $(DIR_SRC)*.cpp)
OBJ = $(CPP:$(DIR_SRC)%.cpp=$(DIR_OBJ)%.o)
EXE =\
mpisolve
$(EXE): $(OBJ)
echo "Linking: $@ ($(COMPILER))"
$(COMPILER) -o $@ $^ $(LIBS)
$(DIR_OBJ)%.o: $(DIR_SRC)%.cpp
@[ -d $(DIR_OBJ) ] || mkdir -p $(DIR_OBJ)
@echo "Compiling: $< ($(COMPILER))"
$(COMPILER) $(CFLAGS) $(INCLUDES) -c -o $@ $<
run:
mpirun -np 8 --use-hwthread-cpus mpisolve
# clean up misc files
clean:
@echo "Object files and executable deleted"
if [ -d "$(DIR_OBJ)" ]; then rm -f $(EXE) $(DIR_OBJ)/*; rmdir $(DIR_OBJ); fi
cleandata:
@echo "Output and log files deleted"
./scripts/cleandatafiles.sh
.SILENT :