mex cc files in ubuntu system

I've download some code online. The makefile is like following:
all: cascade fconv_var_dim
cascade: cascade.cc model.cc model.h
mex -O -o cascade \
CXXOPTIMFLAGS="-O3 -DNDEBUG -fomit-frame-pointer" \
LDOPTIMFLAGS="-O3" \
CXXFLAGS="\$$CXXFLAGS -Wall" \
LDFLAGS="\$$LDFLAGS -Wall" \
cascade.cc model.cc
fconv_var_dim: fconv_var_dim.cc
mex -O -o fconv_var_dim \
CXXOPTIMFLAGS="-O3 -DNDEBUG -fomit-frame-pointer" \
LDOPTIMFLAGS="-O3" \
CXXFLAGS="\$$CXXFLAGS -Wall" \
LDFLAGS="\$$LDFLAGS -Wall" \
fconv_var_dim.cc
clean:
rm *.mex*
I use command !make to run in Matlab. But it gives me the following error:
mex -O -o cascade \
CXXOPTIMFLAGS="-O3 -DNDEBUG -fomit-frame-pointer" \
LDOPTIMFLAGS="-O3" \
CXXFLAGS="\$CXXFLAGS -Wall" \
LDFLAGS="\$LDFLAGS -Wall" \
cascade.cc model.cc
mex: unrecognized option '-O'
mex: option '-o' is ambiguous; possibilities: '--output-comment' '--output-directory' '--output-format'
This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
entering extended mode
! I can't find file `cascade'.
<*> cascade
CXXOPTIMFLAGS=-O3 -DNDEBUG -fomit-frame-pointer LDOPTIMFLAGS=-O3...
(Press Enter to retry, or Control-D to exit)
Please type another input file name:
Thanks

답변 (1개)

Zack Peters
Zack Peters 2013년 10월 25일

0 개 추천

Hi Zhang,
Regarding the "I can't find file 'cascade'." error, the filename is 'cascade.cc' not 'cascade'. Try adding '.cc' extension to the MEX command and try MEXing again.
With regards to the -O and -o messages, I believe that they are used to turn on compiler optimizations which are already on by default. You may want to try removing both options to remove the other messages.
If it is not a case of adding the extension, perhaps it is due to the cascade.cc not being in ether the current directory or on the system path? would you try putting the cascade.cc in the same directory as the makefile that you are using?
~Zack

카테고리

도움말 센터File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

태그

질문:

2013년 10월 25일

답변:

2013년 10월 25일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by