I've upgraded my MATLAB to 2014b (on OS X 10.10), and tried to test some old MEX C/C++ codes.
As usual, I run mex -setup
from the command window, and I would expect to be provided the chance to overwrite the option file "meshopt.sh".
But now, it seems MATLAB has made some change and I am not allowed to change the MEX configuration, it simply says:
MEX configured to use Xcode with Clang for C language compilation,
...
to choose a different language, select one from the followingmex -setup C++ mex -setup FORTRAN
So, is it true that the old ways to modify "mexopts.sh" are no longer feasible?
When I run
mex -setup C
, I see information like the following:The
mex
part is actually a link you can click to choose that configuration. So, to make your own:H:\MATLAB\R2014b\bin\win64\mexopts\msvc2012.xml
to%AppData%\MathWorks\MATLAB\R2014b\mex_C++_win64_custom.xml
).<vars> tag
(e.g. modifyCOMPFLAGS
orCFLAGS
whatever variable has your compiler options) or the<env>
tag (e.g.PATH
,INCLUDE
,LIB
, etc.)Set that to the current configuration:
Note that a good place in Windows to keep settings is under
%APPDATA%
. For MATLAB R2014b, this would be something likeC:\Users\[yourname]\AppData\Roaming\MathWorks\MATLAB\R2014b
.Do the same for C++ or FORTRAN configurations too.
It seems that the following command works:
however, there's some warning information,
Legacy MEX infrastructure is provided for compatibility; it will be removed in a future version of MATLAB.
Apart from that, everything looks fine, except I got some warning at compile time seems due to compiler version(gcc 4.9.1) on my current system(OS X 10.10).
gcc: warning: couldn't understand kern.osversion '14.0.0