필터 지우기
필터 지우기

Changing Makefile to ensure MEX points to matlab mex binary

조회 수: 2 (최근 30일)
Naseer Khan
Naseer Khan 2016년 11월 17일
댓글: Joss Knight 2016년 11월 24일
I have downloaded a repository from the following link
to run the code it is mentioned that " Edit matconvnet/Makefile to ensure MEX points to your matlab mex binary."
So I opened the Makefile in vi and found following lines of code to edit
*Makefile contents*
*Now my question is where to locate matlab mex binary path?*
*My effort*
I did following command in my ssh shell environment
locate matlab | grep mex
Still not getting how to edit MEX path in Makefile so that it points to matlab mex binary also How to use ENABLE_GPU?
  댓글 수: 5
Naseer Khan
Naseer Khan 2016년 11월 18일
Please tell me the specifics so that, that code could get run?
Joss Knight
Joss Knight 2016년 11월 24일
This isn't really a MATLAB question, it's a question for the author of the package you're trying to use. The location of the 'mex executable' is the "bin" directory of your MATLAB installation. But what is going on here is that you need to understand more about the software you are trying to use in order to replicate the results.
Try contacting the author, reading the MatConvNet documentation, and reading the MATLAB documentation on MEX. Once you are more familiar with all the tools involved, you may have some more pertinent and specific MATLAB questions that you can bring back to this forum.

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

답변 (1개)

Walter Roberson
Walter Roberson 2016년 11월 18일
The mex script location is
fullfile(matlabroot, 'bin', 'mex')
  댓글 수: 2
Naseer Khan
Naseer Khan 2016년 11월 19일
I am getting now following error after updating the path
naseerkhan@dfki-seecs:~/MS/textspotting/jaderberg-textspot/matconvnet/matlab/mex$ cd ..
naseerkhan@dfki-seecs:~/MS/textspotting/jaderberg-textspot/matconvnet/matlab$ cd \
> ^C
naseerkhan@dfki-seecs:~/MS/textspotting/jaderberg-textspot/matconvnet/matlab$ d /
d: command not found
naseerkhan@dfki-seecs:~/MS/textspotting/jaderberg-textspot/matconvnet/matlab$ cd ..
naseerkhan@dfki-seecs:~/MS/textspotting/jaderberg-textspot/matconvnet$ cd ..
naseerkhan@dfki-seecs:~/MS/textspotting/jaderberg-textspot$ ls
data fig_charmap.m fig_detmap.m imshowc.m LICENSE load_nostruct.m matconvnet models README.md reproduce_classifier_results.m
naseerkhan@dfki-seecs:~/MS/textspotting/jaderberg-textspot$ clear
naseerkhan@dfki-seecs:~/MS/textspotting/jaderberg-textspot$ ls
data fig_charmap.m fig_detmap.m imshowc.m LICENSE load_nostruct.m matconvnet models README.md reproduce_classifier_results.m
naseerkhan@dfki-seecs:~/MS/textspotting/jaderberg-textspot$ cd matconvnet/ && make
/usr/local/MATLAB/R2016a/bin/mex -c -lmwblas -largeArrayDims "matlab/src/bits/im2col.cpp"
Building with 'g++'.
Warning: You are using gcc version '4.9.3'. The version of gcc is not supported. The version currently supported with MEX is '4.7.x'. For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release.
MEX completed successfully.
mv -f "im2col.o" "matlab/src/bits/im2col.o"
/usr/local/MATLAB/R2016a/bin/mex -c -lmwblas -largeArrayDims "matlab/src/bits/pooling.cpp"
Building with 'g++'.
Warning: You are using gcc version '4.9.3'. The version of gcc is not supported. The version currently supported with MEX is '4.7.x'. For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release.
MEX completed successfully.
mv -f "pooling.o" "matlab/src/bits/pooling.o"
/usr/local/MATLAB/R2016a/bin/mex -c -lmwblas -largeArrayDims "matlab/src/bits/normalize.cpp"
Building with 'g++'.
Warning: You are using gcc version '4.9.3'. The version of gcc is not supported. The version currently supported with MEX is '4.7.x'. For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release.
MEX completed successfully.
mv -f "normalize.o" "matlab/src/bits/normalize.o"
echo "#include \"../src/gconv.cu\"" > "matlab/mex/gconv.cpp"
/usr/local/MATLAB/R2016a/bin/mex -lmwblas -largeArrayDims \
"matlab/mex/gconv.cpp" matlab/src/bits/im2col.o matlab/src/bits/pooling.o matlab/src/bits/normalize.o \
-o "matlab/mex/gconv.mexa64" \
2> >(sed 's/^\(.*\)(\([0-9][0-9]*\)): \([ew].*\)/\1:\2: \3/g' >&2)
Unknown MEX argument '-o'.
Makefile:71: recipe for target 'matlab/mex/gconv.mexa64' failed
make: *** [matlab/mex/gconv.mexa64] Error 255
rm matlab/src/bits/im2col.o matlab/src/bits/normalize.o matlab/src/bits/pooling.o
naseerkhan@dfki-seecs:~/MS/textspotting/jaderberg-textspot/matconvnet$
Walter Roberson
Walter Roberson 2016년 11월 20일
-output <resultname>
Create mex-file named <resultname>. The appropriate mex-file
extension is automatically appended. Overrides mex's default
mex-file naming mechanism.
So try changing the -o "matlab/mex/gconv.mexa64" to -output "matlab/mex/gconv"

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

카테고리

Help CenterFile Exchange에서 Manage Products에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by