Return to François Faure

Install sofa on a virtual Ubuntu


Create the virtual machine

  1. Install and run VirtualBox
  2. Create a virtual disk. 9 GB are sufficient for a Release Build. Add 8 GB for a Debug build. It is not clear wethor a Fixed Size disc really provides better performances than Dynamic Size. Other  parameters you may want to set are the number of processors and RAM available to the virtual machine. For instance, 2 processors and 2048 MB are more comfortable for compiling Sofa. Activate the 3D acceleration for better performance
  3. Install Ubuntu 13.10 since QtCreator is buggy on 14.04

Install Guest Additions

This is necessary for a better integration of the host VM on your guest, including resizing.

  1. Install the VBoxGuestAdditions.iso in your guest system, using the appropriate package, or by downloading it
  2. Make it available to the virtual machine, using the settings menu:
  3. Start the virtual machine, mount the guest addition image there, and run it:
    sudo mkdir /media/cdrom
    sudo mount /dev/cdrom /media/cdrom
    sudo /media/cdrom/
  4. restart the VM

Install software

  1. sudo apt-get install subversion cmake-qt-gui ccache clang qtcreator nautilus-open-terminal
  2. sudo apt-get install libboost-all-dev freeglut3-dev libpng12-dev libqt4-dev libglew-dev

Install Sofa

  • Download as anonymous user:  cd Desktop && svn checkout svn://
  • set up a build directory:  mkdir build-release && cd build-release
  • initialize the build:
     CCACHE_DIR=ccachedir CC="ccache clang -Qunused-arguments -fcolor-diagnostics" CXX="ccache clang++ -Qunused-arguments -fcolor-diagnostics" cmake -DCMAKE_BUILD_TYPE=Release -G "CodeBlocks - Unix Makefiles" -H../Sofa -B.
  • Open the gui and configure the project:
     cmake-gui ../Sofa
  • check the plugins: Flexible, Compliant, Image, SofaTest, SceneCreator as well as option QGLViewer. Replace SOFA-EXTERNAL_BOOST_PATH with an empty string.
  • Configure then Generate
  • make  (with option -j2 if 2 processors are available)

Use Sofa

  1. Start QtCreator and open the project Desktop/Sofa/CMakeLists.txt
  2. Use build-release as build directory
  3. Use runSofa as active sub-project, and run it using the green arrow on the bottom left

A possible Readme file: README

François Faure, June 2014