-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
155 lines (124 loc) · 4.33 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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# This Makefile captures common developer build and test use cases.
MAKEFLAGS += --no-print-directory
# print help by default
help:
# install
# -------------------------------------------------------------------
# set default variable values, if non-null
build ?= Release
.PHONY: install
install: clean
mkdir -p libtiledbvcf/build && \
cd libtiledbvcf/build && \
cmake .. -DCMAKE_BUILD_TYPE=${build} && \
make -j && make install-libtiledbvcf
pip install -v apis/python[test,dev]
# incremental compile and update python install
# -------------------------------------------------------------------
.PHONY: update
update:
cd libtiledbvcf/build && make -j && make -j install-libtiledbvcf
pip install -v apis/python[test,dev]
# test
# -------------------------------------------------------------------
.PHONY: test
test:
cd libtiledbvcf/build && make -j check
cd libtiledbvcf/test && ./run-cli-tests.sh ../build/ ./inputs/
cd apis/java && ./gradlew assemble test
cd apis/spark && ./gradlew assemble test
pytest apis/python
python -c "import tiledbvcf; print(tiledbvcf.version)"
# docs
# -------------------------------------------------------------------
.PHONY: notebooks
notebooks:
@for f in `find examples -name "*.ipynb"`; do \
jupyter nbconvert --execute --to=notebook --inplace $$f; \
done
.PHONY: docs
docs:
@ln -sf apis/python/src/tiledbvcf
quartodoc build
@rm tiledbvcf
quarto render --fail-if-warnings
# format
# -------------------------------------------------------------------
.PHONY: check-format
check-format:
@./ci/run-clang-format.sh . clang-format 0 \
`find libtiledbvcf/src -name "*.cc" -or -name "*.h"`
@./ci/run-clang-format.sh . clang-format 0 \
`find libtiledbvcf/test -name "*.cc" -or -name "*.h"`
.PHONY: format
format:
@./ci/run-clang-format.sh . clang-format 1 \
`find libtiledbvcf/src -name "*.cc" -or -name "*.h"`
@./ci/run-clang-format.sh . clang-format 1 \
`find libtiledbvcf/test -name "*.cc" -or -name "*.h"`
# venv
# -------------------------------------------------------------------
.PHONY: venv
venv:
@if [ ! -d venv ]; then \
python3.9 -m venv venv; \
venv/bin/pip install --upgrade pip; \
fi
@printf "Run the following command to activate the venv:\nsource venv/bin/activate\n"
# docker
# -------------------------------------------------------------------
.PHONY: docker
docker:
docker build -t tiledbvcf-cli:dev -f docker/Dockerfile-cli . && \
docker run --rm -t tiledbvcf-cli:dev version && \
docker build -t tiledbvcf-py:dev -f docker/Dockerfile-py . && \
docker run --rm -t tiledbvcf-py:dev -c "import tiledbvcf; print(tiledbvcf.version)"
# wheel
# -------------------------------------------------------------------
.PHONY: wheel
wheel: clean
docker run --rm -v `pwd`:/io quay.io/pypa/manylinux_2_28_x86_64 /io/apis/python/build-wheels.sh
sudo chown -R ${USER}:$(id -gn) .
# clean
# -------------------------------------------------------------------
.PHONY: clean
clean:
@rm -rf libtiledbvcf/build dist apis/python/build
.PHONY: cleaner
cleaner:
@printf "*** dry-run mode: remove -n to actually remove files\n"
git clean -ffdx -e .vscode -e dev -e venv -n
# help
# -------------------------------------------------------------------
define HELP
Usage: make rule [options]
Rules:
install [options] Build C++ library and install python module
update Incrementally build C++ library and update python module
test Run tests
notebooks Execute notebooks and update cell outputs
docs Render the documentation
docker Build and test docker images
check-format Run C++ format check
format Run C++ format
venv Create a virtual environment
wheel Build python wheel
clean Remove build artifacts
Options:
build=BUILD_TYPE Cmake build type = Release|Debug|RelWithDebInfo|Coverage [Release]
prefix=PREFIX Install location [${PWD}/dist]
tiledb=TILEDB_DIST Absolute path to custom TileDB build
Examples:
Install Release build
make install
Install Debug build of libtiledbvcf and libtiledb
make install build=Debug
Install Release build with custom libtiledb
make install tiledb=$$PWD/../TileDB/dist
Incrementally build C++ changes and update the python module
make update
endef
export HELP
.PHONY: help
help:
@printf "$${HELP}"