-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
72 lines (55 loc) · 1.88 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
71
72
################################################################################
#
# Build script for project
#
################################################################################
ARCH := sm_52
# Add source files here
EXECUTABLE := culsp
# CUDA source files (compiled with cudacc)
CUFILES := culsp.cu
# CUDA dependency files
CU_DEPS := culsp_kernel.cu
# C/C++ source files (compiled with gcc / c++)
CCFILES := periodogram.cpp
################################################################################
# Rules and targets
NVCC=nvcc
CXX=g++
CC=gcc
#include ../../common/common.mk
#include /usr/src/nvidia-352-352.68/nvidia-modules-common.mk
cuda_lib=/usr/local/cuda/lib64
cuda_inc=/usr/local/cuda/include
python_inc=/usr/include/python2.7
BLOCK_SIZE=256
NVCCFLAGS := -Xcompiler -fpic --ptxas-options=-v -DBLOCK_SIZE=$(BLOCK_SIZE) -arch $(ARCH)
CXXFLAGS := -fPIC -DBLOCK_SIZE=$(BLOCK_SIZE)
LINK := -largtable2 -lm -lcudart -L$(cuda_lib)
all : $(EXECUTABLE)
$(EXECUTABLE): culsp.o periodogram.o
$(CXX) $(CXXFLAGS) -o $(EXECUTABLE) $^ $(LINK)
periodogram.o : periodogram.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $^
periodogram_nomain.o : periodogram.cpp
$(CXX) -Dmain=oldmain $(CXXFLAGS) -c -o $@ $^
culsp.o : culsp.cu
$(NVCC) $(NVCCFLAGS) -c -o $@ $^ -I$(cuda_inc)
culsp_wrap.o : culsp_wrap.cpp
$(CXX) -fPIC $(CXXFLAGS) -c -o $@ $^ -I$(python_inc)
python : culsp_wrap.o culsp.o periodogram_nomain.o
$(CXX) -fPIC $(CXXFLAGS) -shared -o _culspy.so $^ $(LINK) -lpython2.7
#mkdir culspy
#mv culspy.py culspy/
#mv _culspy.so culspy/
#touch culspy/__init__.py
#testminmax.o : testminmax.cu
# $(NVCC) $(NVCCFLAGS) -c -o $@ $^ -I$(cuda_inc)
#testmax : testminmax.o
# $(CXX) $(CXXFLAGS) -o $@ $^ -lm -lcudart -L$(cuda_lib)
clean : clean-python
rm -f *o $(EXECUTABLE)
#clean-testmax :
# rm -f testmax testminmax.o
clean-python:
rm -r -f *pyc *so CuLSP* dist/ build/ culspy.py