Conan for building C++ Tango devices
P. Madela, Y.M. Abiven, G. Abeillé, X. Elattaoui, J. Pham, F. Potier, Synchrotron SOLEIL, Gif-sur-Yvette, FranceContextRealization

Control system CI/CDTools and infrastructure✓ Continuous integration to build software artifacts

 Components of our C++ factory are severely outdated✓ Semi-automatic continuous delivery to create packages

 No support for future platforms✓ Deployment of packages at each technical shutdown No support for latest C++ standards
 No support for building third-party code
 Maven is not common for C++ development

Developers

Source code
code

Binaries

buildPackages
releaseAcceptancetest

Control system

Significant effort was needed to establish essential build tools and infrastructure.
build tools for legacy Linux and Windows environments▪ Updated
Docker images for Linux, seamlessly integrating build tools.
▪ Created▪ Deployed new software infrastructure with key components:
as a Conan repository.
▪ Artifactory
for automating build processes.
▪ Jenkins▪ Docker-based Jenkins agents tailored for Linux.
▪ Jenkins agents for Windows with essential build tools.

deployJenkinsGitlab SoleilJenkins

Conan recipe

2 Software factories

C++• ~450 projects• 3 packages▪ Conan recipe is a python script that describes how to build andJava

package an application, a library, a tools …

• ~80 projects• 16 packages▪ It specifies the dependencies, build instructions, and othermetadata▪ It provides information about a library to consumers.
▪ Conan provides a collection of tools to help with building withinconanfile.py
from conan import ConanFile
from conan.tools.cmake import CMakeclass mydeviceRecipe(ConanFile):name = "mydevice"version = "0.0.7"
license = "GPL-3.0-or-later"
url = "https://gitlab.synchrotron-soleil.fr/mydevice"description = "A fantastic device"settings = "os", "compiler", "build_type", "arch"generators = "CMakeToolchain", "CMakeDeps"

Strategy

recipes

exports_sources = "CMakeLists.txt", "src/*"
requires = "yat4tango/1.13.13@soleil/stable","crashreporting2/1.0.3@soleil/stable"

Conan as a Maven alternative for C/C++

def build(self):cmake = CMake(self)
cmake.configure()
cmake.build()▪ Conan = Package and dependency manager for C/C++

def package(self):cmake = CMake(self)
cmake.install()▪ A repository system for multi-platforms and multi-binaries packages▪ An abstract build system for any other build system▪ Packages can be used from any build system: CMake, Make, MSBuild...
▪ A public central repository for the most popular open-source C/C++ libraries▪ An ideal solution for C/C++ continuous integration workflows[options]
shared=True[settings]
arch=x86
build_type=Debugcompiler=gcc
compiler.version=4.4
os=LinuxConan package
MyDevice/1.0.0

UniqueBinariesKey steps:
1. Learning Conan:▪

Begin by learning how to use Conan.

2. Building necessary libraries:

52f2f159f302466dee82a939a796924a

Recipe736e64cb544be5c42f25689b1c4fd21b

9787fb5d47cf495966b71c8b5c2f594d

Package ID’s

Transition to Conan[options]
shared=False[settings]
arch=x86_64
build_type=Releasecompiler=gcc
compiler.version=4.8
os=Linux▪

Build the required libraries for Tango device servers.

3. Proof of concept (POC):▪

Validate Conan's effectiveness and compatibility.

▪

Notable POCs:❑ Successfully built the Lima package on all target[options]
shared=False[settings]
arch=x86
build_type= Releasecompiler=msvc
compiler.version=180
os=Windows

platforms: CentOS 6, Centos 7, Windows (32-bit/64-bit).
❑ Created a Tango device with ChimeraTK, challenging on
CentOS platforms.
4. Automation:

Our forward-looking approach▪

Automate parts of the package-building process.

▪

Essential for managing diverse dependencies and platforms
efficiently.

▪ We have chosen CMake as our primary build system, which is widely adopted and versatile for both Linux and5. Transition to production:

Windows.

▪

▪ Conan's recipes help us include dependencies and compilation options, ensuring efficient development andreplacing Maven.

packaging of our Tango device servers.
▪ We adopted a forward-looking strategy to address component obsolescence and future needs, creating a new
infrastructure for both future and legacy 32-bit environments.

Shift all Tango device server projects to Conan and CMake,▪

Non-regression tests on control systems.

▪

Training and transfer of knowledge to developers

6. Next, more automation and quality:

Table 1: Number of C++ projects

TypeLinuxWindows

BothApplication

100▪

Automatic build of dependencies tree .

Libraries

2968▪

Add more unit tests.

Devices

330

5323

▪

Implement continuous inspection of code quality.

Benefits of adopting Conan and CMake▪ Conan and Cmake as a Maven alternative for our build system.

▪ Prepares for upcoming challenges:▪ Simultaneously builds devices for legacy and future platforms▪ Migration to 64-bit and newer compilers/standards.

▪ Facilitates collaborations while maintaining OS independence▪ Updating deployment processes.

▪ Simplifies upgrading third-party libraries▪ Expanding CI/CD capabilities for other domains.

▪ Centralized Jenkins pipelines templates▪ Shared profiles/configurations between CI/CD and developer’s environments

Well-equipped for developing future Tango device servers for the SOLEIL II upgrade with Conan and CMake.

SOLEIL, is a research center located near Paris, France. It is a particle (electron) accelerator that produces the synchrotron radiation, an extremely powerfullight that permits exploration of inert or living matter. SOLEIL covers fundamental research needs in physics, chemistry, material sciences, life sciences(notably in the crystallography of biological macromolecules), earth sciences, and atmospheric sciences.
It offers the use of a wide range of spectroscopic methods from infrared to X-rays, and structural methods such as X-ray diffraction and diffusion with 29 beamlines.
It delivers 6500 hours of beam time included 5000 hours for 2000 users per year since 2008.
https://www.synchrotron-soleil.fr