-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathMakefile.in
106 lines (85 loc) · 1.93 KB
/
Makefile.in
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
TARGETS = qflex
CXX = @CXX@
CXXFLAGS = @CXXFLAGS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
PREFIX = @prefix@
PYBIND11 = @pybind11@
PYTHON_TESTS = @python_tests@
OPENMP = @openmp@
ERROR_ON_WARNINGS = @error_on_warnings@
ifeq ($(ERROR_ON_WARNINGS), true)
CXXFLAGS += -Werror
endif
ifeq ($(CXX), icpc)
CXXFLAGS += -mkl -DMKL_TENSOR
else
LIBS := -lopenblas $(LIBS)
endif
ifeq ($(OPENMP), true)
ifeq ($(CXX), icpc)
CXXFLAGS += -qopenmp
else
CXXFLAGS += -fopenmp
endif
else
CXXFLAGS += -Wno-unknown-pragmas
endif
ifeq ($(PYBIND11), true)
TARGETS += pybind
endif
OBJS = ordering.o grid.o circuit.o evaluate_circuit.o tensor.o contraction_utils.o \
stopwatch.o read_circuit.o utils.o
MODULES = docopt
TESTS_MODULES = googletest
export CXX
export CXXFLAGS
export CPPFLAGS
export LDFLAGS
export LIBS
export FLAGS
export OBJS
.PHONY: all
all: $(TARGETS)
.PHONY: docopt
docopt:
-git submodule update --init --recursive src/docopt
.PHONY: googletest
googletest:
-git submodule update --init --recursive tests/src/googletest
.PHONY: qflex
qflex: $(MODULES)
$(MAKE) -C src/
.PHONY: pybind
pybind: qflex
$(MAKE) -C src/ pybind
.PHONY: tests
tests: $(TESTS_MODULES)
$(MAKE) -C tests/src/
.PHONY: run-py-tests
run-py-tests: pybind
$(MAKE) -C tests/python/ run-all
.PHONY: run-cxx-tests
run-cxx-tests: tests
$(MAKE) -C tests/src/ run-all
TESTS = run-cxx-tests
ifeq ($(PYTHON_TESTS), true)
TESTS += run-py-tests
endif
.PHONY: run-tests
run-tests: $(TESTS)
.PHONY: install
install:
@find config -type f -exec install -vD {} $(PREFIX)/share/qflex/{} \;
@find docs -type f -exec install -vD {} $(PREFIX)/share/qflex/{} \;
@install -vD src/qflex.x $(PREFIX)/bin/qflex
@find python -type f -iname "*.so" -exec install -vD {} $(PREFIX)/lib/qflex/{} \;
.PHONY: clean
clean:
-$(MAKE) -C src/ clean
-$(MAKE) -C tests/src/ clean
.PHONY: clean-all
clean-all: clean
-git submodule deinit --all
-bash scripts/clean_git.sh -y