forked from ccsb-scripps/AutoDock-GPU
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
executable file
·62 lines (59 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
# AutoDock-GPU Makefile
# ------------------------------------------------------
# Note that environment variables must be defined
# before compiling
# DEVICE?
# if DEVICE=CPU: CPU_INCLUDE_PATH?, CPU_LIBRARY_PATH?
# if DEVICE=GPU: GPU_INCLUDE_PATH?, GPU_LIBRARY_PATH?
#
# Cuda will be automatically detect and used as the
# when these conditions are true:
# - DEVICE=CUDA *XOR*
# - DEVICE=GPU *AND*
# - nvcc exists *AND*
# - GPU_INCLUDE_PATH =<path to Cuda includes> *AND*
# - GPU_LIBRARRY_PATH=<path to Cuda libraries> *AND*
# - a test code (including cuda_runtime_api.h,
# and linking to -lcuda and -lcudart) is
# succesfully compiled
# in any other case, OpenCL will be used
# OpenCL GPU path can be explicitly used with
# DEVICE=OCLGPU
# ------------------------------------------------------
# Choose OpenCL device
# Valid values: CPU, GPU, CUDA, OCLGPU, OPENCL
OVERLAP = ON
ifeq ($(DEVICE), $(filter $(DEVICE),GPU CUDA))
TARGETS_SUPPORTED := $(shell ./test_cuda.sh nvcc "$(GPU_INCLUDE_PATH)" "$(GPU_LIBRARY_PATH)" "$(TARGETS)" "$(DEVICE)")
# if user specifies DEVICE=GPU the test result determines wether CUDA will be used or not
ifeq ($(TARGETS_SUPPORTED),)
ifeq ($(DEVICE),CUDA)
$(error Cuda verification failed)
else
$(info Cuda is not available, using OpenCL)
$(info )
override DEVICE:=GPU
export
endif
else
override TARGETS:=$(TARGETS_SUPPORTED)
export
override DEVICE:=CUDA
endif
endif
ifeq ($(DEVICE),CUDA)
override DEVICE:=GPU
export
include Makefile.Cuda
else
ifeq ($(DEVICE),$(filter $(DEVICE),OCLGPU OPENCL))
override DEVICE:=GPU
export
$(info Using OpenCL)
$(info )
endif
$(info Please make sure to set environment variables)
$(info GPU_INCLUDE_PATH and GPU_LIBRARY_PATH)
$(info )
include Makefile.OpenCL
endif