You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To get this to compile on an Apple Silicon running MacOS (Sonoma 14.3) with maca64 Matlab, I had to do the following:
Change all instances of MEX= mex to MEX=/Applications/MATLAB_R20XX/bin/mex
Configure mex to have a real gcc compiler option.
Note on mac by default gcc (/usr/bin/gcc) is a symlink to clang. You'll need to install gcc from homebrew (or macports etc). gcc-11 worked for me brew install gcc@11
Type gcc-11 into terminal to check that this has installed properly.
To configure mex to use this compiler, you'll then need to add an xml file to /Applications/MATLAB_R20XX/bin/maca64/mexopts which specifies which version of gcc and the architecture. Examples for intel macs can be found here (https://github.com/danfortunato/matlab-gcc).
I cobbled this one together from the intel examples and the clang_maca64.xml that MATLAB uses by default. It worked for me but I'm not an expert in C compiler flags etc by any means so there may be some nonsensical things in there. gcc_maca64.xml.txt
(.txt added so could upload to markdown, remove this)
With this in place, run mex -setup c
and choose the gcc option you added.
Now try the typical install instructions.
make mwrap
make mex-matlab
make test-mex-matlab
Good luck!
The text was updated successfully, but these errors were encountered:
To get this to compile on an Apple Silicon running MacOS (Sonoma 14.3) with maca64 Matlab, I had to do the following:
Note on mac by default gcc (/usr/bin/gcc) is a symlink to clang. You'll need to install gcc from homebrew (or macports etc). gcc-11 worked for me
brew install gcc@11
Type gcc-11 into terminal to check that this has installed properly.
To configure mex to use this compiler, you'll then need to add an xml file to /Applications/MATLAB_R20XX/bin/maca64/mexopts which specifies which version of gcc and the architecture. Examples for intel macs can be found here (https://github.com/danfortunato/matlab-gcc).
I cobbled this one together from the intel examples and the clang_maca64.xml that MATLAB uses by default. It worked for me but I'm not an expert in C compiler flags etc by any means so there may be some nonsensical things in there.
gcc_maca64.xml.txt
(.txt added so could upload to markdown, remove this)
With this in place, run
mex -setup c
and choose the gcc option you added.
Now try the typical install instructions.
Good luck!
The text was updated successfully, but these errors were encountered: