Page 1 of 1

Getting opensim-gui to work on Linux

Posted: Fri Oct 15, 2021 6:08 am
by sietse
Hello List,

I am trying to get opensim-gui installed on linux, debian 11 (bullseye), and I am almost there.

I now have a more or less working version of opensim-gui with 2 or 3 issues. First I will shortly describe where I
deviated from the README's in opensim-core and opensim-gui, and then I will describe the remaining issues.


OpenSim-core (on debian 11 and Ubuntu 20.04):
Dependencies:
- gcc-9 instead of gcc-10 (probably not relevant)
- openjdk-8
Using the superbuild:
Set ezc3d to ON (probably not relevant)

The main build:
In ccmake I set JAVA_WRAPPING and PYTHON_WRAPPING to ON, and OPENSIM_C3D_PARSER to ezc3d
make -j8
cmake -j8
There where about 22 failures in 134 tests, mostly with the Moco tests. I don't know how to interpret that.
The last time I did the build there were also about 10 popup windows with exactly the same error:

Failed to load one or more dynamic libraries for Opensim.
java.lang.UnsatisfiedLinkError: /home/sietse/Software/OpenSim/opensim-core-source/build/libosimJavaJNI.so: /home/sietse/Software/OpenSim/opensim-core-source/build/libosimJavaJNI.so: undefined symbol: _ZN7OpenSim14C3DFileAdapter7_forcesB5cxx11E
(seems to be the same problem that I mention below.)

make -j8 install
Now the command line tools seem to work!
I did a short test with a CMC example.

Opensim-gui (on debian 11):
- install netbeans-12.5
- mkdir build_dep; cd build_dep
- cmake ../ -DCMAKE_INSTALL_PREFIX=~/Software/OpenSim/opensim-gui-install \
-DAnt_EXECUTABLE="/usr/local/netbeans-12.5/netbeans/extide/ant/bin/ant"\
-DANT_ARGS="-Dnbplatform.default.netbeans.dest.dir=/usr/local/netbeans-12.5/netbeans;-Dnbplatform.default.harness.dir=/usr/local/netbeans-12.5/netbeans/harness"

- make CopyOpenSimCore
- make PrepareInstaller
This errors out with about 14 similar errors in compiling C3DFileadapter.java:
Simply removing the file solves this (for now. I read that somewhere), and the compilation succeeds.
Here one of the errors:

Code: Select all

         /home/sietse/Software/OpenSim/opensim-gui/Gui/opensim/modeling/src/org/opensim/modeling/C3DFileAdapter.java:26: error: cannot find symbol
         [nb-javac]     super(opensimCommonJNI.C3DFileAdapter_SWIGSmartPtrUpcast(cPtr), true);
         [nb-javac]                           ^
         [nb-javac]   symbol:   method C3DFileAdapter_SWIGSmartPtrUpcast(long)
What could be the problem here?
I tried it both with BTK and ezc3d.

After removing the C3Dfileadapter.jave file the tar file gets created in dist.
I can unpack it and start the gui. We now get to the second issue:

The gui starts with 2 errors, both:
Failed to load one or more dynamic libraries for OpenSim.
java.lang.UnsatisfiedLinkError: no osimJavaJNI in java.library.path
Probably the same error I sometimes get with the ctest.

But the opensim/lib directory IS in java.library.path, and DOES contain libosimJavaJNI.so
This as shown by java -XshowSettings:properties
(I read in the CHANGELOG.mk of opensim-core that this should not be needed anymore.)
What could be the problem here?

And finally, the File entry in the menu doesn't have any items, so I can't load anything.
I read also something about this earlier, but no solution.

Thanks in advance,
Sietse

Re: Getting opensim-gui to work on Linux

Posted: Fri Oct 15, 2021 9:18 am
by aymanh
Hello Sietse,

Nice job making it so far in the build process. We generally do not support building GUI from source because there're too many hurdles and flavors of linux particularly that would make it hard to follow a recipe. I'd also add that the most up to date build script would be found on our nightly build script rather than the README files (https://github.com/opensim-org/opensim- ... /workflows).

With that said, I think the only issue you have is setting of the LD_LIBRARY_PATH so that runtime/executables can locate the proper .so files. if that doesn't work, please comment on the open issue https://github.com/opensim-org/opensim-gui/issues/1094 regarding the build instructions so that we can help you resolve and also improve the documentation for future developers on linux.

All the best,
-Ayman

Re: Getting opensim-gui to work on Linux

Posted: Wed Oct 20, 2021 3:51 am
by sietse
I now have a working Debian version, no problem whatsoever!
I closely followed the continuous integration file.

However the Ubuntu version almost works, only there is NO visualization window in the gui.
But no errors or warnings.
I filed an issue on opensim-gui for that.

Thanks!
Sietse