-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (32 loc) · 1.23 KB
/
Makefile
File metadata and controls
43 lines (32 loc) · 1.23 KB
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
# Makefile for neurips xai workshop code
# Type "make" or "make all" to build the complete development environment
# Type "make help" for a list of commands
# Type "make clean" to clean the venv
# Variables for the Makefile
.PHONY = all clean
SHELL := /bin/bash
VIRTUAL_ENV_TARGET := mnn
# Makefile commands, see below for actual builds
## all : build the venv
all: virtual_env install_torch
## clean : remove venv
clean:
-rm -rf mnn
## help : show all commands.
# Note the double '##' in the line above: this is what's matched to produce
# the list of commands.
help : Makefile
@sed -n 's/^## //p' $<
## virtual_env : Install/update a virtual environment with needed packages
virtual_env: $(VIRTUAL_ENV_TARGET)
install_torch:
source mnn/bin/activate; \
pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html || pip install torch==1.10.2 torchvision==0.11.2;
# Actual Target work here
$(VIRTUAL_ENV_TARGET):
python -m venv mnn; \
source mnn/bin/activate; \
pip install --upgrade pip; \
pip install setuptools --upgrade; \
pip install -r requirements.txt; \
python -m ipykernel install --user --name mnn --display-name "mnn";