/normxcorr/trunk

To get this branch, use:
bzr branch http://suren.me/webbzr/normxcorr/trunk

« back to all changes in this revision

Viewing changes to cuda/Makefile

  • Committer: Suren A. Chilingaryan
  • Date: 2009-01-15 13:50:29 UTC
  • Revision ID: csa@dside.dyndns.org-20090115135029-wleapicg9a4593tp
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Define installation location for CUDA and compilation flags compatible
 
2
# with the CUDA include files.
 
3
CUDAHOME    = /opt/cuda
 
4
INCLUDEDIR  = -I$(CUDAHOME)/include
 
5
INCLUDELIB  = -L$(CUDAHOME)/lib -lcufft -lcublas -Wl,-rpath,$(CUDAHOME)/lib
 
6
CFLAGS      = -fPIC -D_GNU_SOURCE -pthread -fexceptions -Wall
 
7
COPTIMFLAGS = -O3 -funroll-loops -msse2
 
8
 
 
9
# Define installation location for MATLAB.
 
10
export MATLAB = /opt/Matlab
 
11
#export MATLAB = /Applications/MATLAB_R2007b
 
12
MEX           = $(MATLAB)/bin/mex
 
13
MEXEXT        = .$(shell $(MATLAB)/bin/mexext)
 
14
 
 
15
# nvmex is a modified mex script that knows how to handle CUDA .cu files.
 
16
NVMEX = ./nvmex
 
17
 
 
18
# List the mex files to be built.  The .mex extension will be replaced with the
 
19
# appropriate extension for this installation of MATLAB, e.g. .mexglx or
 
20
# .mexa64.
 
21
MEXFILES = normxcorr_hw.mex
 
22
 
 
23
all: $(MEXFILES:.mex=$(MEXEXT))
 
24
 
 
25
clean:
 
26
        rm -f $(MEXFILES:.mex=$(MEXEXT)) $(MEXFILES:.mex=.linkinfo)
 
27
 
 
28
.SUFFIXES: .cu .cu_o .mexglx .mexa64 .mexmaci
 
29
 
 
30
.c.mexglx:
 
31
        $(MEX) CFLAGS='$(CFLAGS)' COPTIMFLAGS='$(COPTIMFLAGS)' $< \
 
32
        $(INCLUDEDIR) $(INCLUDELIB)
 
33
 
 
34
.cu.mexglx:
 
35
        $(NVMEX) -f nvopts.sh $< $(INCLUDEDIR) $(INCLUDELIB)
 
36
 
 
37
.c.mexa64:
 
38
        $(MEX) CFLAGS='$(CFLAGS)' COPTIMFLAGS='$(COPTIMFLAGS)' $< \
 
39
        $(INCLUDEDIR) $(INCLUDELIB)
 
40
 
 
41
.cu.mexa64:
 
42
        $(NVMEX) -v -f nvopts.sh $< $(INCLUDEDIR) $(INCLUDELIB)
 
43
 
 
44
.c.mexmaci:
 
45
        $(MEX) CFLAGS='$(CFLAGS)' COPTIMFLAGS='$(COPTIMFLAGS)' $< \
 
46
        $(INCLUDEDIR) $(INCLUDELIB)
 
47
 
 
48
.cu.mexmaci:
 
49
        $(NVMEX) -f nvopts.sh $< $(INCLUDEDIR) $(INCLUDELIB)