Building from source
DJV is built with CMake. A super build is provided that builds the dependencies and then DJV, driven by a script per platform; it is how the packages are made. The dependencies can also come from the system's packages, on the distributions that carry them.
Build options go in etc/Config/local.cmake, which is not tracked. For example:
# Enable full codec support.
set(TLRENDER_FFMPEG_MINIMAL OFF CACHE BOOL "")
# Enable USD (Universal Scene Description) support. Building USD also
# requires Python 3.
set(TLRENDER_USD ON CACHE BOOL "")
For the number of build jobs, export CMAKE_BUILD_PARALLEL_LEVEL.
Linux
Requirements: Git and CMake 3.31.
Debian and Ubuntu
Install the system packages:
sudo apt-get install build-essential git cmake xorg-dev libglu1-mesa-dev mesa-common-dev mesa-utils libasound2-dev libpulse-dev libva-dev libdrm-dev libwayland-dev wayland-protocols libxkbcommon-dev libegl1-mesa-dev libdecor-0-dev
The Wayland packages are optional; without them SDL is built with X11 only and runs through XWayland on a Wayland desktop.
Rocky 9
sudo dnf install git libX11-devel libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel mesa-libGL-devel pipewire-devel libva-devel libdrm-devel wayland-devel wayland-protocols-devel libxkbcommon-devel mesa-libEGL-devel libdecor-devel
Rocky 9 packages CMake 3.26, and OpenTimelineIO needs 3.31. A newer one can be installed with pip; the cmake.org .sh file is an installer that takes a prefix, and either way the result has to be on the path ahead of the system's:
pip3 install --user "cmake<4"
export PATH=$HOME/.local/bin:$PATH
Rocky 8
sudo dnf install git libX11-devel libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel mesa-libGL-devel pipewire-devel libva-devel libdrm-devel wayland-devel wayland-protocols-devel libxkbcommon-devel mesa-libEGL-devel
Rocky 8 also needs a newer compiler, installed and then enabled for the shell that builds:
sudo dnf install gcc-toolset-13
scl enable gcc-toolset-13 bash
NVIDIA hardware decoding loads the driver's CUDA library at run time. On RHEL family systems that is a separate package:
sudo dnf install nvidia-driver-cuda-libs
Build
Clone the repository and run the super build script:
git clone https://github.com/grizzlypeak3d/DJV.git
sh DJV/sbuild-linux.sh
Run the application:
build-Release/bin/djv/djv DJV/etc/SampleData/BART_2021-02-07.0000.jpg
macOS
Requirements: Git, Xcode, and CMake 3.31.
Clone the repository and run the super build script:
git clone https://github.com/grizzlypeak3d/DJV.git
sh DJV/sbuild-macos.sh
Run the application:
build-Release/bin/djv/djv DJV/etc/SampleData/BART_2021-02-07.0000.jpg
These aliases are convenient for switching between architectures:
alias arm="env /usr/bin/arch -arm64 /bin/zsh --login"
alias intel="env /usr/bin/arch -x86_64 /bin/zsh --login"
Windows
Requirements:
- Git (git-scm.com)
- Visual Studio 2022
- CMake 3.31
- NASM (nasm.us) for compiling FFmpeg and libjpeg-turbo
- MSYS2 (msys2.org) for compiling FFmpeg
- Strawberry Perl (strawberryperl.com) for compiling network support
- Python 3.11 for compiling USD
- NSIS (nsis.sourceforge.io) for packaging
Open the Visual Studio command console "x64 Native Tools Command Prompt for VS 2022", found in the Start menu in the "Visual Studio 2022" folder.
Clone the repository and run the super build script:
git clone https://github.com/grizzlypeak3d/DJV.git
DJV\sbuild-win.bat
Run the application:
set PATH=%CD%\install-Release\bin;%PATH%
build-Release\bin\djv\Release\djv DJV\etc\SampleData\BART_2021-02-07.0000.jpg
System packages
On Linux the dependencies can come from the distribution instead of the super build. This is the build a distribution package would make. Ubuntu 26.04 is the first release with every package it needs, and it is the configuration continuous integration builds, so what follows is kept true there.
Install the system packages:
sudo apt-get install build-essential git cmake xorg-dev libglu1-mesa-dev mesa-common-dev mesa-utils libasound2-dev libpulse-dev libva-dev libdrm-dev libwayland-dev wayland-protocols libxkbcommon-dev libegl1-mesa-dev libdecor-0-dev pkg-config zlib1g-dev libpng-dev libfreetype-dev nlohmann-json3-dev libsdl3-dev libimath-dev libopenexr-dev libopencolorio-dev libopenimageio-dev openimageio-tools libopentimelineio-dev libminizip-ng-dev libavcodec-dev libavdevice-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev
The OpenImageIO tools are listed because the library's CMake configuration names them, and configuring fails without them. lunasvg has no package and is built from source, into a prefix beside the build:
git clone --branch v3.4.0 https://github.com/sammycage/lunasvg.git
cmake -S lunasvg -B lunasvg-build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install-Release -DLUNASVG_BUILD_EXAMPLES=OFF
cmake --build lunasvg-build --target install
subprocess.h, which runs the FFmpeg command line tool, is a single header with no package, copied into the same prefix at the commit the super build uses:
git clone https://github.com/sheredom/subprocess.h.git subprocess
git -C subprocess checkout 0d76f78ff8b56d1240ffe6571d689c5e26299527
mkdir -p install-Release/include
cp subprocess/subprocess.h install-Release/include
Then DJV is configured directly, with its default options and that prefix on the search path, and built. Ubuntu installs OpenColorIO's CMake configuration in /usr/share/cmake itself, which CMake does not search, so that directory is named. Packaging is turned off, since it gathers the super build's libraries out of the install prefix:
git clone --recursive https://github.com/grizzlypeak3d/DJV.git
cmake -S DJV -B build-Release -C DJV/etc/Config/default.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install-Release -DCMAKE_PREFIX_PATH=$PWD/install-Release -DOpenColorIO_DIR=/usr/share/cmake -DDJV_PACKAGE_DEPS=OFF
cmake --build build-Release
The script etc/Linux/build-system.sh does the same, and is what continuous integration runs.
What differs from the super build:
- The distribution's OpenTimelineIO is 0.18.1. Markers carry an RGBA color from 0.19, so a review saved by this build writes marker colors as the default named color, and reads named colors.
- The super build patches FFmpeg so that media past 2 GB inside an OTIOZ bundle can be read; the distribution's FFmpeg is unpatched, and such an entry does not open.
- The codecs are whatever the distribution's FFmpeg carries, rather than the packages' minimal set.