What mex compiler can I use on my Macbook Pro 2017?

조회 수: 5 (최근 30일)
Lisa Taylor
Lisa Taylor 2024년 7월 31일
댓글: Lisa Taylor 2024년 8월 1일
I have some software which utilizes a couple mex functions, compiled from .c files. They were compiled on a windows computer and so only work on Windows. I'm updating the software to work on other platforms, so I need to re-compile the c files on my mac to make mex functions that are compatible with mac. To do this, I need a compiler that's compatible with mac. As far as I can tell, the only compiler I can get for free is Xcode.
However, when I try to install Xcode, I can't. It is not compatible with anything before MacOS 14. Yet when I try to download MacOS 14 Sonoma, I can't because it's not compatible with my computer, only with Macbook Pro 2018 and later.
So my question is, how can I compile .c files into mex functions on my macbook pro 2017? Is there any free compiler out there that will do the job?

채택된 답변

SACHIN KHANDELWAL
SACHIN KHANDELWAL 2024년 7월 31일
I understand that you want to compile C files into MEX files on a MacBook. MATLAB requires you to install a supported C or Fortran compiler along with Xcode (on macOS with Intel chips) or Microsoft Visual Studio (on Windows).
Here is the list of System Requirements and Supported Compilers for all operating systems (Windows, Linux, and Mac): https://www.mathworks.com/support/requirements/previous-releases.html
Refer to the following documentation to understand the setup of MEX: https://www.mathworks.com/help/matlab/ref/mex.html
I hope the above information helps in resolving the query that you have reported. Thank you!
  댓글 수: 1
Lisa Taylor
Lisa Taylor 2024년 8월 1일
Thank you, I found a way to download and use old versions of xcode rather than the version in the apple store and then was able to use it as my compiler.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by