pytorch
/
Makefile
55 строк · 1.2 Кб
1# This makefile does nothing but delegating the actual building to cmake.
2PYTHON = python3
3PIP = $(PYTHON) -m pip
4NIGHTLY_TOOL_OPTS := pull
5
6all:
7@mkdir -p build && cd build && cmake .. $(shell $(PYTHON) ./scripts/get_python_cmake_flags.py) && $(MAKE)
8
9local:
10@./scripts/build_local.sh
11
12android:
13@./scripts/build_android.sh
14
15ios:
16@./scripts/build_ios.sh
17
18clean: # This will remove ALL build folders.
19@rm -r build*/
20
21linecount:
22@cloc --read-lang-def=caffe.cloc caffe2 || \
23echo "Cloc is not available on the machine. You can install cloc with " && \
24echo " sudo apt-get install cloc"
25
26ensure-branch-clean:
27@if [ -n "$(shell git status --porcelain)" ]; then \
28echo "Please commit or stash all changes before running this script"; \
29exit 1; \
30fi
31
32setup-env: ensure-branch-clean
33$(PYTHON) tools/nightly.py $(NIGHTLY_TOOL_OPTS)
34
35setup-env-cuda:
36$(MAKE) setup-env PYTHON="$(PYTHON)" NIGHTLY_TOOL_OPTS="$(NIGHTLY_TOOL_OPTS) --cuda"
37
38setup_env: setup-env
39setup_env_cuda: setup-env-cuda
40
41setup-lint:
42$(PIP) install lintrunner
43lintrunner init
44
45setup_lint: setup-lint
46
47lint:
48lintrunner
49
50quicklint:
51lintrunner
52
53triton:
54$(PIP) uninstall -y triton
55@./scripts/install_triton_wheel.sh
56