我試圖運行在以下網址的源代碼: https://code.google.com/p/deep-learning-faces/source/checkoutMakefile中使用CUDA和MATLAB
我運行它在那裏安裝了MATLAB和CUDA 6的服務器上,但是當我做
make all
它返回以下錯誤:
make: *** No rule to make target `fft2_cuda.mexa64', needed by `all'. Stop.
這是Makefile中的樣子:
# 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)/lib -lcufft -Wl,-rpath,$(CUDAHOME)/lib
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/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 = fft2_cuda.mex \
fft2_cuda_sp_dp.mex \
ifft2_cuda.mex \
Szeta.mex
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)
順便說一句,做
which matlab
回報
/usr/local/bin/matlab
所以,我試圖改變MATLAB目錄在Makefile文件,但它也不能工作。
有人能幫我嗎?
您是否在MATLAB中調用'make'?這是[readme說明](https://code.google.com/p/deep-learning-faces/source/browse/trunk/Matlab_Cuda_1.1/README.txt#49)。 –
@ m.s。這是否意味着我必須在執行matlab後調用make?我試着在matlab中調用make,但是它表示未定義的函數。 – ytrewq
執行** unix('make'); ** from MATLAB –