-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
54 lines (42 loc) · 1.47 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
.PHONY: build check install python clean conda docker
# Set the plugin version from the git tags
export PLUGIN_VERSION=$(shell git describe --tags --dirty)
PLUGIN_CUDA_VERSION ?= 10.0
PLUGIN_DEVICE ?= 0
PLUGIN_CUDA_LABEL = cuda$(shell echo $(PLUGIN_CUDA_VERSION) | sed 's/\.//g')
PLUGIN_DOCKER_IMAGE = openmm-tensorrt-$(PLUGIN_CUDA_LABEL)
BUILD_DIR=build
build:
mkdir -p $(BUILD_DIR) &&\
cd $(BUILD_DIR) &&\
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$(CONDA_PREFIX) \
-DEXTRA_COMPILE_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" \
-DOPENMM_DIR=$(CONDA_PREFIX) \
&&\
make -j
check: build
make -C $(BUILD_DIR) test
install: check
make -C $(BUILD_DIR) install
python: install
make -C $(BUILD_DIR) PythonInstall CFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"
clean:
$(RM) -r $(BUILD_DIR)
conda:
conda build conda/openmm-tensorrt \
$(CONDA_CHANNEL_LIST) \
--python $(PYTHON_VERSION)
docker_image:
nvidia-docker build --tag $(PLUGIN_DOCKER_IMAGE) \
--build-arg UID=$(shell id --user) \
--build-arg GID=$(shell id --group) \
--build-arg PLUGIN_CUDA_VERSION=$(PLUGIN_CUDA_VERSION) \
--build-arg PLUGIN_CUDA_LABEL=$(PLUGIN_CUDA_LABEL) \
docker
docker: docker_image
NV_GPU=$(PLUGIN_DEVICE) \
nvidia-docker run --tty --interactive --rm \
--volume $(shell pwd):/home/user/openmm-tensorrt.git \
$(PLUGIN_DOCKER_IMAGE)