/normxcorr/trunk

To get this branch, use:
bzr branch http://suren.me/webbzr/normxcorr/trunk
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
# Define installation location for CUDA and compilation flags compatible
# with the CUDA include files.
CUDAHOME    = /opt/cuda
INCLUDEDIR  = -I$(CUDAHOME)/include
INCLUDELIB  = -L$(CUDAHOME)/lib -lcufft -lcublas -lcudpp64 -Wl,-rpath,$(CUDAHOME)/lib
CFLAGS      = -fPIC -D_GNU_SOURCE -pthread -fexceptions -Wall
COPTIMFLAGS = -O3 -funroll-loops -msse2

OBJECTS	    = local_sum.cu
HEADERS	    = normxcorr_hw.h normxcorr_hw_kernel.cu local_sum_kernel.cu

# Define installation location for MATLAB.
export MATLAB = /opt/Matlab
#export MATLAB = /Applications/MATLAB_R2007b
MEX           = $(MATLAB)/bin/mex
MEXEXT        = .$(shell $(MATLAB)/bin/mexext)

# nvmex is a modified mex script that knows how to handle CUDA .cu files.
NVMEX = ./nvmex

# List the mex files to be built.  The .mex extension will be replaced with the
# appropriate extension for this installation of MATLAB, e.g. .mexglx or
# .mexa64.
MEXFILES = normxcorr_hw.mex

all: $(MEXFILES:.mex=$(MEXEXT))

normxcorr_hw.mexa64: $(OBJECTS) $(HEADERS)


clean:
	rm -f $(MEXFILES:.mex=$(MEXEXT)) $(MEXFILES:.mex=.linkinfo)

.SUFFIXES: .cu .cu_o .mexglx .mexa64 .mexmaci

.c.mexglx:
	$(MEX) CFLAGS='$(CFLAGS)' COPTIMFLAGS='$(COPTIMFLAGS)' $< \
        $(INCLUDEDIR) $(INCLUDELIB)

.cu.mexglx:
	$(NVMEX) -f nvopts.sh $< $(OBJECTS) $(INCLUDEDIR) $(INCLUDELIB)

.c.mexa64:
	$(MEX) CFLAGS='$(CFLAGS)' COPTIMFLAGS='$(COPTIMFLAGS)' $< \
        $(INCLUDEDIR) $(INCLUDELIB)

.cu.mexa64: 
	$(NVMEX) -v -f nvopts.sh $< $(OBJECTS) $(INCLUDEDIR) $(INCLUDELIB)

.c.mexmaci:
	$(MEX) CFLAGS='$(CFLAGS)' COPTIMFLAGS='$(COPTIMFLAGS)' $< \
        $(INCLUDEDIR) $(INCLUDELIB)

.cu.mexmaci: 
	$(NVMEX) -f nvopts.sh $< $(OBJECTS) $(INCLUDEDIR) $(INCLUDELIB)