Closed ronligt closed 6 months ago
Those instructions haven't yet been updated to account for the new Apple Silicon release of MATLAB. If you have the latest version of MATLAB, you likely are running it natively and not through Rosetta. So you need to build an Apple Silicon version of DIPimage, not an Intel version.
I've updated the instructions to distinguish aarch64 and x86_64 versions of MATLAB: https://github.com/DIPlib/diplib/commit/c2bf27464eef14c6337ca7cb4acd10425057dd8a
Thanks for updating the instructions!
The problem however does not relate to the Apple Silicon compilation of DIPimage. As it turns out with the latest version of FindMatlab.cmake
the same error in Matlab is generated on an Intel compilation, both on an Intel Macintosh and a M2 Macintosh with Rosetta emulation.
A quick solution for Intel compilation is to check out the previous version of FindMatlab.cmake
(https://github.com/DIPlib/diplib/commit/376fb4fd10b9b0a969a1a042fc222e6f99a87e8b) and build DIPimage. This however does not work for native Apple Silicon compilation.
It looks like there is a problem related to libMatlabEngine.dylib
and/or libMatlabDataArray.dylib
in the new version of FindMatlab.cmake
but I find it very hard to debug this in the cmake-file.
The older cmake script doesn’t work correctly with the newest MATLAB. On Intel it’s likely finding an older version.
Can you show me the output of the cmake command, with the latest version of the scripts, on aarch64?
I have your same version of MATLAB, and am able to build just fine for it.
The change to tools/FindMatlab.cmake
hidden in (totally unrelated commit) 68f4d8fc fixes this issue.
I should have been more careful in making that change as a separate commit. :(
Component DIPimage Git commit ID: c81e4933e9495044dca4fa85b786ac1c57fbac59
Describe the bug Error-message in Matlab R2023b (maca64) after calling
dipimage
:To Reproduce
addpath
dipimage
System information:
More information I've checked the output of
otool -L
in Matlab: