-
Notifications
You must be signed in to change notification settings - Fork 31
/
Makefile
88 lines (71 loc) · 1.73 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
.PHONY: sdist clean uninstall install-deps install test style quality
WITH_CUDA=
CUDA_ARCH=
WORKERS=
VERBOSE=
RELEASE=
check_dirs := src/natten tests tools scripts setup.py
all: clean uninstall fetch-submodules install
full: clean uninstall install-deps fetch-submodules install
install-deps:
@echo "Recognized python bin:"
@which python3
pip install -r requirements.txt
install-release-deps:
pip3 install twine
fetch-submodules:
@echo "Fetching all third party submodules"
git submodule update --init --recursive
build-wheels:
./dev/packaging/build_all_wheels_parallel.sh
build-dist:
@echo "Generating source dist"
python3 setup.py sdist
release:
twine upload --repository ${RELEASE} dist/*
clean:
@echo "Cleaning up"
rm -rf dist/
rm -rf natten.egg-info/
rm -rf src/natten/_C.*
rm -rf src/natten/libnatten.*
rm -rf __pycache__
rm -rf tests/__pycache__
rm -rf src/__pycache__
rm -rf src/natten/__pycache__
rm -rf src/natten.egg*
rm -rf install.out
uninstall:
@echo "Uninstalling NATTEN"
pip uninstall -y natten
install:
@echo "Installing NATTEN from source"
NATTEN_CUDA_ARCH="${CUDA_ARCH}" \
NATTEN_N_WORKERS="${WORKERS}" \
NATTEN_WITH_CUDA="${WITH_CUDA}" \
NATTEN_VERBOSE="${VERBOSE}" \
pip install -v -e . 2>&1 | tee install.out
test:
pytest -v -x ./tests
style:
ufmt format $(check_dirs)
flake8 $(check_dirs)
mypy $(check_dirs)
find csrc/include/ \
-iname \*.h -o \
-iname \*.cpp -o \
-iname \*.cuh -o \
-iname \*.cu -o \
-iname \*.hpp -o \
-iname \*.c -o \
-iname \*.cxx | xargs \
clang-format -i
find csrc/src/ \
-iname \*.h -o \
-iname \*.cpp -o \
-iname \*.cuh -o \
-iname \*.cu -o \
-iname \*.hpp -o \
-iname \*.c -o \
-iname \*.cxx | xargs \
clang-format -i