hello
I am trying to use mtimesx on matlab 2016a, windows 10 64-bit, but I get the error " A C/C++ compiler has not been selected with mex -setup error" and understand I should change mexopts = [prefdir '\mexopts.bat']; in mtimesx_build.m to mexopts = [prefdir '\mex_C++_win64.xml']; but in path C:\Users\..\AppData\Roaming\MathWorks\MATLAB\R2016a this xml dosent exit, how could I complime this library?
Thank you

답변 (2개)

James Tursa
James Tursa 2016년 6월 20일

1 개 추천

TMW changed the way the mex function operates a couple of years ago. Unfortunately at that time I did not have access to recent MATLAB versions so I never got around to updating the automatic build code in my FEX submission. I still don't have access to the latest versions, but in the meantime maybe you can work with a stripped down version that is basically a manual compile with no checking. You may have to manually edit the paths etc to get it to work on your machine. Hopefully in the future I will be able to fix up the automated build process.
function mtimesx_build_new
mexargs{1} = 'mtimesx.c';
mexargs{2} = '-largeArrayDims';
mexargs{3} = '-DCOMPILER=UNKNOWN'; % Edit with your compiler or leave as is
% You may need to edit this section to get the directories set properly for
% your machine. The below is for Windows, and assumes lcc for 32-bit.
comp = computer;
mext = mexext;
lc = length(comp);
lm = length(mext);
cbits = comp(max(1:lc-1):lc);
mbits = mext(max(1:lm-1):lm);
if( isequal(cbits,'64') || isequal(mbits,'64') )
compdir = 'win64';
libdir = 'microsoft';
else
compdir = 'win32';
libdir = 'lcc';
end
lib_blas = [matlabroot '\extern\lib\' compdir '\' libdir '\libmwblas.lib'];
d = dir(lib_blas);
if( isempty(d) )
disp('... BLAS library file not found, so linking with the LAPACK library');
lib_blas = [matlabroot '\extern\lib\' compdir '\' libdir '\libmwlapack.lib'];
end
disp(['... Using BLAS library lib_blas = ''' lib_blas '''']);
mexargs{4} = lib_blas;
% The compile
mex(mexargs{:});
return
end

댓글 수: 1

If your compiler is OpenMP compliant (which it looks like it is), you might also throw in this option:
mexargs{5} = 'COMPFLAGS="$COMPFLAGS /openmp"';

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

Walter Roberson
Walter Roberson 2016년 6월 19일

0 개 추천

First install a compiler, and then execute
mex -setup C++
at the command line. For Windows 10 and R2016a, you will need MingW, or Microsoft Visual C++ 2015 Professional, or Intel Parallel Studio XE 2016 for C/C++, or Intel Parallel Studio XE 2015 for C/C++

댓글 수: 2

armita mani
armita mani 2016년 6월 19일
thank you for your answer, I use Microsoft Visual C++ 2015 Professional but it didn't work .is it incompatible with matlab 2016a?
Walter Roberson
Walter Roberson 2016년 6월 19일
My understanding is that product is compatible with R2016a on Windows 10.

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

카테고리

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

태그

질문:

2016년 6월 19일

댓글:

2016년 6월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by