DJV Download Documentation Contribute Donate Contact

Building on Linux

Prerequisites

Preparation

Super Build

System Build

Prerequisites

The following software is required to build DJV on Linux:

You can install the requirements with the following commands:

[Debian]

$ sudo apt-get install build-essential git libgl1-mesa-dev xorg-dev libasound2-dev
[CentOS]

$ sudo yum install centos-release-scl install devtoolset-7-gcc* rpm-build git mesa-libGL-devel libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel alsa-lib-devel
$ scl enable devtoolset-7 bash

Note that the version of CMake available from your package manager may be too old (i.e., Ubuntu 18.04 and CentOS 7); if so, download the CMake 3.18 source (or later version ) and build it manually.

Preparation

Choose a directory to work in, this is where the code will be checked out and built. This directory will be referred to as DJV_BUILD in the rest of the documentation.

Open a shell and clone the DJV repository in the DJV_BUILD directory:

$ git clone https://github.com/darbyjohnston/DJV.git

Setup the environment:

[Debug]

$ export DJV_BUILD=$PWD
$ export PATH=$DJV_BUILD/DJV-install-Debug/bin:$PATH
$ export LD_LIBRARY_PATH=$DJV_BUILD/DJV-install-Debug/lib:$LD_LIBRARY_PATH
[Release]

$ export DJV_BUILD=$PWD
$ export PATH=$DJV_BUILD/DJV-install-Release/bin:$PATH
$ export LD_LIBRARY_PATH=$DJV_BUILD/DJV-install-Release/lib:$LD_LIBRARY_PATH

Super Build

This is the recommended way to build DJV, this builds both DJV and the third party software that DJV depends upon.

Create a directory for the build and configure CMake:

[Debug]

$ mkdir DJV-Debug
$ cd DJV-Debug
$ cmake ../DJV/etc/SuperBuild -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$DJV_BUILD/DJV-install-Debug -DCMAKE_PREFIX_PATH=$DJV_BUILD/DJV-install-Debug
[Release]

$ mkdir DJV-Release
$ cd DJV-Release
$ cmake ../DJV/etc/SuperBuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$DJV_BUILD/DJV-install-Release -DCMAKE_PREFIX_PATH=$DJV_BUILD/DJV-install-Release

Start a parallel build using 8 cores:

$ cmake --build . -j 8

Try running the DJV application:

$ ./DJV/src/DJV-build/build/bin/djv

After the third party dependencies are built you can speed up build times using the DJV sub-project:

$ cd ./DJV/src/DJV-build
$ cmake --build . -j 8

System Build

This builds DJV using the third party software provided by the system.

Create a directory for the build and configure CMake:

[Debug]

$ mkdir DJV-Debug
$ cd DJV-Debug
$ cmake ../DJV -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$DJV_BUILD/DJV-install-Debug -DCMAKE_PREFIX_PATH=$DJV_BUILD/DJV-install-Debug
[Release]

$ mkdir DJV-Release
$ cd DJV-Release
$ cmake ../DJV -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$DJV_BUILD/DJV-install-Release -DCMAKE_PREFIX_PATH=$DJV_BUILD/DJV-install-Release

Start a parallel build using 8 cores:

$ cmake --build . -j 8

Try running the confidence tests to make sure everything is working OK:

$ cmake --build . --target test

Try running the DJV application:

$ ./build/bin/djv