OpenSim-Gui - Linux
Posted: Tue Nov 20, 2018 3:12 pm
Hi everyone,
I've just started using OpenSim and had a bit of a hard time installing the Gui.
This post is just a resume of the procedure I did to make it work. Hope it helps others.
INSTALLING THE API
This should work without any problem. The detailed instructions are very well described at https://github.com/opensim-org/opensim- ... -makefiles
The list of specific commands for different ubuntu distros are given at
https://github.com/opensim-org/opensim- ... ent-ubuntu
And, they worked like a charm.
Before Installation, you should add the JAVA_HOME to the env.
if you have a different java or installed it in a different place, search it using
Set the environment variables
A list of environment variables set-up can be found here: https://simtk-confluence.stanford.edu/d ... ux+Support
To ease the work, the summarized code goes as follows
INSTALLING OPENSIM-GUI AND VISUALIZER FOR LINUX
Downloading
At this point, you will need the OpenSim-Gui, Visualizer, models and Threejs.
All are required but are located in different submodules at the OpenSim git.
Part of the instructions can be found in the OpenSim-Gui git folder: https://github.com/opensim-org/opensim-gui
But, to fully work (at least for me , you need to dig on the shell script used for OSX: https://github.com/opensim-org/opensim- ... _on_mac.sh
In the desired folder (likely the main folder where you downloaded the OpenSim-Core above), you need to git clone all these modules.
Installing netbeans
This should be done without any issue.
To ease the installation, create a temp environment variable (at the open terminal):
Installing
First, you need to create a build directory. Then, following the instructions from (https://github.com/opensim-org/opensim-gui), you need to make sure to add the proper variables (see below) to the cmake:
Following partially the instructions at https://github.com/opensim-org/opensim- ... _on_mac.sh, inside the opensim-gui folder, compile it.
Linkage problem
There is a continuous problem that has only be fixed following the procedures in https://github.com/opensim-org/opensim-gui/issues/186
Add to the end of the file ....../opensim/nbproject/project.properties
run.args.extra=-J-Djava.library.path=${LD_LIBRARY_PATH}
(if for some reason LD_LIBRARY_PATH does not work, replace it for the absolute path. The important point here is to add to the Djava library path the path to the folder containing libosimJavaJNI.so. If you don't know which folder is that, just do
locate libosimJavaJNI.so
If the linkage error described above persists, the command-line at runtime (see below) should help to bypass the problem.
Runtime
Using Netbeans, just follows the procedures at the end of https://simtk-confluence.stanford.edu/d ... ng+the+GUI
The following is copied from the above link.
Use -v instead of run to check for libraries etc.
I've just started using OpenSim and had a bit of a hard time installing the Gui.
This post is just a resume of the procedure I did to make it work. Hope it helps others.
INSTALLING THE API
This should work without any problem. The detailed instructions are very well described at https://github.com/opensim-org/opensim- ... -makefiles
The list of specific commands for different ubuntu distros are given at
https://github.com/opensim-org/opensim- ... ent-ubuntu
And, they worked like a charm.
Before Installation, you should add the JAVA_HOME to the env.
Code: Select all
echo `export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"` >> ~/.bashrc
source ~/.bashrc
Code: Select all
sudo updatedb
locate java | grep openjdk
A list of environment variables set-up can be found here: https://simtk-confluence.stanford.edu/d ... ux+Support
To ease the work, the summarized code goes as follows
Code: Select all
echo `export OPENSIM_HOME="/INSTALLATION FOLDER (PLEASE CHANGE HERE)/opensim_install"` >> ~/.bashrc
source ~/.bashrc
echo `export LIBRARY_PATH="$OPENSIM_HOME/lib"` >> ~/.bashrc
sudo `export LD_LIBRARY_PATH="$OPENSIM_HOME/lib"` >> ~/.bashrc
source ~/.bashrc
sudo ln -s $OPENSIM_HOME/bin/opensim-cmd /usr/local/bin
INSTALLING OPENSIM-GUI AND VISUALIZER FOR LINUX
Downloading
At this point, you will need the OpenSim-Gui, Visualizer, models and Threejs.
All are required but are located in different submodules at the OpenSim git.
Part of the instructions can be found in the OpenSim-Gui git folder: https://github.com/opensim-org/opensim-gui
But, to fully work (at least for me , you need to dig on the shell script used for OSX: https://github.com/opensim-org/opensim- ... _on_mac.sh
In the desired folder (likely the main folder where you downloaded the OpenSim-Core above), you need to git clone all these modules.
Code: Select all
git clone https://github.com/opensim-org/opensim-gui
cd opensim-gui
git submodule update --init --recursive -- \
opensim-models \
opensim-visualizer \
Gui/opensim/threejs
Installing netbeans
This should be done without any issue.
To ease the installation, create a temp environment variable (at the open terminal):
Code: Select all
export NETBEANS_HOME="[ netbeans installation folder]"
export OPENSIMGUI_HOME="/[CURRENT ADDRESS WHERE YOU DOWNLOADED opensim-gui]"
Installing
First, you need to create a build directory. Then, following the instructions from (https://github.com/opensim-org/opensim-gui), you need to make sure to add the proper variables (see below) to the cmake:
- OpenSim_DIR: The directory containing OpenSimConfig.cmake.
- Simbody_DIR: The directory containing SimbodyConfig.cmake
- Ant_EXECUTABLE: If you want to use the Ant that comes with NetBeans, specify something like $NETBEANS_HOME/extide/ant/bin/ant
Code: Select all
locate OpenSimConfig.cmake
locate SimbodyConfig.cmake
Code: Select all
mkdir ../opensim-gui-build
cd ../opensim-gui-build
cmake $OPENSIMGUI_HOME -DOpenSim_DIR="$OPENSIM_HOME/lib/cmake/OpenSim/" -DSimbody_DIR="$OPENSIM_HOME/../opensim_dependencies_install/simbody/lib/cmake/simbody/" -DAnt_EXECUTABLE="$OPENSIM_HOME/extide/ant/bin/ant" -DANT_ARGS="-Dnbplatform.default.netbeans.dest.dir=$OPENSIM_HOME;-Dnbplatform.default.harness.dir=$OPENSIM_HOME/harness"
make CopyOpenSimCore
make CopyVisualizer
make CopyModels
Linkage problem
There is a continuous problem that has only be fixed following the procedures in https://github.com/opensim-org/opensim-gui/issues/186
Add to the end of the file ....../opensim/nbproject/project.properties
run.args.extra=-J-Djava.library.path=${LD_LIBRARY_PATH}
(if for some reason LD_LIBRARY_PATH does not work, replace it for the absolute path. The important point here is to add to the Djava library path the path to the folder containing libosimJavaJNI.so. If you don't know which folder is that, just do
locate libosimJavaJNI.so
If the linkage error described above persists, the command-line at runtime (see below) should help to bypass the problem.
Runtime
Using Netbeans, just follows the procedures at the end of https://simtk-confluence.stanford.edu/d ... ng+the+GUI
The following is copied from the above link.
- Start Netbeans, and the click on File->Open Project
- Browse (starting with the folder containing the OpenSim source code) to one of its OpenSim sub-folder's named Gui/ and then open the "project" opensim.
- Click on the green arrow button (run project button) to automatically compile all the source and launch the OpenSim GUI (which may look a bit different and contain extra menu items/windows depending on your version of Netbeans -- but the functionality is there).
- If the GUI crashes while running through Netbeans you may have to manually delete the residual lock file contained in the OpenSim source code subfolder Gui/opensim/build/testuserdir/lock. Failing to do so may result in access violation errors during subsequent runs.
Code: Select all
sudo ln -s $NETBEANS_HOME/extide/ant/bin/ant /usr/local/bin/ant
ant -Dnbplatform.default.netbeans.dest.dir="$NETBEANS_HOME" -Dnbplatform.default.harness.dir="$NETBEANS_HOME/harness" -f "/[ADDRESS WHERE YOU INSTALLED opensim-gui]/Gui/opensim run