Compiling Olive 0.2

So you think you can compile Olive yourself?

...Well, you're right!

Olive is open source meaning all the source code is available to users for them to modify themselves and compile on any platform they see fit.

Olive source code is hosted on GitHub.

Olive currently has four major dependencies: Qt 5.9+, FFmpeg 3.0+, OpenImageIO 2.1.12+, and OpenColorIO 2.x. It also uses the CMake build system for configuring. The following are instructions designed to help you on your way to acquiring these dependencies and using them to compile Olive.

Compiling on Windows
Compiling on macOS
Compiling on Ubuntu 20.04
Compiling on Arch
Compiling on Linux with Docker


 

Compiling on Windows

  1. For Windows, we'll be using Microsoft Visual C++ (MSVC) which is part of Visual Studio. You'll need to install that first and set it up for Desktop development with C++.
  2. Next, to acquire Olive's dependencies, we'll be using vcpkg. Installation instructions are on its GitHub page.
  3. By default, vcpkg installs 32-bit libraries only. While Olive can be compiled for 32-bit, we strongly discourage this if you have a 64-bit computer. To compile Olive 64-bit, we'll need to tell vcpkg to install 64-bit libraries by setting the environment variable VCPKG_DEFAULT_TRIPLET to x64-windows. If you're using Command Prompt you can use the following command:
    set VCPKG_DEFAULT_TRIPLET=x64-windows
    Note that setting it this way is specific to the session and will reset if you close Command Prompt or start a new one.
  4. First, we'll install Qt. There are two ways to install it. The first is to use the official installer from the Qt website. This is actually recommended as vcpkg compiles all libraries locally and it can take hours to compile Qt. Unfortunately the Qt installer does require you to make an account, but that's still faster than waiting for Qt to compile.

    When using the installer, make sure to pick the MSVC 2019 build: Alternatively, you can use vcpkg with the following command, but expect it to take a few hours:
    vcpkg install qt5
  5. Next, we'll install the remaining packages:
    vcpkg install ffmpeg openimageio openexr opencolorio
    This will take some time so I recommend finding something to do as it happens.
  6. Using vcpkg, run the following command to make vcpkg's installed libraries accessible on your system (may require administrator privileges):
    vcpkg integrate install
    vcpkg will give you a CMake parameter. Copy that down for later.
  7. If you haven't already, acquire the source either from GitHub or using the following Git command if you have it installed. The resulting olive folder is your working copy:
    git clone https://github.com/olive-editor/olive
  8. Run a Developer Command Prompt for VS. This will have been installed with Visual Studio and will start a command prompt in an environment ready for compiling.
  9. If you installed Qt with the installer rather than with vcpkg, you'll need to manually add the install folder to the path. By default, this will be something like C:\Qt\<version>\msvc2019_64, obviously substituting <version> with the version you installed. You can add it to the path like this:
    set PATH=%PATH%;C:\Qt\5.15.1\msvc2019_64
    As above, this will apply only to the command prompt session, and if you close it or open a new one, you'll need to set this path again.
  10. Use cd to browse to the directory you downloaded Olive to:
    cd <path-to-olive>
    This is your working copy of Olive.
  11. Optionally, create a separate build folder. This isn't strictly necessary but is recommended in order to keep the source tree clean.
    mkdir build
    cd build
  12. Now, we'll be using CMake to create the build files (CMake comes with Visual Studio) and you'll need that parameter that vcpkg gave us earlier. You'll want to start with cmake <path-to-source> -DCMAKE_BUILD_TYPE=RelWithDebInfo and end with the vcpkg parameter. Your command should look something like this:
    cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake
    .. means "the parent folder", assuming you made a build subfolder in the previous step. If you didn't, you'll want to replace .. with ., or if you placed the source somewhere else entirely, replace with the full path to that source folder.
  13. Assuming CMake didn't throw any errors, you can now start compiling:
    cmake --build .
  14. Once this has finished, assuming there are no errors, you should see a folder called app/Debug in your build folder. In that folder should be a program called olive-editor.exe. If you see it, this is your compiled Olive executable and you've just compiled Olive!
 

Compiling on macOS

  1. For macOS, we'll be using Xcode which is available through the Mac App Store. You'll need to install this first before proceeding with the rest of the build.
  2. To install dependencies, we'll be using the Homebrew package manager. Instructions for installing it are available on its website.
  3. Using Homebrew, we'll install most of the dependencies we need:
    brew install qt5 ffmpeg openimageio opencolorio
  4. If you haven't already, acquire the source either from GitHub or using the following Git command if you have it installed. The resulting olive folder is your working copy:
    git clone https://github.com/olive-editor/olive
  5. Use cd to browse to the directory you downloaded Olive to:
    cd <path-to-olive>
    This is your working copy of Olive.
  6. Optionally, create a separate build folder. This isn't strictly necessary but is recommended in order to keep the source tree clean.
    mkdir build
    cd build
  7. Now, we'll be using CMake to create the build files.
    cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
    .. means "the parent folder", assuming you made a build subfolder in the previous step. If you didn't, you'll want to replace .. with ., or if you placed the source somewhere else entirely, replace with the full path to that source folder.
  8. Assuming CMake didn't throw any errors, you can now start compiling:
    cmake --build .
  9. Once this has finished, assuming there are no errors, you should see a folder called app in your build folder. In that folder should be a program called Olive.app. If you see it, this is your compiled Olive executable and you've just compiled Olive!
 

