forked from ccsb-scripps/AutoDock-GPU
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·45 lines (43 loc) · 1.41 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
# 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
ifeq ($(DEVICE), $(filter $(DEVICE),GPU CUDA))
TEST_CUDA := $(shell ./test_cuda.sh nvcc "$(GPU_INCLUDE_PATH)" "$(GPU_LIBRARY_PATH)")
# if user specifies DEVICE=CUDA it will be used (wether the test succeeds or not)
# if user specifies DEVICE=GPU the test result determines wether CUDA will be used or not
ifeq ($(DEVICE)$(TEST_CUDA),GPUyes)
override DEVICE:=CUDA
endif
endif
ifeq ($(DEVICE),CUDA)
override DEVICE:=GPU
export
include Makefile.Cuda
else
ifeq ($(DEVICE),OCLGPU)
override DEVICE:=GPU
export
endif
include Makefile.OpenCL
endif