forked from Schulik/aiolos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
59 lines (44 loc) · 1.59 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
ifeq ($(SYSTEM), intel)
CXX = icpc -std=c++17
CXXFLAGS = -Wall -Wextra -xHost -ipo #-pg or -g put compiler settings here
BFLAGS = -I. -O3 -g #or -g
else
ifeq ($(SYSTEM), clang)
CXX = clang++ -std=c++17
CXXFLAGS = -Wall -Wextra -march=native -flto #-pg or -g put compiler settings here
BFLAGS = -I. -O3 -g #or -g
else
CXX = g++ -std=c++17
CXXFLAGS = -Wall -Wextra -march=native #-flto #-pg or -g put compiler settings here
BFLAGS = -I. -O3 -fopenmp #or -g
endif
endif
CPPFLAGS = -I/usr/include/eigen3 -DNDEBUG # put pre-processor settings (-I, -D, etc) here
LDFLAGS = -lm -fopenmp # -lgsl -lgslcblas # put linker settings here
PROBLEM=default
NUM_SPECIES=Eigen::Dynamic
CPPFLAGS += -DNUM_SPECIES=$(NUM_SPECIES)
##SRC = main.cpp advection.cpp source.cpp
SRC = $(wildcard *.cpp)
SRC += problems/$(PROBLEM).cpp
OBJ = $(SRC:.cpp=.o)
INC = $(SRC:.cpp=.h)
TEST_OBJ = $(subst main.o, test_files/main.o, $(OBJ))
aiolos: $(OBJ) makefile
$(CXX) -o $@ $(OBJ) $(CXXFLAGS) $(LDFLAGS)
%.o: %.cpp makefile aiolos.h
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< $(BFLAGS) -o $@
.PHONY: tests
tests: $(TEST_OBJ) makefile aiolos.h
$(CXX) -o $@ $(TEST_OBJ) $(CXXFLAGS) $(LDFLAGS)
./tests > /dev/null
cd test_files ; python3 test_shock_tube.py -p
cd test_files ; python3 test_steady_state.py
cd test_files ; python3 test_drag.py
cd test_files ; python3 test_dustywave.py -p
cd test_files ; python3 test_dustyshock.py -p
cd test_files ; python3 test_conservation.py
cd test_files ; python3 test_irradiation.py -p
cd test_files ; python3 test_coll_heating.py
clean:
rm -f *.o test_files/*.o problems/*.o test_files/*dat