Instructions to build Natron in Linux

I am trying to set up a development environment for Natron which builds and debugs using Qt Creator. I have tried installing the dependencies using the Kubuntu package manager (apt), which works fine, yet I stumble upon the mentioned errors which make no sense to me yet.

Since this is step 1 in getting to grips with the Natron code, I figured there must be some more accurate information to help with the build available somewhere?

@devernay

If I set TRAVIS_BUILD_DIR environment variable to the root path of the Natron git repo, the /toolemphasized texts/travis/install_dependencies.sh script seems to work. At least it finishes and I can run /tools/travis/build.sh afterwards.

I cannot confirm if that is the way it is intended to work, but it got me up and running.

I added this section to the doc: Natron/INSTALL_LINUX.md at RB-2.3 · NatronGitHub/Natron · GitHub

You should definitely use the Natron SDK, which is the recommended way to build Natron.

Ah good, thank you very much!

Step by step, we’re getting there :).

Trying to build Natron on Ubuntu 18.04LTS.
Followed the steps in the README, but when reaching qmake -r
It will not start compiling due this errors:

Project MESSAGE: You did not select a config option for the build. Defaulting to Devel. You can choose among  (snapshot | alpha | beta | RC | stable | custombuild). For custombuild you need to define the environment variable BUILD_USER_NAME. Also you can give a revision number to the version of Natron with the environment variable BUILD_NUMBER (e.g: RC1, RC2 etc...)
Project MESSAGE: Compiling in RELEASE mode.
Reading /home/magdesign/Downloads/Natron/HostSupport/HostSupport.pro
Reading /home/magdesign/Downloads/Natron/libs/gflags/gflags.pro
Reading /home/magdesign/Downloads/Natron/libs/glog/glog.pro
Reading /home/magdesign/Downloads/Natron/libs/ceres/ceres.pro
Reading /home/magdesign/Downloads/Natron/libs/libmv/libmv.pro
Reading /home/magdesign/Downloads/Natron/libs/openMVG/openMVG.pro
Reading /home/magdesign/Downloads/Natron/libs/qhttpserver/qhttpserver.pro
 Reading /home/magdesign/Downloads/Natron/libs/qhttpserver/src/src.pro
Reading /home/magdesign/Downloads/Natron/libs/hoedown/hoedown.pro
Reading /home/magdesign/Downloads/Natron/libs/libtess/libtess.pro
Reading /home/magdesign/Downloads/Natron/Engine/Engine.pro
sh: 1: Syntax error: word unexpected (expecting ")")
sh: 1: Syntax error: word unexpected (expecting ")")
sh: 1: Syntax error: word unexpected (expecting ")")
Project ERROR: pyside development package not found

Are somewhere instructions on how to build on Ubuntu 18.04 ?

The reason to build it on my machine is because there is a bug in current RC builds which do not save the scene settings and this is very annoying while being productive. See here: Project Settings Not stored · Issue #439 · NatronGitHub/Natron · GitHub

So I am trying to build this fork: GitHub - splidje/Natron: Open-source compositing software. Node-graph based. Similar in functionalities to Adobe After Effects and Nuke by The Foundry.

You are missing PySide, did you follow Natron/INSTALL_LINUX.md at RB-2.3 · NatronGitHub/Natron · GitHub ?

Thanks for the replay.
pyside2-tools and pyside-tools are installed,
(Requirement already satisfied: PySide in /usr/lib/python2.7/dist-packages)
Maybe config.pri file not pointing to the pyside installation path…?
Compiling Natron on Ubuntu looks like a very advanced and complicated task, maybe an image of VM/Docker compiling container with the full build environment could help people … (maybe artists should not compile things :wink: )

However, I hope @splidje or you will post a release file on github. :slight_smile:

I don’t use Ubuntu so I don’t know the specific packages you need.

This is my config.pri:

