You are viewing the documentation for OpenSim 2.4. Are you looking for the latest OpenSim 4.0 Documentation?

Building the GUI

Prerequisites

  1. An installed version of the OpenSim libraries: these are either built from source then installed or downloaded and included with some distribution of OpenSim (that is consistent with the source you're using)    
  2. Download NetBeans IDE with JDK Bundle, e.g., at  http://www.oracle.com/technetwork/java/javase/downloads/jdk-netbeans-jsp-142931.html.
    OpenSim is built on top of the Netbeans platform which is included with the NetBeans IDE.  Ensure you install a distribution of NetBeans (version 7.0.1 or later) that is bundled with a compatible Java JDK  (so you do not have to separately install a possibly incompatible NetBeans and Java JDK).  Ensure you download the 32-bit JDK version if you're using 32 bit libraries  (the only option on Windows).  
  3. If you anticipate that you may need to make changes to the OpenSim API,  download and install SWIG (version 2.0.4 is recommended) from http://www.swig.org   
  4. Visualization libraries: For now these are VTK libraries and they are included in the bin directory of OpenSim distributions and a Windows version is available in the OpenSim repository.  
  5. Access to the OpenSim repository. See Contributing to the OpenSim Source Code

How to Build the OpenSim GUI

The GUI is built on top of the C++ API, after wrapping it using SWIG. Unless you need to recreate the Java wrapping (e.g to change signature of methods or to expose new classes) there's no need to have swig installed. The output from SWIG (java classes in package org.opensim.modeling and the C++ files OpenSimJNI_wrap.cxx) is already checked into the OpenSim repository. If you plan to change the API then do the following:  

  • Check the box for BUILD_JAVA_WRAPPING in CMake while building OpenSim.  
  • Build the project javawrap (in VisualStudio or build system)  
  • Build the library osimJavaJNI and install it.   

Running Netbeans and Launching the GUI

  • 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 you have an OpenSim installation consistent with the GUI you built and the bin directory of this installation is on your library path (env. var PATH on windows, LD_LIBRARY_PATH on linux, DYLD_LIBRARY_PATH on Mac) then the application will launch smoothly, if not you'll need to fix these environment variables and relaunch NetBeans.

Troubleshooting

  • We use swig 2.0.4 and have not verified compliance with newer versions.
  • 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.

OpenSim is supported by the Mobilize Center , an NIH Biomedical Technology Resource Center (grant P41 EB027060); the Restore Center , an NIH-funded Medical Rehabilitation Research Resource Network Center (grant P2C HD101913); and the Wu Tsai Human Performance Alliance through the Joe and Clara Tsai Foundation. See the People page for a list of the many people who have contributed to the OpenSim project over the years. ©2010-2024 OpenSim. All rights reserved.