Build Instructions for Linux

This page describes the QTetraMesher build process for multiple Linux distributions. At the time of writing this document (Septober 2023), this is less difficult than expected. It mostly requires to install a few 3rd party (development) libraries using a package manager and running a few CMake commands to build Sofa and QTetraMesher.
QTetraMesher now comes with libQGLViewer included. It is not necessary anymore to install the package.
Any cmake or build failures I have encountered here were caused by missing dependency packages.

Building both Sofa and QTetramesher was successfully tested on a natively installed Manjaro and several Virtualbox VMs: Manjaro 23.0 (Uranos), Ubuntu 22.04, Fedora 38.

Installing dependencies

Manjaro doesn't distinguish between runtime and development libraries. Packages installed with Pamac already contain the development headers. For Ubuntu and Fedora you have to explicitly install the dev/devel packages!

Required dependencies:
  • (This list is not distribution specific and mostly provides useful search strings)
    git, cmake, g++, boost, Qt5 (qt5-base), CGAL, eigen, gmp, mpfr, assimp, zlib, freeglut, glew
  • Optional: QtCreator

Building Sofa

  • Clone the Sofa Framework to a directory of your choice:
    git clone https://github.com/sofa-framework/sofa.git .
  • Remember the path where you have cloned the Sofa repository (referred to as SOFA_INSTALL_DIR) and extend it so that you have SOFA_INSTALL_DIR/build/install where SOFA_INSTALL_DIR is the absolute path to your Sofa repository (this is important later).
  • Build Sofa:
    Additional Information: Sofa Framework Linux Installation Instructions
    When all dependenies are correctly installed, this works just fine for me:
    • cmake -B build/ -D CMAKE_BUILD_TYPE=Release
    • Optional (this was necessary on Fedora only to set a non-root install path):
      cmake -B build/ -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=./build/install
    • cmake --build build/ (This may take a while...)
      Optional parallel build (4 cores): cmake --build build/ -- -j4
    • This should automatically copy/install all relevant stuff to $sofa_dir/build/install
      cmake --install build/

Building QTetraMesher

  • Clone QTetraMesher to a directory of your choice:
    git clone https://github.com/dennis2society/qtetramesher.git .
  • Build QTetraMesher:
    • Update the CMakeLists.txt line #9 with your sofa installation path. E.g.
      set(SOFA_INSTALL_DIR "/opt/sofa_git/build/install" CACHE PATH "")
      This spares you to provide -D CMAKE_PREFIX_PATH=$your_sofa_dir to the CMake line.
    • cmake -B build/ -D CMAKE_BUILD_TYPE=Release
    • cmake --build build/
      Optional parallel build (4 cores): cmake --build build/ -- -j4
    • Run ./build/QTetraMesher
    • The data folder contains a few test meshes that are suitable for tetrahedralization.

Back to main page

Last upate: 2023-10-14

Valid XHTML 1.0 Strict