How to compile MEX binary that only works on 64 bit Linux to use it on macOS?

4 views (last 30 days)
I have a compiled MEX binary that only works on 64 bit Linux ( ) and I would like to recompile it for my system (macOS Monterey). I have MatLab compiler but I have no idea how to do it as I am fearly new to MatLab. Could anyone please give me any advice, please?
Best regards,

Accepted Answer

Walter Roberson
Walter Roberson on 8 Aug 2022
It is not necessary to cross-compile; the GIT repository includes the .cpp source code (and the .c sources needed for different .mex* files.)
Unfortunately the repository does not include a build script.
You probably start by installing XCode -- though possibly you can get away with installing the command line tools, by going into terminal and commanding
xcode-select --install
Then in MATLAB,
mex -setup C++
mex -setup C
then (I suspect)
mex str2doubleq.cpp
mex count_overlaps_fast2.c
mex hist2d_fast.c
mex projection_1d_convolutions_fast.c

More Answers (0)




Community Treasure Hunt

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

Start Hunting!