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
-
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++.
-
Next, to acquire Olive's dependencies, we'll be using
vcpkg. Installation instructions are
on its GitHub page.
-
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.
-
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
-
Next, we'll install the remaining packages:
vcpkg install ffmpeg openimageio openexr opencolorio portaudio
This will take some time so I recommend finding something to do as it happens.
-
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.
-
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
-
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.
-
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.
-
Use cd to browse to the directory
you downloaded Olive to:
cd <path-to-olive>
This is your working copy of Olive.
-
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
-
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.
-
Assuming CMake didn't throw any errors, you can now start compiling:
cmake --build .
-
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
-
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.
-
To install dependencies, we'll be using the Homebrew
package manager. Instructions for installing it are available on its
website.
-
Using Homebrew, we'll install most of the dependencies we need:
brew install qt5 ffmpeg openimageio opencolorio portaudio
-
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
-
Use cd to browse to the directory
you downloaded Olive to:
cd <path-to-olive>
This is your working copy of Olive.
-
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
-
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.
-
Assuming CMake didn't throw any errors, you can now start compiling:
cmake --build .
-
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
-
For Ubuntu, we'll be using GCC which is part of
build-essential.
sudo apt install build-essential
-
We also use the CMake build system:
sudo apt install cmake
-
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 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.
-
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 portaudio19-dev
-
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.1.1
mkdir build
cd build
cmake .. -G "Unix Makefiles" -DOCIO_BUILD_PYTHON=OFF
cmake --build .
sudo cmake --install .
cd ../..
-
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
-
Use cd to browse to the directory
you downloaded Olive to:
cd <path-to-olive>
This is your working copy of Olive.
-
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
-
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.
-
Assuming CMake didn't throw any errors, you can now start compiling:
cmake --build .
-
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
-
For Arch, we'll be using GCC which is part of
base-devel.
sudo pacman -S base-devel
-
We also use the CMake build system:
sudo pacman -S cmake
-
Next, we'll be installing Olive's dependencies.
sudo pacman -S qt5 ffmpeg openimageio opencolorio portaudio
-
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
-
Use cd to browse to the directory
you downloaded Olive to:
cd <path-to-olive>
This is your working copy of Olive.
-
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
-
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.
-
Assuming CMake didn't throw any errors, you can now start compiling:
cmake --build .
-
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.
-
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
-
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.4
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.4
-
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.
-
To collect the files that will be packaged as AppImage,
run below CMake install command:
cmake --install app --prefix appdir/usr
-
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.