Skip to content
Alberto edited this page Aug 26, 2022 · 12 revisions

Build Instructions

Windows

Note: Tested on Windows 10 and Windows 11.

Build Instructions:

Note: Tested on Windows 10 and Windows 11.

  1. Download the build script from here.

  2. Open Windows PowerShell as Administrator and execute the script as follows:

    & 'opensim-windows-build-script.ps1'

  3. Wait until the building process has finished.

Configuration:

  1. Casadi/Tropter:

    • You can enable or disable Moco by setting the options OPENSIM_WITH_CASADI and OPENSIM_WITH_TROPTER to on or off in cmake. (You have to do this for both, opensim-core and opensim-core-dependencies).
  2. Build type:

    • You can change the debug type by changing the --config value in cmake. The values allowed are:

      • Debug: debugger symbols. No optimizations (more than 10x slower). Library names end with _d.
      • Release: No debugger symbols. Optimized.
      • RelWithDebInfo: Debugger symbols. Optimized. Bigger but not slower than Release. Choose this if unsure.
      • MinSizeRel: Minimum size. Optimized.
    • Note: The same build type should be used for opensim-core and opensim-core-dependencies to avoid mysterious errors.

Troubleshooting:

  1. Running scripts is disabled on the system:

    • Error message:

      &: File <path-to-script> cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https://go.microsoft.com/fwlink/?LinkID=135170.

    • Solution (more details on this link):

      In PowerShell, as Administrator, you can allow execution of scripts with the following command

      Set-ExecutionPolicy Unrestricted -Scope CurrentUser
      

      Once you are done, you can set the policy back to default (Recommended):

      Set-ExecutionPpolicy Restricted -Scope CurrentUser
      

Linux (Ubuntu)

Note: Tested on Ubuntu 18.04. These instructions should work for other distributions with some modifications (e.g., package manager, package names, etc).

Build Instructions:

  1. Download the build script from here.

  2. Open terminal and execute the script as follows:

    ./opensim-linux-build-script.sh

  3. Wait until the building process has finished.

Configuration:

  1. Casadi/Tropter:

    • You can enable or disable Moco by setting the options OPENSIM_WITH_CASADI and OPENSIM_WITH_TROPTER to on or off in cmake. (You have to do this for both, opensim-core and opensim-core-dependencies).
  2. Build type:

    • You can change the debug type by changing the --config value in cmake. The values allowed are:

      • Debug: debugger symbols. No optimizations (more than 10x slower). Library names end with _d.
      • Release: No debugger symbols. Optimized.
      • RelWithDebInfo: Debugger symbols. Optimized. Bigger but not slower than Release. Choose this if unsure.
      • MinSizeRel: Minimum size. Optimized.
    • Note: The same build type should be used for opensim-core and opensim-core-dependencies to avoid mysterious errors.

Troubleshooting:

  1. Permission denied:

    • Error message:

      bash: ./opensim-linux-build-script.sh: Permission denied
      
    • Solution: Grant execution permission to the script:

      chmod 777 opensim-linux-build-script.sh
      
  2. Failed to load libraries when starting opensim after build:

    • Error message:

      Error: While executing opensim once installed: Failed to load one or more dynamic libraries for OpenSim.
      java.langUnsatisfiedLinkError: /opt/opensim-gui/sdk/lib/libosimJavaJNI.so: libadolc.so.2: cannot open shared object file: No such file or directory.
      
    • Solution:

      Add the following two lines to the beginning of the file: /opt/opensim-gui/bin/opensim.

      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/<user>/opensim-workspace/opensim-core-dependencies/adol-c/lib64
      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/<user>/opensim-workspace/opensim-core-dependencies/ipopt/lib
      
Clone this wiki locally