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 is compliant with most IDE including Visual Studio.

Install your IDEs

Visual Studio

You will have to install Visual Studio to get the corresponding compiler and debugger on your machine. If you will use Visual Studio only to carry out academic research, or to contribute to open source projects, you can download the community version 2017 which has been tested and is available on the following link: Visual Studio installer

We recommend to install at least the following features:

  • Desktop Development C++

  • Game development with Unity (useful to develop and debug Unity applications)

QT Creator

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.

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. Then, when the list of all components to install is displayed, check the box Archive to display old versions of Qt supporting MSVC 2017. 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):

  • Preview

    • QT creator

    • QT Creator CDB Debugger Support

  • Qt

    • Qt 5.14.2

      • with MSVC 2017 64-bit

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

    • Developer and Designer Tools

      • Qt Creator CDB Debugger Support

      • Debugging Tools for Windows

      • CMake 64-bit

      • Ninja

and start the installation.

QT Visual Studio Tool

If you are more comfortable with Visual Studio, you will have to install the Visual Studio plugin called QT Visual Studio Tool which will allow you to open Qt projects. To do so, Open Visual Studio, click on Tools menu, then on Extensions and Updates. Search for Qt Visual Studio Tools, and install it. To complete this installation, you must restart Visual Studio.

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

  • Start by downloading and installing the latest version of Remaken available on the following link: Remaken installer

  • Launch the remaken installer with administrator rights. By default, the dependencies will be installed in your C:/Users/%Username%/.remaken/packages directory, but you can change it by setting another location for your REMAKEN_PKG_ROOT environment variable. By default, Remaken will install Conan, pkg_config and CMake which will be used afterwards. Conan will check these remotes for searching your dependencies.

  • Set XPCF_MODULE_ROOT environment variable to C:/Users/%Username%/.remaken/packages/win-cl-14.1 (if REMAKEN_PKG_ROOT is set to its default value)

  • 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 this conan remote with the following command 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]
  • Then, open a command prompt with administrator rights and run:

remaken init -f -e

This command will install the latest the qmake building rules in your C:/Users/%Username%/.remaken/rules folder.

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 cl-14.1 -o win -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=15 default
conan profile update settings.ceres-solver:build_type=Release default
conan profile update settings.ceres-solver:compiler.runtime=MD 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=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.cppstd=17
compiler.version=15
build_type=Release
ceres-solver:build_type=Release
ceres-solver:compiler.runtime=MD
[options]
[build_requires]
[env]
ceres_solver package has problems with glog in debug mode, that is why Release build_type is forced for it in the conan 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.

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#install-windows

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 terminal 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 C:/Users/%Username%/.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-win.txt. 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 module will download and build third parties using Conan which requires CMake (minimum version 3.10).

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 Windows, build scripts are available in the scripts folder. Just run build_all.bat 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.bat --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.bat will not build modules PopSift, FBOW and OpenCV with CUDA optimization. To do it, launch build_allModulesCuda.bat.

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 in the root folder of SolAR:

  • SolARCore

  • SolARAllModules

  • SolARAllModulesTests

  • SolARAllSamples

  • SolARAllPipelines

  • SolARAllPipelineTests

  • SolARAllServices

  • SolARAllServicesTests

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

Check by clicking on the Projects tab, and then on the Manage Kits…​ button that your QT MSVC2017 64bit kit is well configured (Microsoft Visual C++ Compiler should be in version 15.x.x.x (x86_amd64) if your are using Visual Studio 2017).

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.
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. Set qmake system() behavior when parsing to Ignore 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 Run qmake on each project (right click on the parent project in the projects view) , and when it is done, click on Rebuild All Projects for All Configurations, and go get a cup of coffee.

When using visual compiler on QT creator, you do not need to add a make step to install built binaries. In the children project files (.pro), you will find a line with PROJECTCONFIG = QTVS. This configuration will automatically manage installation step according to the argument set to variable DEPENDENCIESCONFIG, and it also works for visual studio. For more information, see the documentation of the builddefs-qmake project on GitHub.

Build on Visual Studio

You have first to set the path of Qt for Qt Visual Studio Tool. Click on the Qt Vs Tools tab, and then on Qt Options. Add a new Qt Version (for instance name: 5.14.1 MSVC207_64, path: C:\Qt\5.14.1\msvc2017_64).
When this is done, simply open the Qt parent projects by cliking on the Qt VS Tools tab, and on Open Qt Project File (.pro). Then build your projects. It’s done!

Q&A

Conan Error when installing dependencies: PermissionError: [WinError 5]

Some Conan recipes are renaming the unzipped folders embedding the source code of the dependence as soon as they are downloaded locally. Unfortunately, your antivirus or the Windows Search Indexing can lock it. We recommend to deactivate Windows Search Indexing on Conan folders, and check your antivirus to avoid any control after unzipping the conan package. If you still have a problem, you will have to add time.sleep() before renaming your unzipped folder in your problematic conan recipes (see the following thread for more details: https://github.com/conan-io/conan/issues/5205).

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

If not, sometimes the remaken setup encounters conflicts with a version of Python already installed on your machine. If it is the case, install cmake by your own with pip:

pip install cmake