Hi,
I am building a peripheral (NLopt library) on an Ubuntu machine where the MATLAB plugin that gets built needs to know the location of MEX. aka:
./configure MEX=/path/to/mex
Where is MEX actually located?

댓글 수: 4

Jan
Jan 2013년 2월 21일
What exactly is "MEX"? There is a Perl script, a Matlab script or perhaps it means the compiled MEX-Function?
I assume that you are looking at this:
Right? Can you build a simple Mex file in MATLAB? There is an example here:
If it fails try building with
mex -v timestwo.c
And post the output here.
Connie
Connie 2013년 2월 24일
hmm. Well I think that at least shows what the problem is, even if I have the MEX variable correct. I will try installing a secondary gcc version to see if that does better.
You are using gcc version "4.6.3-1ubuntu5)". The version currently supported with MEX is "4.4.6". For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release/
Connie
Connie 2013년 2월 24일
Cool. Well that solved this problem (I can get the timestwo(4) stuff to work), so I'll mark the below as answered. Unfortunately, the program still can't find matlab or compile its c code
checking for extension of compiled mex files... mexa64 checking for matlab... no
with a bunch of other c errors, but closer.

댓글을 달려면 로그인하십시오.

 채택된 답변

Ryan Livingston
Ryan Livingston 2013년 2월 21일

0 개 추천

There is usually a shell script in
$MATLABROOT/bin/mex
where $MATLABROOT is the output of
matlabroot
in MATLAB. This should be marked executable and can be invoked as such.

댓글 수: 3

Connie
Connie 2013년 2월 21일
hmmm. That is the correct location I think for the binary, but not liked by this program. It must be looking for something else or other files associated with mex.
checking for mex... /home/connie/MATLAB/R2012b/bin/ checking for extension of compiled mex files... configure: WARNING: /home/connie/MATLAB/R2012b/bin/ failed to compile a simple file; won't compile Matlab plugin
Richard
Richard 2014년 3월 23일
Hi Connie, your problem is that you're using MEX=/home/connie/MATLAB/R2012b/bin/ instead of:
./configure MEX=/home/connie/MATLAB/R2012b/bin/mex
Hope that helps.
ZHUJUN SHI
ZHUJUN SHI 2018년 1월 29일
Hi I got the same problem ' failed to compile a simple file; won't compile Matlab plugin'. Would you mind sharing how you solved this problem?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

제품

태그

질문:

2013년 2월 21일

댓글:

2018년 1월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by