-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (43 loc) · 2.05 KB
/
Makefile
File metadata and controls
70 lines (43 loc) · 2.05 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
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
# Makefile
#
# author : Deborah Bard
# date : Jan., 2012
#
################################################################################
# This section contains some environment variables that you may want to edit, or
# perhaps need to edit, depending on your CUDA installation.
################################################################################
# INSTALL_DIR is where the CUDA and C executables will be installed. You may find it
# useful to install in some system-wide directory (e.g. /usr/local/bin,
# $(HOME)/bin, etc.).
INSTALL_DIR := ./
BIN := $(INSTALL_DIR)/MCeval.x
# SDK_INSTALL_PATH and CUDA_INSTALL_PATH are probably the more significant
# environment variables and will depend on your system and where the CUDA
# libraries and header files are installed.
### You will need to edit this line to point to your own cuda installation
CUDA_INSTALL_PATH := /opt/cuda-5.0
### You will need to edit this line to point to your own SDK installation
CUDA_SDK = /opt/cuda-5.0/samples
# While the INCLUDES and LIBS flags are dependent on the install path, there may
# still be some subdirectories that are machine-dependent.
INCLUDES += -I. -I$(CUDA_INSTALL_PATH)/include -I$(CUDA_SDK)/C/common/inc
LIBS := -L$(CUDA_INSTALL_PATH)/lib64 -L$(CUDA_SDK)/C/common/lib/ -L$(CUDA_SDK)/C/lib/
COMMONFLAGS := -m64
CXXFLAGS := $(COMMONFLAGS)
LDFLAGS := -lm -lcudart
# compilers
NVCC := $(CUDA_INSTALL_PATH)/bin/nvcc -arch sm_11 $(COMMONFLAGS)
CU_SOURCES := MCeval.cu
CU_OBJS := $(patsubst %.cu, %.cu_o, $(CU_SOURCES))
###############################################################################
################################################################################
# Rules for Makefile
################################################################################
%.cu_o : %.cu
$(NVCC) -c $(INCLUDES) -o $@ $^
all: ${BIN}
$(BIN): $(CPP_OBJS) $(CU_OBJS)
$(CXX) -fPIC -o $(BIN) $(CU_OBJS) $(LDFLAGS) $(INCLUDES) $(LIBS)
clean:
rm -f $(BIN) *.o *.cu_o *.cubin