Supported distribution

Currently, only Ubuntu 18.04 and Ubuntu 20.04 distribution has been tested, and are highly recommended. We plan to support Ubuntu 22.04 very soon.

Install development environment

The SolAR framework uses a dedicated pipeline to link and compile code as well as internal tools for third party downloads which should make your job much easier. As you will see later, the SolAR framework is based on QMake originally created by the Qt Company, but compliant with most IDE.

Install QT Creator IDE

As SolAR is using QMake file to setup the projects, we highly recommend to install Qt Creator. Moreover, you will have access to wizards which will help you create new SolAR modules, components and pipelines.

Start to install required packages:

sudo apt install build-essential libqt5x11extras5

Ubuntu 18.04

Install default Qt5 package:

sudo apt install qt5-default

Download the latest version of QTCreator compatible with Ubuntu 18.04, namely the version 5.0.3: QT Creator 5.0.3 installer download

When downloaded, just install QT Creator 5.0.3:

chmod +x qt-creator-opensource-linux-x86_64-5.0.3.run
./qt-creator-opensource-linux-x86_64-5.0.3.run

Ubuntu 20.04

Download the latest version of QTCreator on the following link (scroll down to choose "Downloads for open-source users" for open-source development):

Create a Qt account if not already done, select where you want to install Qt. You don’t need to install Qt SDK, just the Qt Creator. So just check the following components (if not available during installation, search for QT maintenance tool or QT uninstall after installation to launch the QT tools to upgrade it):

  • Qt x.x.x (last version proposed)

    • With Desktop gcc 64-bit

    • Android (if you want to build SolAR for Android)

  • Developer and Designer Tools

and start the installation.

Install dependencies

To download dependencies, the SolAR framework uses the meta dependencies management tool Remaken supporting Conan, VCPKG and its native C++ packaging structure based on pkg-config description files.

Install Remaken

  • Download the XPCF Linux Installer zip file.

  • Uncompress this zip file.

  • If Homebrew is not installed on your machine, you can run the following script ./installBrew.sh. Homebrew is used to install Remaken.

  • run source ~/.profile to update brew eval modification to your ${HOME}/.profile. Try brew --version commands in terminal to check installation

  • Then, run `./installRemaken.sh `. This will install the latest version of remaken on your machine.

  • You can specify where remaken will install its packages by setting the desired path to REMAKEN_PKG_ROOT (defaults to ~/.remaken/packages/)

  • Add the XPCF_MODULE_ROOT environment variable with the following command
    test -r ~/.profile && echo "export XPCF_MODULE_ROOT=~/.remaken/packages/linux-gcc/" >>~/.profile (if REMAKEN_PKG_ROOT is not set and default path is used)

  • run again source ~/.profile to update your ${HOME}/.profile.

  • By default, Remaken installer will also install Conan, cmake and pkg_config which will be used afterwards. Try remaken --help, conan -h, and cmake -h commands in a terminal to check installation. Conan will check these remotes when searching for your dependencies.

  • SolAR has its own conan remote to store pre-built dependencies for the common configurations used by the SolAR Framework. You will need to add these conan remotes with the following commands in a command prompt:

conan remote add conan-solar https://repository.solarframework.org/conan --insert 0

You should obtain a list of conan remotes that looks like this:

$ conan remote list
conan-solar: https://repository.solarframework.org/conan [Verify SSL: True]
conancenter: https://center.conan.io [Verify SSL: True]

If other remotes are installed, such as conan-center or bincrafters (both deprecated), you can remove them by running
conan remote remove name_of_the_remote
or just disable them by running
conan remote disable name_of_the_remote.

Then, run:

remaken init -e -f

This command will install the latest version of qmake building rules in your ${USER_HOME}/.remaken/rules folder.
Permanently add the PKG_CONFIG_PATH environment variable pointing to the folders where .pc files can be found:

test -r ~/.profile && echo "export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig" >>~/.profile

and reload your .profile:

source ~/.profile

Finally, you need to configure your remaken profile according to your development environment. To do so, run the following command in a command prompt:

remaken profile init --cpp-std 17 -b gcc -o linux -a x86_64

Set conan profile

As we are using conan to download dependencies, you need to configure your default conan profile. To do so, create a new default profile with the following command:

conan profile new default --detect

Do not take care about the warning !
Then, update your default conan profile with the following commands:

conan profile update settings.compiler.libcxx=libstdc++11 default
conan profile update settings.compiler.cppstd=17 default
conan profile update settings.compiler.version=7 default
conan profile update settings.ceres-solver:build_type=Release default

Check that your default conan profile is well set by running:

conan profile show default

It should look like the following one:

