MATLAB API not working in Mac M2

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Vittorio Sanguineti
Posts: 1
Joined: Tue Aug 14, 2018 12:26 am

MATLAB API not working in Mac M2

Post by Vittorio Sanguineti » 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

Tags:

User avatar
Oliver Demuth
Posts: 4
Joined: Mon Nov 27, 2023 8:10 am

Re: MATLAB API not working in Mac M2

Post by Oliver Demuth » Mon Apr 29, 2024 12:48 am

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

POST REPLY