-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
117 lines (86 loc) · 3.05 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
.PHONY: clone checkout co pull
.PHONY: build install uninstall clean
HOST:=$(shell uname -s | tr A-Z a-z)
CHANNEL?=NECLA-ML
all: build
## Environment
conda-install:
wget -O $(HOME)/Downloads/Miniconda3-latest-Linux-x86_64.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
sh $(HOME)/Downloads/Miniconda3-latest-Linux-x86_64.sh -b -p $(HOME)/miniconda3
rm -fr $(HOME)/Downloads/Miniconda3-latest-Linux-x86_64.sh
conda-env: $(HOME)/miniconda3
eval "`$(HOME)/miniconda3/bin/conda shell.bash hook`" && conda env create -n $(ENV) -f $(ENV).yml
conda-setup: $(HOME)/miniconda3
echo '' >> $(HOME)/.bashrc
echo 'eval "`$$HOME/miniconda3/bin/conda shell.bash hook`"' >> $(HOME)/.bashrc
echo conda activate $(ENV) >> $(HOME)/.bashrc
echo '' >> $(HOME)/.bashrc
echo export EDITOR=vim >> $(HOME)/.bashrc
echo export PYTHONDONTWRITEBYTECODE=1 >> $(HOME)/.bashrc
conda: conda-install conda-env conda-setup
eval `$(HOME)/miniconda3/bin/conda shell.bash hook` && conda env list
echo Restart your shell to create and activate conda environment "$(ENV)"
## Conda Distribution
conda-index:
conda index /zdata/projects/shared/conda/geteigen
conda-clean:
conda clean --all
## Optional Dependencies
install-mmdet:
# cd submodules/mmdetection; pip install -e .
pip install "git+https://github.com/open-mmlab/mmdetection"
## Submoduless
setup-deep-sort:
cd submodules/deep_sort; \
git config pull.rebase false; \
git remote add upstream https://github.com/nwojke/deep_sort
pull-deep-sort:
cd submodules/deep_sort; \
git pull; \
git fetch upstream; \
git checkout main; \
git merge upstream/main;
## Local Development
LOCAL_TORCH_CUDA_ARCH_LIST := $(shell python -c "import torch as th; print('.'.join(map(str, th.cuda.get_device_capability(th.cuda.default_stream().device))))")
dev:
git config --global credential.helper cache --timeout=21600
git checkout dev
make co
dev-setup-local: dev
TORCH_CUDA_ARCH_LIST=$(LOCAL_TORCH_CUDA_ARCH_LIST) \
pip install -vv --force-reinstall --no-deps --no-build-isolation --no-binary :all: -e .
dev-setup: dev
pip install -vv --force-reinstall --no-deps --no-build-isolation --no-binary :all: -e .
dev-clean:
pip uninstall $$(basename -s .git `git config --get remote.origin.url`)
python setup.py clean --all
## VCS
require-version:
ifndef version
$(error version is undefined)
endif
clone:
git clone --recursive $(url) $(dest)
checkout:
git submodule update --init --recursive
#cd submodules/mmdetection; git clean -fd; git $@ -f v2.1.0
branch=$$(git symbolic-ref --short HEAD); \
echo $$branch; \
git submodule foreach -q --recursive "git checkout $$(git config -f $$toplevel/.gitmodules submodule.$$name.branch || echo $$branch)"
co: checkout
pull: co
git submodule update --remote --merge --recursive
git pull
merge:
git checkout main
git merge dev
git push
tag: require-version
git checkout main
git tag -a v$(version) -m v$(version)
git push origin tags/v$(version)
del-tag:
git tag -d $(tag)
git push origin --delete tags/$(tag)
release:
git checkout $(git describe --abbrev=0 --tags)