MATLAB API not working in Mac M2
Posted: Fri Apr 26, 2024 1:31 am
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
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