Compiling on Ubuntu 20.04

  1. For Ubuntu, we'll be using GCC which is part of build-essential.
    sudo apt install build-essential
  2. We also use the CMake build system:
    sudo apt install cmake
  3. Next, we'll be installing Olive's dependencies. We'll start with Qt which you can install one of two ways.

    The first is using Ubuntu's supported version:
    sudo apt install qt5-default qtmultimedia5-dev libqt5multimedia5 libqt5multimedia5-plugins libqt5svg5-dev qttools5-dev qttools5-dev-tools
    Alternatively, Qt also provides an official Linux installer on their website which will likely provide you with a much newer version.
  4. Next, we'll install the remaining dependencies:
    sudo apt install libavformat-dev libavcodec-dev libavfilter-dev libavutil-dev libswscale-dev libswresample-dev libopenimageio-dev libopenexr-dev
  5. Olive also depends on OpenColorIO v2 which is fairly new and not available on this platform by default, so you'll need to compile and install it manually:
    git clone https://github.com/AcademySoftwareFoundation/OpenColorIO.git
    cd OpenColorIO
    git checkout v2.0.0
    mkdir build
    cd build
    cmake .. -G "Unix Makefiles" -DOCIO_BUILD_PYTHON=OFF
    cmake --build .
    sudo cmake --install .
    cd ../..
  6. If you haven't already, acquire the source either from GitHub or using the following Git command if you have it installed. The resulting olive folder is your working copy:
    git clone https://github.com/olive-editor/olive
  7. Use cd to browse to the directory you downloaded Olive to:
    cd <path-to-olive>
    This is your working copy of Olive.
  8. Optionally, create a separate build folder. This isn't strictly necessary but is recommended in order to keep the source tree clean.
    mkdir build
    cd build
  9. Now, we'll be using CMake to create the build files.
    cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
    .. means "the parent folder", assuming you made a build subfolder in the previous step. If you didn't, you'll want to replace .. with ., or if you placed the source somewhere else entirely, replace with the full path to that source folder.
  10. Assuming CMake didn't throw any errors, you can now start compiling:
    cmake --build .
  11. Once this has finished, assuming there are no errors, you should see a folder called app in your build folder. In that folder should be a program called olive-editor. If you see it, this is your compiled Olive executable and you've just compiled Olive!
 

Compiling on Arch

  1. For Arch, we'll be using GCC which is part of base-devel.
    sudo pacman -S base-devel
  2. We also use the CMake build system:
    sudo pacman -S cmake
  3. Next, we'll be installing Olive's dependencies.
    sudo pacman -S qt5 ffmpeg openimageio opencolorio
  4. If you haven't already, acquire the source either from GitHub or using the following Git command if you have it installed. The resulting olive folder is your working copy:
    git clone https://github.com/olive-editor/olive
  5. Use cd to browse to the directory you downloaded Olive to:
    cd <path-to-olive>
    This is your working copy of Olive.
  6. Optionally, create a separate build folder. This isn't strictly necessary but is recommended in order to keep the source tree clean.
    mkdir build
    cd build
  7. Now, we'll be using CMake to create the build files.
    cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
    .. means "the parent folder", assuming you made a build subfolder in the previous step. If you didn't, you'll want to replace .. with ., or if you placed the source somewhere else entirely, replace with the full path to that source folder.
  8. Assuming CMake didn't throw any errors, you can now start compiling:
    cmake --build .
  9. Once this has finished, assuming there are no errors, you should see a folder called app in your build folder. In that folder should be a program called olive-editor. If you see it, this is your compiled Olive executable and you've just compiled Olive!
 

Compiling on Linux with Docker

For our automated builds we use a CentOS 7 based Docker image. It includes all dependencies to produce an AppImage that can run on most Linux distributions out of the box. You can use this image to build Olive locally.

  1. If you haven't already, acquire the source either from GitHub or using the following Git command if you have it installed. The resulting olive folder is your working copy:
    git clone https://github.com/olive-editor/olive
  2. Use our ci-olive image from Docker Hub to run a Linux Docker container. Mount the working copy into the container at /opt/olive/:
    docker run --rm -it -v <path-to-olive>:/opt/olive olivevideoeditor/ci-olive:2021.2
    It automatically pulls the image if it is not available locally. You may explicitly pull and thereby update your local copy of the image at any time:
    docker pull olivevideoeditor/ci-olive:2021.2
  3. The initial working directory in the container shell is /opt/olive/. Enter the mounted working copy, create a build folder, then configure and build with CMake:
    cd olive
    mkdir build
    cd build
    cmake .. -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
    cmake --build .
    You may use a different build type or pass additional options to CMake. GCC (g++) is the default compiler. To use Clang (clang++), append -DCMAKE_CXX_COMPILER=clang++ to the first CMake command.
  4. To collect the files that will be packaged as AppImage, run below CMake install command:
    cmake --install app --prefix appdir/usr
  5. Finally, create the AppImage with linuxdeployqt:
    /usr/local/linuxdeployqt-x86_64.AppImage appdir/usr/share/applications/org.olivevideoeditor.Olive.desktop -appimage --appimage-extract-and-run
    You will find the resulting file Olive-<VERSION>-x86_64.AppImage in the build folder, in the guest as well as the host system.
    You can stop the container with Ctrl + D or type exit and hit Enter. The working copy that you mounted including all build artifacts will remain.