forked from single-cell-data/TileDB-SOMA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
113 lines (85 loc) · 2.85 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
# 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
@./scripts/bld --prefix=${prefix} --tiledb=${tiledb} --build=${build}
@TILEDB_PATH=${tiledb} pip install -v -e apis/python
.PHONY: r-build
r-build: clean
@./scripts/bld --prefix=${prefix} --tiledb=${tiledb} --build=${build} --r-build
# incremental compile and update python install
# -------------------------------------------------------------------
.PHONY: update
update:
cd build && make -j && make install-libtiledbsoma
cp dist/lib/lib* apis/python/src/tiledbsoma/
# test
# -------------------------------------------------------------------
.PHONY: test
test: data
ctest --test-dir build/libtiledbsoma -C Release --verbose --rerun-failed --output-on-failure
pytest apis/python/tests libtiledbsoma/test
.PHONY: data
data:
rm -rvf test/soco
./apis/python/devtools/ingestor \
--soco \
-o test/soco \
-n \
data/pbmc3k_processed.h5ad \
data/10x-pbmc-multiome-v1.0/subset_100_100.h5ad
# format
# -------------------------------------------------------------------
.PHONY: check-format
check-format:
@./scripts/run-clang-format.sh . clang-format 0 \
`find libtiledbsoma -name "*.cc" -or -name "*.h"`
.PHONY: format
format:
@./scripts/run-clang-format.sh . clang-format 1 \
`find libtiledbsoma -name "*.cc" -or -name "*.h"`
# clean
# -------------------------------------------------------------------
.PHONY: clean
clean:
@rm -rf build dist
.PHONY: cleaner
cleaner:
@printf "*** dry-run mode: remove -n to actually remove files\n"
git clean -ffdx -e .vscode -e test/tiledbsoma -n
# help
# -------------------------------------------------------------------
define HELP
Usage: make rule [options]
Rules:
install [options] Build C++ library and install python module
r-build [options] Build C++ static library with "#define R_BUILD" for R
update Incrementally build C++ library and update python module
test Run tests
check-format Run C++ format check
format Run C++ format
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 libtiledbsoma 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}"