Page 1 of 1

MATLAB API not working in Mac M2

Posted: Fri Apr 26, 2024 1:31 am
by vsangui
Hi,
I am trying to use the MATLAB API on a MacBook Air with an Apple M2 CPU (macOS Sonoma 14.4.1).
OpenSIm works fine and the API Installation proceeds correctly, but when trying to access the functions I get the following message:

>> model = org.opensim.modeling.Model()
Failed to load one or more dynamic libraries for OpenSim.
java.lang.UnsatisfiedLinkError: /Applications/OpenSim 4.5/OpenSim 4.5.app/Contents/Resources/opensim/sdk/lib/libosimJavaJNI.dylib: dlopen(/Applications/OpenSim 4.5/OpenSim 4.5.app/Contents/Resources/opensim/sdk/lib/libosimJavaJNI.dylib, 0x0001): tried: '/Applications/OpenSim 4.5/OpenSim 4.5.app/Contents/Resources/opensim/sdk/lib/libosimJavaJNI.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Applications/OpenSim 4.5/OpenSim 4.5.app/Contents/Resources/opensim/sdk/lib/libosimJavaJNI.dylib' (no such file), '/Applications/OpenSim 4.5/OpenSim 4.5.app/Contents/Resources/opensim/sdk/lib/libosimJavaJNI.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))
Java exception occurred:
java.lang.UnsatisfiedLinkError:
org.opensim.modeling.opensimSimulationJNI.new_Model__SWIG_0()J
at
org.opensim.modeling.opensimSimulationJNI.new_Model__SWIG_0(Native
Method)
at org.opensim.modeling.Model.<init>(Model.java:840)


Does it mean that OpenSim MATLAB API installation does not support the newer Macs (Apple M1, M2 CPU?)

It would be great if you could indicate if there are workarounds.

Vittorio Sanguineti

Re: MATLAB API not working in Mac M2

Posted: Mon Apr 29, 2024 12:48 am
by oedemuth
You will need to install the maci64 version of Matlab. Apple Silicon is not yet supported, see here: viewtopicPhpbb.php?f=91&t=17519&p=0&sta ... a8c7e5d16e