-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
executable file
·62 lines (47 loc) · 1.73 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
CFLAGS=-std=c++14 #-fsanitize=address -fno-omit-frame-pointer #-fno-sanitize-address-use-after-scope
LDFLAGS=-lstdc++
# List of sources and objects (include all .cpp files)
SOURCES=$(shell find ./src -name "*.cpp")
OBJECTS=$(SOURCES:.cpp=.o)
TARGET=waterpaths
EXECUTABLE=$(TARGET)
LIB_DIR=./lib
LIBS=-static-libasan -lm
all: $(SOURCES) $(TARGET)
###### Make arguments to toggle WaterPaths development features on and off. ######
# -DBORG_INPUT_FILE_DEBUG: activate some verbose to ease debugging how decision #
# variables from optimization are coupled with the input file. #
# -DPROFILE: activate Valgrind's import and instrumentation start and end. #
##################################################################################
borg: CC=mpicxx
borg: LIBS += -lborgms
borg: CFLAGS += -DPARALLEL -fopenmp -march=native -O2
borg: all
gcc: CC=g++
gcc: CFLAGS+=-O2 -march=native -fopenmp
gcc: all
intel: CC=icc
intel: CFLAGS+=-O2 ${TACC_VEC_FLAGS} -qopenmp
intel: all
gcc-debug: CC=g++
gcc-debug: CFLAGS+=-Og -march=native -g -fopenmp
gcc-debug: all
intel-debug: CC=icc
intel-debug: CFLAGS+=-O1 -xAVX -g -qopenmp
intel-debug: all
pchecking: CC=icc
pchecking: CFLAGS+=-O0 ${TACC_VEC_FLAGS} -g -traceback -check-pointers=rw -check-pointers-undimensioned -check-pointers-dangling=all -rdynamic -qopenmp
pchecking: all
prof: CFLAGS += -fopenmp -pg
prof: all
# How to make objects and executables
.cpp.o:
$(CC) -c $(CFLAGS) $^ -o $@
$(TARGET): $(OBJECTS)
$(CC) -I. $(LDFLAGS) $(OBJECTS) $(CFLAGS) -o $@ -L$(LIB_DIR) $(LIBS) $(DEFINES)
clean:
rm -rf $(shell find . -name "*.o") $(EXECUTABLE)
rm -rf $(shell find . -name "*.optrpt") $(EXECUTABLE)
clean-aux:
rm -rf $(shell find . -name "*~")
rm -rf $(shell find . -name "*.*swp")