Thank for the hint:
I’ve changed the paths:
[codebox]# Define installation location for CUDA and compilation flags compatible
with the CUDA include files.
CUDAHOME = /usr/local/cuda
INCLUDEDIR = -I$(CUDAHOME)/include
INCLUDELIB = -L$(CUDAHOME)/lib64 -lcufft -Wl,-rpath,$(CUDAHOME)/lib64
CFLAGS = -fPIC -D_GNU_SOURCE -pthread -fexceptions
COPTIMFLAGS = -O3 -funroll-loops -msse2
Define installation location for MATLAB.
export MATLAB = /usr/local/matlab
#export MATLAB = /Applications/MATLAB_R2007b
MEX = $(MATLAB)/bin/glnxa64
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 = fft2_cuda.mexa64 \
fft2_cuda_sp_dp.mexa64 \
ifft2_cuda.mexa64 \
Szeta.mexa64
all: $(MEXFILES:.mex=$(MEXEXT))
clean:
rm -f $(MEXFILES:.mex=$(MEXEXT))
.SUFFIXES: .cu .cu_o .mexglx .mexa64 .mexmaci
.c.mexglx:
$(MEX) CFLAGS='$(CFLAGS)' COPTIMFLAGS='$(COPTIMFLAGS)' $< \
$(INCLUDEDIR) $(INCLUDELIB)
.cu.mexglx:
$(NVMEX) -f nvopts.sh $< $(INCLUDEDIR) $(INCLUDELIB)
.c.mexa64:
$(MEX) CFLAGS='$(CFLAGS)' COPTIMFLAGS='$(COPTIMFLAGS)' $< \
$(INCLUDEDIR) $(INCLUDELIB)
.cu.mexa64:
$(NVMEX) -f nvopts.sh $< $(INCLUDEDIR) $(INCLUDELIB)
.c.mexmaci:
$(MEX) CFLAGS='$(CFLAGS)' COPTIMFLAGS='$(COPTIMFLAGS)' $< \
$(INCLUDEDIR) $(INCLUDELIB)
.cu.mexmaci:
$(NVMEX) -f nvopts.sh $< $(INCLUDEDIR) $(INCLUDELIB)
[/codebox]
Then I end up with the follwing error message:
[codebox]>> unix(‘make’);
/usr/local/matlab/bin/glnxa64 CFLAGS=‘-fPIC -D_GNU_SOURCE -pthread -fexceptions’ COPTIMFLAGS=‘-O3 -funroll-loops -msse2’ fft2_cuda.c \
-I/usr/local/cuda/include -L/usr/local/cuda/lib64 -lcufft -Wl,-rpath,/usr/local/cuda/lib64
make: execvp: /usr/local/matlab/bin/glnxa64: No authorization
make: *** [fft2_cuda.mexa64]
Error 127[/codebox]
The directory /usr/local/matlab/bin/glnxa64 exists and I’ve the rights to write and execute there.
When I change mex file extensions with glx:
[codebox]MEXFILES = fft2_cuda.mexglx \
fft2_cuda_sp_dp.mexglx \
ifft2_cuda.mexglx \
Szeta.mexglx[/codebox]
then I get the following:
[codebox]>> unix(‘make’);
/usr/local/matlab/bin/glnxa64 CFLAGS=‘-fPIC -D_GNU_SOURCE -pthread -fexceptions’ COPTIMFLAGS=‘-O3 -funroll-loops -msse2’ fft2_cuda.c \
-I/usr/local/cuda/include -L/usr/local/cuda/lib64 -lcufft -Wl,-rpath,/usr/local/cuda/lib64
make: execvp: /usr/local/matlab/bin/glnxa64: No authorization
make: *** [fft2_cuda.mexglx]
Error 127[/codebox]
Does anybody has an idea what should be changed?
Thanks, OS