Loading...

Installing SOFA under Windows

To install SOFA under Windows, you can download either the pre-compiled binary version or the source distribution.

Binary distribution

Simply run the provided installer and use the shortcuts in the Start menu or double-click on runSofa.exe installed in the bin subdirectory. If it fails with a DLL error it is probably because you don't have Visual C++ 2005 SP1 installed. You can get the necessary DLL here.


If you have the CUDA SDK installed and a G80 GPU (such as a NVIDIA GeForce 8800 GTX or 8600GT), you can start sofaCUDA to test GPGPU examples. You can then open the other scenes in the examples directory with the File/Open menu. Alternatively you can tell windows to start runSofa.exe when you double-click on .scn files.

Source distribution

  • Download the SOFA framework, modules and applications archives
  • Download the windows dependency package corresponding to your version of Visual Studio.
  • Create a directory where you want to install SOFA
  • Unzip the SOFA framework, modules, applications in this directory.
  • Unzip the dependency archive corresponding to your version of Visual Studio.
  • You should end up with the following directory tree:
    sofa (your root SOFA directory)
      applications
      bin
      examples
      extlibs
      framework
      include
      lib
      modules
      share
      tools
  • Copy sofa-default.prf to sofa-local.prf
  • Edit sofa-local.prf and customize it if necessary (for example, uncomment SOFA_GPU_CUDA to activate CUDA support)
  • If you are using Visual C++ 2005, start project VC8.bat
  • If you are using Visual C++ 2008, start project VC9.bat
  • Open Sofa.sln in Visual Studio
  • Set the Release configuration as active
  • Build all projects

If the compilation was successful, it should have created a runSofa.exe in the bin directory (or runSofad.exe if you compiled the debug version).

Select runSofa as start project in the solution explorer. Alternatively you can tell windows to start runSofa.exe when you double-click on .scn files.

Once the program runs, you can open other examples in the examples directory with the File/Open menu.


Installing SOFA under Linux

Source distribution

  • Download the SOFA framework, modules and applications archives
  • Install the needed dependencies :
    • For Ubuntu :
      • since distribution 10.04
        sudo apt-get install build-essential libqt4-dev libglew-dev freeglut3-dev libxml2-dev libpng-dev libboost-dev
      • older distributions
        sudo aptitude install libqt4-dev libglew-dev libglut-dev libxml2-dev libpng-dev libboost-dev
    • For Fedora Core :
      su -c "yum install qt-devel glew-devel freeglut-devel libxml2-devel"
      
    • For Mandriva :
      su -c "urpmi libqt4-devel libglew-devel libmesaglut3-devel libxml2-devel"
      
  • Create a directory where you want to install SOFA
  • Unzip all archive in this directory. You can use the following commands (change the archive version for newer releases):
    mkdir sofa
    cd sofa
    unzip ../sofa-framework-1.0-rc1.zip
    unzip ../sofa-modules-1.0-rc1.zip
    unzip ../sofa-applications-1.0-rc1.zip
  • You should have the following subdirectories:
    sofa (your root SOFA directory)
      applications
      examples
      extlibs
      framework
      modules
      share
  • Copy sofa-default.prf to sofa-local.prf
  • Edit sofa-local.prf and customize it if necessary (for example, uncomment SOFA_GPU_CUDA to activate CUDA support)
  • Compile SOFA, either by loading Sofa.pro in QtCreator or using the following commands:
    qmake -recursive
    make -j 4 # change 4 with the number of available processors
  • You can test that it worked by trying the following command from the sofa directory:
    source config.sh; runSofa
  • Run the command . config.sh each time you open a new terminal to use SOFA. Alternatively, you can add the SOFA bin and lib directory in your PATH and LD_LIBRARY_PATH environment variables (if you use bash, you can add the following in your ~/.bashrc file) :
    source your_path_to_sofa/config.sh

If the compilation was successful, it should have created a runSofa binary in the bin directory (or runSofad if you compiled the Debug version).

You can start it directly or adding as argument a .scn example file from the examples directory.

Installing SOFA under Mac OS

Source distribution

  • Download the SOFA framework, modules and applications archives, as well as the mac dependencies archive
  • Install the needed dependencies :
    • The Qt toolkit should be installed. You can use the LGPL/Free version available here.
  • Create a directory where you want to install SOFA
  • Unzip all archive in this directory. You can use the following commands (change the archive version for newer releases):
    mkdir sofa
    cd sofa
    unzip ../sofa-framework-1.0-rc1.zip
    unzip ../sofa-modules-1.0-rc1.zip
    unzip ../sofa-applications-1.0-rc1.zip
    unzip ../dependencies-mac-1.0-rc1.zip
  • You should have the following subdirectories:
    sofa (your root SOFA directory)
      applications
      examples
      extlibs
      framework
      include
      lib
      modules
      share
  • Edit sofa-default.cfg and customize it if necessary (for example, uncomment SOFA_GPU_CUDA to activate CUDA support)
  • Compile SOFA, either by using the QtCreator GUI or using the following commands:
    "./Project MacOS.sh"
    make
  • You can test that it worked by trying the following command from the sofa directory:
    DYLD_LIBRARY_PATH=$PWD/lib/macx:$DYLD_LIBRARY_PATH bin/runSofa
  • Add the SOFA bin and lib/macx directory in your PATH and (DY)LD_LIBRARY_PATH environment variables (if you use bash, you can add the following in your ~/.bashrc file) :
    source your_path_to_sofa/config.sh

If the compilation was successful, it should have created a runSofa binary in the bin directory (or runSofad if you compiled the Debug version).

You can start it directly or adding as argument a .scn example file from the examples directory.