Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java link error in MATLAB for artifact #3917

Open
mattpetrucci opened this issue Sep 27, 2024 · 9 comments
Open

Java link error in MATLAB for artifact #3917

mattpetrucci opened this issue Sep 27, 2024 · 9 comments
Assignees

Comments

@mattpetrucci
Copy link

Artifact number: opensim-core-4.5.1-2024-08-23-cf3ef35

When creating a model I receive this error:

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)
@aymanhab
Copy link
Member

@mattpetrucci For context, this is downloading artifact from ci rather than a released public distribution, is that correct?
Any pointer to when did this break or work in the past? Thank you

@mattpetrucci
Copy link
Author

mattpetrucci commented Sep 27, 2024

@aymanhab correct this is an artifact from CI. Unfortunately I don't have the exact artifact I was using before, but it was back in May 2024.

Also note, we got to this error after manually updating the mumps path (see issue 3916).

@carmichaelong
Copy link
Member

@aymanhab Yes this is for downloading an artifact. I went as far back as I could in GitHub Actions, but many artifacts are expired. Furthest I could go back was action 4287, which was 2024-08-09-3fa052e. When loading a model, you get the following error about loading libraries:

Failed to load one or more dynamic libraries for OpenSim.
java.lang.UnsatisfiedLinkError: /Users/carmichaelong/Downloads/opensim-core-4.5.1-2024-08-09-3fa052e/sdk/lib/libosimJavaJNI.dylib: dlopen(/Users/carmichaelong/Downloads/opensim-core-4.5.1-2024-08-09-3fa052e/sdk/lib/libosimJavaJNI.dylib, 0x0001): Library not loaded: /Users/runner/opensim_dependencies_install/mumps/lib/libcoinmumps.3.dylib
  Referenced from: <AF1BB9D6-B360-3CAD-8B1F-BDF43E95FFA7> /Users/carmichaelong/Downloads/opensim-core-4.5.1-2024-08-09-3fa052e/sdk/lib/libipopt.3.dylib
  Reason: tried: '/Users/runner/opensim_dependencies_install/mumps/lib/libcoinmumps.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/opensim_dependencies_install/mumps/lib/libcoinmumps.3.dylib' (no such file), '/Users/runner/opensim_dependencies_install/mumps/lib/libcoinmumps.3.dylib' (no such file), '/usr/local/lib/libcoinmumps.3.dylib' (no such file), '/usr/lib/libcoinmumps.3.dylib' (no such file, not in dyld cache)

It's probably some sort of rpath issue? I'll also see what the last working artifact I might have lying around is, but likely it'll be pretty far back so may not help too much to find the specific commit.

@carmichaelong
Copy link
Member

@aymanhab This is pretty coarse, but as close as I can get.

Most recent working version for me: OpenSim 4.5 release
Oldest artifact that doesn't work for me: 4.5-2024-06-28-6f6fee0

@aymanhab
Copy link
Member

If rpath then this can be fixed by setting DYLIB_LIBRARY_PATH as a workaround. Does that work?

@nickbianco
Copy link
Member

For Matt, setting DYLD_LIBRARY_PATH manually resolves the issue at #3916, but not this one.

I encounter this error on Windows (artifact opensim-core-4.5.1-2024-09-12-bd17674), but I do not encounter the error at #3916 (probably becuase you have to set the PATH manually on Windows).

@aymanhab
Copy link
Member

What I don't understand is that all the moco related libraries should not be loaded or attempted to be loaded when loading/constructing a model (if the stacktrace on top is correct).

@carmichaelong
Copy link
Member

carmichaelong commented Sep 27, 2024

Oops, that's my bad. The link error I put here should have been in #3916, not in this one. Sorry for the confusion.

If I'm reading these errors correctly, seems like there's a link issue with opensimSimulation when loading the model, even with the fix with DYLD_LIBRARY_PATH (which resolves the first issue in #3916)

@mattpetrucci
Copy link
Author

Yes to confirm the commands were:

import org.opensim.modeling.*;
m = Model();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants