-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
111 lines (82 loc) · 4.07 KB
/
Makefile.am
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
AUTOMAKE_OPTIONS = subdir-objects
.PHONY: bench bench-json
# DEPENDENCIES
$(srcdir)/benchmark/.git:
cd $(srcdir) && git submodule update --init --remote benchmark
$(srcdir)/benchmark/build: $(srcdir)/benchmark/.git
mkdir -p $(srcdir)/benchmark/build
$(srcdir)/benchmark/build/src/libbenchmark.a: $(srcdir)/benchmark/build
cd $(srcdir)/benchmark/build && \
cmake -DCMAKE_BUILD_TYPE=Release -DBENCHMARK_DOWNLOAD_DEPENDENCIES=on ../ && \
make -j
$(srcdir)/cnpy/.git:
cd $(srcdir) && git submodule update --init --remote cnpy
$(srcdir)/cnpy/build: $(srcdir)/cnpy/.git
mkdir -p $(srcdir)/cnpy/build
$(srcdir)/cnpy/build/libcnpy.a: $(srcdir)/cnpy/build
cd $(srcdir)/cnpy/build && \
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=off ../ && \
make -j
# STATE SPACE RENDERER
BUILT_SOURCES = $(srcdir)/benchmark/build/src/libbenchmark.a $(srcdir)/cnpy/build/libcnpy.a
bin_PROGRAMS = test_system test_solver test_renderer solver_benchmark system_benchmark
LDADD = -lblas -l:libcnpy.a -lz
AM_CPPFLAGS =
AM_LDFLAGS = -std=c++11 -pthread -L$(srcdir)/cnpy/build/
if ON_ARM64
AM_CPPFLAGS += -I/Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Headers
AM_LDFLAGS += -framework Accelerate
endif
test_system_SOURCES = tests/test_system.cpp src/state_space_system.cpp src/utils.cpp
test_system_DEPENDENCIES = $(srcdir)/cnpy/build/libcnpy.a system_file
test_solver_SOURCES = tests/test_solver.cpp src/state_space_system.cpp src/solver.cpp src/utils.cpp
test_solver_DEPENDENCIES = $(srcdir)/cnpy/build/libcnpy.a system_file
test_renderer_SOURCES = tests/test_renderer.cpp src/state_space_system.cpp src/renderer.cpp src/solver.cpp src/utils.cpp
test_renderer_DEPENDENCIES = $(srcdir)/cnpy/build/libcnpy.a system_file
test_renderer_LDADD = $(LDADD) -ljack
solver_benchmark_SOURCES = src/solver_benchmark.cpp src/state_space_system.cpp src/solver.cpp src/utils.cpp
solver_benchmark_CPPFLAGS = $(AM_CPPFLAGS) -isystem $(srcdir)/benchmark/include
solver_benchmark_LDFLAGS = $(AM_LDFLAGS) -L$(srcdir)/benchmark/build/src
solver_benchmark_LDADD = $(LDADD) -lbenchmark
solver_benchmark_DEPENDENCIES = $(srcdir)/benchmark/build/src/libbenchmark.a $(srcdir)/cnpy/build/libcnpy.a benchmark_files
system_benchmark_SOURCES = src/system_benchmark.cpp src/state_space_system.cpp src/utils.cpp
system_benchmark_CPPFLAGS = $(AM_CPPFLAGS) -isystem $(srcdir)/benchmark/include
system_benchmark_LDFLAGS = $(AM_LDFLAGS) -L$(srcdir)/benchmark/build/src
system_benchmark_LDADD = $(LDADD) -lbenchmark
system_benchmark_DEPENDENCIES = $(srcdir)/benchmark/build/src/libbenchmark.a $(srcdir)/cnpy/build/libcnpy.a benchmark_files
# PYTHON
VENVDIR = $(builddir)/venv
VENVBIN = $(VENVDIR)/bin/activate
venv: $(srcdir)/systems/requirements.txt
$(PYTHON) -m venv $(VENVDIR)
. $(VENVBIN) && pip install -U pip && pip install -r $(srcdir)/systems/requirements.txt
touch venv
system_file: venv $(srcdir)/systems/create_system.py
mkdir -p $(builddir)/systems
. $(VENVBIN) && which python && python $(srcdir)/systems/create_system.py --shape 4 3 5
benchmark_files: venv $(srcdir)/systems/create_benchmark_systems.py
mkdir -p $(builddir)/systems/benchmark
. $(VENVBIN) && python $(srcdir)/systems/create_benchmark_systems.py
# BENCHMARKS
bench: solver_benchmark
./solver_benchmark
bench-json: solver_benchmark
./solver_benchmark --benchmark_time_unit=ms --benchmark_format=json | tee benchmark_result.json
. $(VENVBIN) && python $(srcdir)/parse_json.py
tests: test_system test_solver system_file
./test_solver systems/n4p3m5d16doublegeneral.npz General
./test_solver systems/n4p3m5d16doubletriangular.npz Triangular
./test_solver systems/n4p3m5d16doublediagonal.npz Diagonal
./test_solver systems/n4p3m5d16doubletridiagonal.npz Tridiagonal
./test_solver systems/n4p3m5d16doublemixedhessenberg.npz MixedHessenberg
./test_solver systems/n4p3m5d16doublefullhessenberg.npz FullHessenberg
# CLEAN
clean-system:
-rm systems/*.npz
-rm -rf systems/benchmark
clean-local:
-rm -rf $(VENVDIR)
-rm systems/*.npz
-rm -rf systems/benchmark
-rm -rf $(srcdir)/benchmark
-rm -rf $(srcdir)/cnpy