opensim-org / opensim-core

SimTK OpenSim C++ libraries and command-line applications, and Java/Python wrapping.
https://opensim.stanford.edu
Apache License 2.0
800 stars 323 forks source link

Java bindings fails on Windows with Matlab 2024b after building from source #3958

Open nickbianco opened 2 weeks ago

nickbianco commented 2 weeks ago

Reported by Amir Esrafilian. After building OpenSim from source at main on Windows 11, installing the Java bindings (built using openjdk 23), and running configureOpenSim.m, trying to construct a model fails with the typical DLL load failure error:

Failed to load one or more dynamic libraries for OpenSim.
java.lang.UnsatisfiedLinkError: D:\Git_Win\EMG_COMAK\EMG-Assisted-COMAK-install\bin\osimJavaJNI.dll: A dynamic link library (DLL) initialization routine failed
Make sure OpenSim's bin directory is on your PATH.
See https://simtk-confluence.stanford.edu/display/OpenSim40/Scripting+with+Matlab
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)

We confirmed that osimJavaJNI.dll exists in the bin folder, and that the bin folder is prepended to the system Path variable.

Currently investigating whether this is an issue with Matlab 2024b or something else.

nickbianco commented 2 weeks ago

Installing the OpenSim 4.5 distribution via configureOpenSim.m works successfully.

aymanhab commented 2 weeks ago

jdk version lust match whatever version used by matlab or they need to be compatible.

aymanhab commented 1 week ago

For the record, local build works out of the box without issue on R2022a update 8

aymanhab commented 1 week ago

Will try the artifact built on ci using coretto as java sdk here https://github.com/opensim-org/opensim-core/pull/3965