-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
72 lines (53 loc) · 1.8 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
63
64
65
66
67
68
69
70
##########################################
# INPUT
##########################################
CXX=g++
DEFINES=-DWB_USE_CUDA
DEFINES+=-DWB_USE_CUSTOM_MALLOC -DWB_USE_COURSERA
CUDA_TOOLKIT_PATH=/scr/dakkak/usr/cuda
CUDA_TOOLKIT_PATH=/usr/local/cuda
CXX_FLAGS=-fPIC -x c++ -O3 -I . -I $(CUDA_TOOLKIT_PATH)/include
CXX_FLAGS+=-L $(HOME)/usr/lib -L $(HOME)/usr/cuda/lib -Wall -lcuda -lcudart -lcudadevrt
CXX_FLAGS+=-I$(HOME)/usr/cuda/include -I$(HOME)/usr/include
CXX_FLAGS+=-I$(CUDA_TOOLKIT_PATH)/include -L/usr/local/cuda/lib64
CXX_FLAGS+=-I$(CUDA_TOOLKIT_PATH)/include -L/usr/local/cuda/lib64/stubs
CXX_FLAGS+=$(DEFINES)
LIBS=-lm -lcuda -lcudart -L$(HOME)/usr/lib -L$(CUDA_TOOLKIT_PATH)/lib64 -lcudadevrt -L$(CUDA_TOOLKIT_PATH)/lib64/stubs
ARCH=$(shell uname -s)-x86_64
##########################################
##########################################
SOURCES := wbArg.cpp \
wbExit.cpp \
wbExport.cpp \
wbFile.cpp \
wbImage.cpp \
wbImport.cpp \
wbInit.cpp \
wbLogger.cpp \
wbMemoryManager.cpp \
wbPPM.cpp \
wbSandbox.cpp \
wbCUDA.cpp \
wbSolution.cpp \
wbSparse.cpp \
wbTimer.cpp
##############################################
# OUTPUT
##############################################
EXES = libwb.a libwb.so
.SUFFIXES : .o .cpp
OBJECTS = $(SOURCES:.cpp=.o)
##############################################
# OUTPUT
##############################################
.cpp.o:
$(CXX) $(DEFINES) $(CXX_FLAGS) -c -o $@ $<
libwb.so: $(SOURCES)
mkdir -p $(ARCH)
$(CXX) -fPIC -shared $(LIBS) -o $(ARCH)/$@ $(SOURCES) $(DEFINES) $(CXX_FLAGS)
libwb.a: $(OBJECTS)
mkdir -p $(ARCH)
ar rcs $(ARCH)/$@ $(OBJECTS)
clean:
rm -fr $(ARCH)
-rm -f $(EXES) *.o *~