Dear All,
I tried to interface opensim with matlab. I followed the procedure given in the documentation page( https://simtk-confluence.stanford.edu:8 ... ith+Matlab ) and running the configureOpenSim script.While running code for test that OpenSim is properly configured with MATLAB( org.opensim.modeling.opensimCommon.GetVersion() ) It failed to load the java library. My opensim install directory\ bin is in the system path. I received error mentioned below:
>> org.opensim.modeling.opensimCommon.GetVersion()
Failed to load one or more dynamic libraries for OpenSim.
java.lang.UnsatisfiedLinkError: C:\opensim 4.0\bin\osimJavaJNI.dll: Can't find dependent libraries
Make sure OpenSim's bin directory is on your PATH.
See https://simtk-confluence.stanford.edu/d ... ith+Matlab
Java exception occurred:
java.lang.UnsatisfiedLinkError: org.opensim.modeling.opensimCommonJNI.GetVersion()Ljava/lang/String;
at org.opensim.modeling.opensimCommonJNI.GetVersion(Native Method)
at org.opensim.modeling.opensimCommon.GetVersion(opensimCommon.java:25)
My opensim 4.0 is 64bit and my matlab is MATLAB R2016a 64bit. I don't have multiple versions in the system path .
Please give your suggestions to resolve this issue.
Tancks.
Vahid.
scripting with matlab
- Thomas Uchida
- Posts: 1794
- Joined: Wed May 16, 2012 11:40 am
Re: scripting with matlab
Were you able to resolve the issue? This exception is typically thrown when the bin directory is not in the Windows PATH. Another possibility is that you have built from source but didn't build the bindings. You could try following the instructions under "Having trouble? Try manual setup..." on the "Scripting with Matlab" page (https://simtk-confluence.stanford.edu/d ... ith+Matlab).
- Andrew Meyer
- Posts: 4
- Joined: Fri Sep 03, 2010 8:44 am
Re: scripting with matlab
I am having the exact same issue as Vahid. I've been using OpenSim 3.3, but want to switch to the 4.0 beta.
Things I have tried to resolve the issue:
Manually configured matlab according the the instructions found here (https://simtk-confluence.stanford.edu/d ... ith+Matlab)
Manually removed all references to previous OpenSim install in matlab path and in system environment variables.
Added the new opensim install to the system environment variables.
Removed the period and space from the opensim path.
Rebooted my computer.
Manually configured using the matlab pre-2012a instructions.
Do you have any more suggestions for me? My next step would be to reinstall both opensim and matlab.
This is the output I get in matlab:
>> org.opensim.modeling.opensimCommon.GetVersion()
Failed to load one or more dynamic libraries for OpenSim.
java.lang.UnsatisfiedLinkError: C:\OpenSim4-2018-08-27-ae111a49\bin\osimJavaJNI.dll: Can't find dependent libraries
Make sure OpenSim's bin directory is on your PATH.
See https://simtk-confluence.stanford.edu/d ... ith+Matlab
Warning: A Java exception occurred trying to load the org/opensim/modeling/opensimCommonConstants class:
Java exception occurred:
java.lang.UnsatisfiedLinkError: org.opensim.modeling.opensimCommonJNI.GET_SYSTEM_INFO_get()Ljava/lang/String;
at org.opensim.modeling.opensimCommonJNI.GET_SYSTEM_INFO_get(Native Method)
at org.opensim.modeling.opensimCommonConstants.<clinit>(opensimCommonConstants.java:12)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.mathworks.jmi.OpaqueJavaInterface.findClass(OpaqueJavaInterface.java:137)
Java exception occurred:
java.lang.UnsatisfiedLinkError: org.opensim.modeling.opensimCommonJNI.GetVersion()Ljava/lang/String;
at org.opensim.modeling.opensimCommonJNI.GetVersion(Native Method)
at org.opensim.modeling.opensimCommon.GetVersion(opensimCommon.java:25)
Things I have tried to resolve the issue:
Manually configured matlab according the the instructions found here (https://simtk-confluence.stanford.edu/d ... ith+Matlab)
Manually removed all references to previous OpenSim install in matlab path and in system environment variables.
Added the new opensim install to the system environment variables.
Removed the period and space from the opensim path.
Rebooted my computer.
Manually configured using the matlab pre-2012a instructions.
Do you have any more suggestions for me? My next step would be to reinstall both opensim and matlab.
This is the output I get in matlab:
>> org.opensim.modeling.opensimCommon.GetVersion()
Failed to load one or more dynamic libraries for OpenSim.
java.lang.UnsatisfiedLinkError: C:\OpenSim4-2018-08-27-ae111a49\bin\osimJavaJNI.dll: Can't find dependent libraries
Make sure OpenSim's bin directory is on your PATH.
See https://simtk-confluence.stanford.edu/d ... ith+Matlab
Warning: A Java exception occurred trying to load the org/opensim/modeling/opensimCommonConstants class:
Java exception occurred:
java.lang.UnsatisfiedLinkError: org.opensim.modeling.opensimCommonJNI.GET_SYSTEM_INFO_get()Ljava/lang/String;
at org.opensim.modeling.opensimCommonJNI.GET_SYSTEM_INFO_get(Native Method)
at org.opensim.modeling.opensimCommonConstants.<clinit>(opensimCommonConstants.java:12)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.mathworks.jmi.OpaqueJavaInterface.findClass(OpaqueJavaInterface.java:137)
Java exception occurred:
java.lang.UnsatisfiedLinkError: org.opensim.modeling.opensimCommonJNI.GetVersion()Ljava/lang/String;
at org.opensim.modeling.opensimCommonJNI.GetVersion(Native Method)
at org.opensim.modeling.opensimCommon.GetVersion(opensimCommon.java:25)
- Andrew Meyer
- Posts: 4
- Joined: Fri Sep 03, 2010 8:44 am
Re: scripting with matlab
Edit: I figured it out. I was adding a new environment variable to the system, rather than modifying the path variable and adding in the Opensim directory. Hope this helps if others have a similar issue.
- Tamesh Halder
- Posts: 3
- Joined: Thu May 02, 2019 10:18 pm
Re: scripting with matlab
Hi Andrew,
How you resolved this issue??
How you resolved this issue??
Re: scripting with matlab
Hi, I have just work out the same problems,the origination of this bug in my PC(x64, Win10,matlab2018b) is that I have 2 edition of opensim, so make sure there is only one dirctory in our variable Path. And I hope that will help!