[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=7
compiler.libcxx=libstdc++11
compiler.cppstd=17
build_type=Release
[options]
[build_requires]
[env]

Finally, set an environment variable to ask conan to automatically install system packages required by some recipes:

test -r ~/.profile && echo "export CONAN_SYSREQUIRES_MODE="enabled"" >>~/.profile

Now, you are ready to download your dependencies with remaken.

Install CUDA

If you want to build or run SolAR pipelines with CUDA optimizations, you will need to install CUDA.

Follow the Nvidia instructions available on the following links:

You will also need to install cuDNN to run deepl learning inference by following the Nvidia instructions: https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html

Add the required environment variables:

test -r ~/.profile && echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib" >>~/.profile
test -r ~/.profile && echo "export CUDA_PATH=/usr/local/cuda/" >>~/.profile

Use Remaken

Remaken uses a file called packagedependencies.txt to describe which depedencies to install, in which version, where to install them, where to download them, with which package manager and with which configuration.

A global packagedepedencies.txt defining the common dependencies with specific packagedependencies-<os>.txt files defining dependencies which are specific for each os are available in the parent GIT repository SolAR, and can be downloaded on the following link:

Copy these files where you want on your computer, open a command prompt in the folder where you have copied the packagedependencies.txt and packagedependencies-<os>.txt files, and run remaken with the following command:

remaken install packagedependencies.txt

This command will install all SolAR dependencies in release mode in your ${HOME}/.remaken/packages folder. You can go and have a cup of coffee while it’s downloading.

To download the dependencies in debug mode, run the following command:

remaken install -c debug packagedependencies.txt
You do not need to launch remaken install on packagedependencies_linux. remaken install packagedependencies.txt will automatically load it depending on the platform you are executing it.

This is done, all your dependencies are downloaded and ready to use !

Some of the modules will download and build third parties using Conan which requires CMake.

Build SolAR

Clone SolAR

SolAR is made up of a multitude of projects (SolAR Framework, SolAR pipeline manager, modules, samples, etc.). To help you, we have created a parent repository with sub-modules regrouping all source codes of SolAR projects. You can clone it from the following url: https://github.com/SolarFramework/SolAR.git

No space in the path of the folder where you are cloning SolAR !
git clone --recurse-submodules https://github.com/SolarFramework/SolAR.git

If you forgot to use --recurse-submodules, you can initialize the submodules afterwards with:

cd SolAR
git submodule update --init --recursive

If you want to move all submodules on HEAD of master, launch the following commands

git submodule foreach --recursive git checkout master
git submodule foreach --recursive git pull

If you do not want to download all the source codes of SolAR, you can have a look to the different repositories available on Github on the Community/Git page.

Build with scripts

For Linux, build scripts are available in the scripts folder. Just run ./build_all.sh to rebuild the SolAR framework, the modules and their tests, the pipelines and their tests, the samples, the services and their tests. If you want to rebuild them seprately, use the corresponding script. Check with ./build_all.sh --help the different options such as the cross-build for Android, the number of processors to use, the version of Qt, the path to SolAR root folder, etc.

build_all.sh will not build modules PopSift, FBOW and OpenCV with CUDA optimization. To do it, launch build_allModulesCuda.sh.

Build on Qt Creator

Counting the framework, the pipeline manager, modules, module tests, samples, pipelines, pipeline tests, there are more than 60 QT projects on GitHub. In order to ease the building of all these projects, they are grouped in the following parent QT projects available into the root folder of SolAR:

  • SolARCore

  • SolARAllModules

  • SolARAllModulesTests

  • SolARAllSamples

  • SolARAllPipelines

  • SolARAllPipelineTests

  • SolARAllServices

  • SolARAllServicesTests

You can open one of them or all in QT Creator.

If you have not yet run a qmake on each project, some error could appear concerning the fact that conanbuildinfo.pri files do not exist. This is normal, run qmake on each project will create these files, and the error message will no longer appear.

Check by clicking on the Projects tab, and then on the Manage Kits…​ button that your Qt x.x.x GCC 64 bit kit is well configured.

The build step will copy the built binaries into ${HOME}/.remaken/packages for the modules and pipelines, and into <module>/deploy for samples and tests.

Since QT Creator 4.14.0, we highly recommand to set the project option qmake system() behavior when parsing to Ignore to highly reduce the project loading time. But do not forget to run qmake on projects before building them.
Add install argurment
Figure 1. Add install and install_deps argument for Debug and Release mode.

If you open several projects, you will have to set their build order. You can do it in QT Creator by defining the dependencies of each project in the Projects menu, select your project, click on Dependencies, and check the projects that depend directly on the selected project (checking `Synchronize configuration' will synchronize all projects in Debug or Release configuration).

Edit build settings
Figure 2. Project dependencies settings
Table 1. Project dependencies
Project Project dependencies

SolARCore

No dependency

SolARAllModules

SolARCore

SolARAllModulesCuda

SolARCore

SolARAllModulesTests

SolARAllModules

SolARAllPipelines

SolARAllModules

SolARAllPipelineTests

SolARAllPipelines

SolARAllSamples

SolARAllModules

SolARAllServices

SolARAllPipelines

SolARAllServicesTests

SolARAllServices

Then, in the Build menu, click on Rebuild All Projects for All Configurations, and go get a cup of coffee.

Q&A

Remaken does not work

Be sure to install, init and use Remaken from a command prompt with admin rights. You can check that cmake, pkg-config and conan are well installed with the following command:

cmake -version
pkg-config --version
conan -v