boost: LIBS += -lboost_serialization
PKGCONFIG += expat
PKGCONFIG += fontconfig
cairo {
        PKGCONFIG += cairo
        LIBS -=  $$system(pkg-config --variable=libdir cairo)/libcairo.a
}
pyside: PYSIDE_PKG_CONFIG_PATH = $$system($$PYTHON_CONFIG --prefix)/lib/pkgconfig:$$(PKG_CONFIG_PATH)
pyside: PKGCONFIG += pyside
pyside: INCLUDEPATH += $$system(env PKG_CONFIG_PATH=$$PYSIDE_PKG_CONFIG_PATH pkg-config --variable=includedir pyside)/QtCore
pyside: INCLUDEPATH += $$system(env PKG_CONFIG_PATH=$$PYSIDE_PKG_CONFIG_PATH pkg-config --variable=includedir pyside)/QtGui

We have a docker image, see Compiling Natron yourself using the docker SDK

Thanks for the link, your support is amazing and very helpful :ok_hand:!!!

Docker seems to be the solution for solving compiling and should be mentioned in the INSTALL_LINUX.md!

However, now stuck on

Unknown plug-in repository URL GitHub - splidje/Natron: Open-source compositing software. Node-graph based. Similar in functionalities to Adobe After Effects and Nuke by The Foundry.

error.
Other people having the same issue: Compiling Natron yourself using the docker SDK - #14 by Ivanohe73
and again stuck ;(
Solution: Compiling Natron yourself using the docker SDK - #20 by magdesign

@rodlie
Hello,
I can’t build NATRON anymore (on Win 10, from Qtcreator). It seems my config.pri has been deleted.
Can you give me instructions to recreate a new config.pri . (probably with full explicit paths will be easier for me to understand).

I don’t understand why it used to work as I followed only your tutorial (here at pixl.us) and you don’t mention the config.pri.

config.pri was never needed on Windows, however if you are now trying to build RB-2.5 you will probably need one.

I switched back to branch “RB-2.4” and qtcreator still complains about missing config.pri

global.pri ends with:

!include(config.pri) {
error(“System-specific config.pri file not present, please follow the installation instructions and create it.”)
}

I understand easily it complains when I load the project.
I tried to copy the config.pri you posted on pixl.us and it tries to build but of course the paths are not working.

So:

  • How can i get a global.pri that doesn’t rely on a config.pri ? OR How to make a proper config.pri ?

Thanks for your answers!

QtCreator will complain, but it will still work.

You can of course just create the file (touch config.pri), it can be empty.

The config.pri used to build the official binaries: https://github.com/NatronGitHub/Natron/blob/RB-2.5/tools/jenkins/include/natron/Windows.pri

Great! I’m able to build now!
(The idea is to work on the slow file save issue)

So I Should stick to branch from RB-2.4 when i make some modifications and you and Fred will merge in RB-2.5 if needed. Am I right ?

If you are on Windows you should stick to RB-2.4, the Windows SDK is not ready for RB-2.5. You can of course do PR’s against RB-2.4, it will be merged into RB-2.5.

Let me know if you have some modifications against RB-2.4 and I can show you how to merge it into RB-2.5 before you do a PR.

Note that the project load/save is probably an issue with the SDK (Boost).

I will continue working on the Windows SDK in about a week (vacation starts then), I will then finish the Windows WIP SDK for RB-2.5. Fixing the load/save issue will be a priority.

Thank you.

Do you think I can help on the load save issue ?
My plan was to follow Fred’s advice in my dumb manner:
duplicate all load/save methods with boost binary serialisation (instead of XML)
and create a “Save binary” in the file menu.

You can try to add binary mode to the project files, can’t hurt to test.

My only concern is that it will just hide the actual problem, that Boost don’t work properly with MinGW/MSYS2. This is of course just my theory, could be something else.

We should have a minimal Qt/C++ project that is able to load a project file and output the time used to load/parse, then build it (and Boost) against MSYS2, MXE and MSVC. Then we at last know if it’s a MinGW, Boost or Natron issue.

You can make PRs on RB-2.4, they will be reviewed and merged if valid.
All changes to RB-2.4 will be merged into RB-2.5.
However, new features should not be introduced in RB-2.4, so please guard new features with #ifdef/#endif so that we can built the releases without these at the moment (including the bug-fix release 2.4.2). You can enable these features in your config.pri using DEFINES += MY_NEW_FEATURE.

The roadmap for Natron is to maintain features, fix bugs, and upgrade the base libraries:

  • 2.5: uses Python3, includes qtpy
  • 2.6: uses Qt5