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

Linux Build

OUT OF DATE

Building OpenSim in Linux

Requirements

  • See section on BioX Cluster below for additional things necessary to get it running in that environment 
  • CMake: download and install the binary one 
  • Xerces:
    • Just download and install a xerces binaries and headers (most linux distributions will have xerces-c and xerces-c-devel packages for this)
    • In the location of the xerces libraries (e.g. /usr/lib or /usr/lib64 for 64bit), make symlinks:libxerces-c_2.so -> libxerces-c.so
      libxerces-c_2D.so -> libxerces-c.so
      because OpenSim looks for libraries named xerces-c_2 and xerces-c_2D
  • set LD_LIBRARY_PATH to where the libraries are
  • To build:
    • Go to the directory containing the top-level CMakeLists.txt file and run cmake -i . for interactive mode (it'll prompt you for settings) orcmake . for non-interactive mode (uses previous settings; use this if you've made some changes to the code structure requiring a regeneration of make files).
    • Make sure the ARCH64 cmake option is set to the right ON/OFF value for your machine (64 bit linux distributions put libraries in a directory called lib64 instead of lib).
    • Then simply run make
  • Libraries and executables will be built in that same directory as the top-level CMakeLists.txt (where you ran cmake from).

BioX Cluster

  • Since I didn't have root access here, I installed things to /home/erang/local instead of /usr/local.
    • For CMake, this is specified by user when the setup script is run
    • For Xerces, I still downloaded the rpms (both the xerces-c and xerces-c-devel) but I wasn't sure how to install them in a manual location so I extracted the contents into a temporary directory using rpm2cpio <rpmfile> | cpio -idmv and moved the contents that were supposed to go into /usr to /home/erang/local.
    • Also all of the SimTK things that needed to be "installed" in the system I installed into /home/erang/local. This required carefully setting cmake values to install the SimTK core stuff there and to look for the SimTK core stuff there.
  • They recommend compiling with intel compiler, but I haven't tried that yet.
  • Creating an interactive job (e.g. opening a shell in one of the compute nodes): bsub -Is bash
  • If compile takes less than 5 minutes, okay to run interactive job on a node... else submit it as a job (you'll get emailed warnings if you don't)
  • svn is available on the root node but not on the compute nodes apparently

Code Changes

  • Can't use (or even refer to) vtkAVTIWriter in OpenSimBaseCanvas
  • Sometimes there are issues with 64 bit machines where things look for libraries in /lib but they're in /lib64 or vice versa.

Tips

  • To see verbose output from make when building OpenSim, add SET(CMAKE_VERBOSE_MAKEFILE ON) to CMakeLists.txt file
  • Some issues with gcov, gcov_init, not sure what that's all about yet, so I turned off the gcov flags from CMakeLists.txt. The error messages were
    hidden symbol `__gcov_init' in /usr/lib/gcc-lib/i586-suse-linux/3.3.5/libgcc.a(_gcov.oS) is referenced by DSO
    /usr/lib/gcc-lib/i586-suse-linux/3.3.5/../../../../i586-suse-linux/bin/ld: final link failed: Nonrepresentable section on output

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.