mex cc files in ubuntu system
1 回表示 (過去 30 日間)
古いコメントを表示
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
2013 年 10 月 25 日
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
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で MATLAB Compiler についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!