Inviwo Setup for Linux

The steps below detail how to get Inviwo running on a computer with Ubuntu (tested on 18.04). The video shows all of those steps as well. In parts it is heavily sped up. Especially the last step - building Inviwo - does take some time.

(Note: The video was created for a prior version of Inviwo. Since then sub modules (see below) have been introduced.)

Play media comment.

Step 1: Installing Dependencies

In order to work with Inviwo, you will need to install Git, Visual Studio, Qt and CMake. If there is some dependency you already have installed, check below if the versions are recent enough.

Git, CMake (>= 3.12) and C++ Compiler

The official Ubuntu repo contains an outdated CMake version. In order to install a recent enough version, add the Kitware APT Repository Links to an external site.with the commands below. The first two commands add the Kitware APT Repo and the appropriate signing key, the third and fourth update your package manager and download the dependencies.

wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add - 
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' 
sudo apt-get update

You can install the dependencies above by running

sudo apt-get install build-essential cmake cmake-qt-gui git freeglut3-dev xorg-dev

on the command line.  

If you are working on a different distribution, make sure that you install a recent enough version of CMake on your system. If the version obtained through apt-get is older (i.e. <3.12) follow the instructions here Links to an external site. to install a more recent version. In this case use CMake without the GUI (see related instructions below.)

QT (>= 5.12)

Follow the instructions here Links to an external site.. Note that the download path is out of date, you will need to use a newer version number (https://qt-mirror.dannhauer.de/official_releases/qt/5.12/5.12.4/qt-opensource-linux-x64-5.12.4.run). You will want to choose the gcc_64 component. You may skip the step where the compiler is specified in Qt Creator and you will already have g++ installed from before. Make sure not to forget to install mesa-dev-common and lubglu1-mesa-dev. You also do not need to set file associations. 

Make sure to add the Qt folder to the CMAKE_PREFIX_PATH environment variable

export CMAKE_PREFIX_PATH=/home/user/Qt/5.12.4/gcc_x64/

Step 2: Cloning Inviwo

The source code is available on Github. You can clone the Inviwo repository by running

git clone https://github.com/KTHVisualization/inviwo

on the command line. This will make a local copy of the source code on your computer in the current folder of the command line. Navigate to the newly created folder with

cd inviwo

Also clone the repositories submodules with 

git submodule update --init --recursive

Step 3: Running CMake-Gui

Run the CMake-Gui Program. In the window that opens you need to specify two paths. The first is the path of the folder with the Inviwo source (this is the folder with the contents of the git repository, so something like /home/username/inviwo). The other path is the one where CMake will place the build-files (e.g. /home/username/inviwo-output). Specify these two paths and hit the Configure button. 

You will be asked if you want to create the output folder (Yes) and to choose a compiler. You want to use the Unix Makefiles. This is often already the default setting. Then CMake will do some checks for what system your are using and set up the build environment accordingly.

You will see some variables with either values or checkboxes. These specify which parts of Inviwo we will be using and where certain dependencies are located. If everything worked correctly, you will not have to make any changes here. Continue to press Configure until none of the entries are marked red anymore. However, one common problem is that CMake is unable to find Qt or uses a version that is incorporated into another program. Therefore check that the variables QT_QMAKE_EXECUTABLE (should be something like /home/username/Qt5.12.4/5.12/gcc_64/bin/qmake) and the variables Qt5*_DIR (e.g. Qt5Core_DIR should be something like /home/username/Qt5.12.4/5.12/gcc_64/lib/cmake/Qt5Core) are set to the correct folders.

If all settings are correct and no errors occurred, you can hit Generate.

If you get errors relating to tirpc, xrandr or xorg-dev you additionally need to install libtirpc-dev, xorg-dev and/or xrandr-dev. (Possibly also libxcursor-dev).

Alternative with command line CMake

Assuming your inviwo folder is located at /home/username/inviwo the following commands replace using the CMake GUI:

cd /home/username/
mkdir -p inviwo-out
cd inviwo-out
cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Release ../inviwo

If this process yields errors regarding Qt, the corresponding values in the CMakeCache need to be adapted.

Step 4: Building Inviwo

Now all that is left to do is build Inviwo. You do this by navigating to the output folder you have specified in the terminal and then run

make -j 8

The "-j 8" speeds up the process through parallel building and can be omitted.

Once that process is finished you can start Inviwo with

./bin/inviwo

and take a look at the different example workspaces (File → Example Workspaces).

If Inviwo opens, but you get an error similar to the one below when saving a workspace or Canvas image, this can be resolved by setting the variable IVW_USE_EXTERNAL_IMG to ON and additionally installing libjpeg-dev libpng-dev libtiff-dev libtirpc-dev zlib1g-dev.

"Gtk-WARNING **: ... : Could not load a pixbuf from icon theme.