Connecting OpenSim4.5 and Matlab

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Yiming Zhao
Posts: 1
Joined: Tue Oct 15, 2024 2:33 pm

Connecting OpenSim4.5 and Matlab

Post by Yiming Zhao » Sun Nov 17, 2024 3:19 pm

Hello,

I am trying to connect OpenSim 4.5 and Matlab (R2024b-Intel version) on my Mac book. Below is the issue I encountered:
Java exception occurred:
java.lang.NoClassDefFoundError: Could not initialize class org.opensim.modeling.opensimCommonJNI
at org.opensim.modeling.opensimCommon.GetVersion(opensimCommon.java:25)

I have tried both automatic (configureOpenSim script) and manual ways, but neither worked. I have also added the OpenSim bin path to system path (I don't know if this is relevant to MacOS but I did it anyways).

The configuration script worked fine with my windows laptop.

I really appreciate any suggestions provided.

Many thanks,
Yiming

Tags:

User avatar
Nicholas Bianco
Posts: 1056
Joined: Thu Oct 04, 2012 8:09 pm

Re: Connecting OpenSim4.5 and Matlab

Post by Nicholas Bianco » Tue Nov 26, 2024 11:20 am

Hi Yiming,

What type of processor does your Macbook have? Is it an Intel-based processor (x86_64) or an M1/M2/M3 (Arm64) processor?

Have you tried installing OpenSim on an older version of Matlab?

Best,
Nick

User avatar
Nicholas Bianco
Posts: 1056
Joined: Thu Oct 04, 2012 8:09 pm

Re: Connecting OpenSim4.5 and Matlab

Post by Nicholas Bianco » Tue Nov 26, 2024 11:32 am

Note that there may currently be a bug related to installing OpenSim with Matlab 2024b: https://github.com/opensim-org/opensim-core/issues/3958.

User avatar
Rodrigo Mateus
Posts: 57
Joined: Thu Feb 22, 2018 3:07 am

Re: Connecting OpenSim4.5 and Matlab

Post by Rodrigo Mateus » Wed Nov 27, 2024 4:43 pm

I'm curious. Were you able to solve this issue?

User avatar
Evan Dooley
Posts: 35
Joined: Sun Nov 24, 2019 11:17 am

Re: Connecting OpenSim4.5 and Matlab

Post by Evan Dooley » Thu Dec 05, 2024 10:19 am

Hello,

I am also wondering if there's any progress on this. I am on a MacBook as well (Chip = Apple M3 Max, OS = Sequioa 15.1.1) running Matlab 2024b. I am getting a similar error:

Code: Select all

>> org.opensim.modeling.opensimCommon.GetVersion()
Failed to load one or more dynamic libraries for OpenSim.
java.lang.UnsatisfiedLinkError: no osimJavaJNI in java.library.path: [/Applications/MATLAB_R2024b.app/bin/maca64, /Applications/MATLAB_R2024b.app/sys/jxbrowser/maca64/lib, /Applications/OpenSim 4.5/bin]

Java exception occurred:
java.lang.UnsatisfiedLinkError: 'void
org.opensim.modeling.opensimCommonJNI.swig_module_init()'
	at org.opensim.modeling.opensimCommonJNI.swig_module_init(Native Method)
	at org.opensim.modeling.opensimCommonJNI.<clinit>(opensimCommonJNI.java:3242)
	at org.opensim.modeling.opensimCommon.GetVersion(opensimCommon.java:25)
Looking through the paths for java.library.path in the terminal I cannot find the folder "jxbrowser" under "/Applications/MATLAB_R2024b.app/sys/" and the osimJavaJNI.dll does not appear in the other two folders listed.
Attachments
Screenshot 2024-12-05 at 11.49.51 AM.png
Screenshot 2024-12-05 at 11.49.51 AM.png (97.88 KiB) Viewed 1123 times

User avatar
Evan Dooley
Posts: 35
Joined: Sun Nov 24, 2019 11:17 am

Re: Connecting OpenSim4.5 and Matlab

Post by Evan Dooley » Thu Dec 05, 2024 12:05 pm

I started looking further through the forum and found the suggestion is to use the Matlab version for Intel chips even if the chip on your mac is one of their M chips.
viewtopicPhpbb.php?f=91&t=18829&p=51308 ... bcf823d1d4

POST REPLY