- by default it goes to `/usr/local` (good option if you are admin of the machine, normally programs there are automatically detected);
- you may use `$HOME/.local` user-writable directory (good option if you don't want to play with admin rights, programs there are also usually found)
- you may want to override the distribution files in `/usr` (then you have to remove MLT & Kdenlive binary & data packages first)
- you can pick any destination you like (eg in `/opt` or anywhere in `$HOME`, then you will have to set several environment variables for programs, libs and data to be found)
Let's define that destination as `INSTALL_PREFIX` variable; also you can set `JOBS` variable to the number of threads your CPU can offer for builds.
Most development packages will already be installed with the following command:
And build the dependencies (MLT) before the project (Kdenlive):
# 'sudo make install' if INSTALL_PREFIX is not user-writable
# Fedora
# Install builddep beforehand
dnf builddep
# Kdenlive
cd ../kdenlive
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX
make -j$JOBS
make install
# 'sudo make install' if INSTALL_PREFIX is not user-writable
```
**Important:** If you are going to install the projects to your `/usr` after
building them, make sure to remove existing packages of Kdenlive, MLT, and
frei0r beforehand!
Note that `make install` is required for Kdenlive, otherwise the effects will not be installed and cannot be used.
```bash
apt purge kdenlive frei0r-plugins libmlt++3
```
### Run Kdenlive
### Clone frei0r, MLT, and Kdenlive
If you didn't build in a system path in which all libs and data are automatically found, you will need to set environment variables to point to them.
This is done by the auto-generated script in `kdenlive/build` that must be sourced (to keep variables set in current shell, unlike just executing the script):
```bash
git clone https://github.com/dyne/frei0r.git
git clone https://github.com/mltframework/mlt.git
git clone https://invent.kde.org/kde/kdenlive.git
. prefix.sh
kdenlive
```
## Various development tricks
### Build it!
### Debugging
Now you can build and install the projects. As Kdenlive depends on MLT which
depends on frei0r, build and install them in reverse order.
Having debug symbols helps getting much more useful information from crash logs or analyzers outputs; this is enabled at configure stage.
- in MLT, append `--enable-debug` to `./configure` line
- in Kdenlive, append `-DCMAKE_BUILD_TYPE=Debug` to `cmake` line
Note that `make install` is required for Kdenlive, otherwise the effects will
not be installed and cannot be used.
### Running tests
For frei0r, MLT, and Kdenlive (in that order), run the following steps
inside their directory to build, compile, and install it.
Kdenlive test coverage is focused mostly on timeline model code (extending tests to more parts is highly desired). To run those tests, append to `cmake` line:
`-DBUILD_TESTING=ON`
```bash
# Create a build directory – the build files remain in here
mkdir build
cd build
### Fuzzer
# Check dependencies and configure the build process
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
Kdenlive embeds a fuzzing engine that can detect crashes and auto-generate tests. This can be activated in `cmake` line with:
`-DBUILD_FUZZING=ON`
# Compile
make
### Speeding up compilations
# Install the compiled files
sudo make install
```
Ninja build systems, compared to make, seems faster and better detecting which files are necessary to rebuild. You can enable it appending `-GNinja` to `cmake` line
CCache also helps: `-DCMAKE_CXX_COMPILER_LAUNCHER=ccache`
#### Building on Ubuntu 20.04
### Analyzers
Ubuntu 20.04 provides OpenCV 4.2 which is not supported by the frei0r plugins yet. Run CMake with
You can configure Kdenlive to embed tooling for runtime analysis, for example appending to cmake line: