-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
83 lines (60 loc) · 2.4 KB
/
Makefile
File metadata and controls
83 lines (60 loc) · 2.4 KB
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
PYTEST = py.test
TEST_BASE_DIR = test
UNIT_TEST_DIR = $(TEST_BASE_DIR)/unit
REGRESSION_TEST_DIR = $(TEST_BASE_DIR)/regression
TESTHARNESS = $(REGRESSION_TEST_DIR)/testharness.py
BACKENDS ?= sequential opencl openmp cuda mpi_sequential
OPENCL_ALL_CTXS := $(shell scripts/detect_opencl_devices)
OPENCL_CTXS ?= $(OPENCL_ALL_CTXS)
SPHINX_DIR = doc/sphinx
SPHINX_BUILD_DIR = $(SPHINX_DIR)/build
SPHINX_TARGET = html
SPHINX_TARGET_DIR = $(SPHINX_BUILD_DIR)/$(SPHINX_TARGET)
MESHES_DIR = demo/meshes
all: ext
.PHONY : help test unit regression doc update_docs ext ext_clean meshes
help:
@echo "make COMMAND with COMMAND one of:"
@echo " test : run unit and regression tests"
@echo " unit : run unit tests"
@echo " unit_BACKEND : run unit tests for BACKEND"
@echo " regression : run regression tests"
@echo " regression_BACKEND : run regression tests for BACKEND"
@echo " doc : build sphinx documentation"
@echo " update_docs : build sphinx documentation and push to GitHub"
@echo " ext : rebuild Cython extension"
@echo " ext_clean : delete generated extension"
@echo " meshes : download demo meshes"
@echo
@echo "Available OpenCL contexts: $(OPENCL_CTXS)"
test: unit regression
unit: $(foreach backend,$(BACKENDS), unit_$(backend))
unit_mpi_%:
@echo Not implemented
unit_%:
cd $(UNIT_TEST_DIR); $(PYTEST) --backend=$*
unit_opencl:
cd $(UNIT_TEST_DIR); for c in $(OPENCL_CTXS); do PYOPENCL_CTX=$$c $(PYTEST) --backend=opencl; done
regression: $(foreach backend,$(BACKENDS), regression_$(backend))
regression_mpi_%:
$(TESTHARNESS) -p parallel --backend=$*
regression_%:
$(TESTHARNESS) --backend=$*
regression_opencl:
for c in $(OPENCL_CTXS); do PYOPENCL_CTX=$$c $(TESTHARNESS) --backend=opencl; done
doc:
make -C $(SPHINX_DIR) $(SPHINX_TARGET)
update_docs:
if [ ! -d $(SPHINX_TARGET_DIR)/.git ]; then \
mkdir -p $(SPHINX_BUILD_DIR); \
cd $(SPHINX_BUILD_DIR); git clone `git config --get remote.origin.url` $(SPHINX_TARGET); \
fi
cd $(SPHINX_TARGET_DIR); git fetch -p; git checkout -f gh-pages; git reset --hard origin/gh-pages
make -C $(SPHINX_DIR) $(SPHINX_TARGET)
cd $(SPHINX_TARGET_DIR); git commit -am "Update documentation"; git push origin gh-pages
ext: ext_clean
python setup.py build_ext -i
ext_clean:
rm -rf build pyop2/op_lib_core.c pyop2/op_lib_core.so
meshes:
make -C $(MESHES_DIR) meshes