Building Cloe

Note

Before you follow any of the steps described below, please make sure that you complete all steps described on the Installation page. Please also read the sections on Understanding Cloe Packages first.

Suppose you intend to modify the content of one of Cloe’s multiple Conan packages. Below you can find some hints on how to build and test your package of interest without exporting it to the Conan local cache every time.

Build System

If you are developing Cloe itself, it is necessary to understand how the build system is composed. In essence, we are using GNU Make as a wrapper for Conan, and Conan as a wrapper for CMake. The following files are present in the root directory of every Cloe package (e.g. in plugins/basic/):

Makefile

Contains a set of targets that can be run in this directory. For most packages, the Makefile.package from the top-level directory is included to provide Make targets for the most common Conan commands. Refer to the output of make help in the respective package directory for a list of the available targets (here: make -C ./models help):

make: Entering directory '/home/docs/checkouts/readthedocs.org/user_builds/cloe/checkouts/v0.24.0/models'
Usage: make target

The following targets define common operations with this package in
editable (local in-source) and uneditable (in the Conan cache) modes.

Available targets:
  help                  show this help                                
  status                show status of package                        
  info                  show detailed package info                    
  smoketest-deps        build smoketest dependencies for package      
  smoketest             run smoketests for package (requires built packages) 

  export                export recipe and sources                     [conan-cache]
  download              download or create package                    [conan-cache]
  package               create package with build policy              [conan-cache]
  package-all           create package and dependencies               [conan-cache]
  package-outdated      create package if outdated                    [conan-cache]
  list                  list installed package files                  [conan-cache]
  purge                 remove package from cache                     [conan-cache]

  editable              instruct Conan to use in-source build         
  uneditable            instruct Conan to use local cache             

  all                   build the package                             [in-source]
  configure             install dependencies and configure package    [in-source]
  test                  run CMake tests if they are available         [in-source]
  export-pkg            export build artifacts to Conan cache         [in-source]
  clean                 remove build directory                        [in-source]

  Configuration:
    LOCKFILE_SOURCE = 
    SOURCE_DIR      = .
    BUILD_DIR       = build
    BUILD_POLICY    = outdated
    BUILD_TYPE      = 
    CONAN_OPTIONS   = 

  Package information:
    PACKAGE_NAME    = cloe-models
    PACKAGE_VERSION = 0.24.0-dirty
    PACKAGE_CHANNEL = cloe/develop
    PACKAGE_FQN     = cloe-models/0.24.0-dirty@cloe/develop
    PACKAGE_EDITABLE= not-editable
    PACKAGE_ID      = 
    PACKAGE_DIR     = 
    PACKAGE_DATE    = 
    GIT_COMMIT_HASH = 1f4d608

make: Leaving directory '/home/docs/checkouts/readthedocs.org/user_builds/cloe/checkouts/v0.24.0/models'
conanfile.py

Conan package recipe. To gain a thorough understanding of the Conan methods and tools used therein, the Conan CMake integration and Conan recipe reference documentation is probably a good starting point.

CMakeLists.txt

Contains cross-platform instructions for how to build, test, and install the package. The configuration is done via Conan. You may come across CMake Cloe-specific CMake functions such as cloe_add_plugin, which are defined in runtime/cmake/CloePluginSetup.cmake in the top-level directory. Conan-specific declarations are contained in conanbuildinfo.cmake, which will be generated after conan install is invoked.

In-Source Builds

Suppose you are making changes to the basic controller plugin and you would like to build your modified package in your local working directory. To do this, you may build Conan packages in editable mode. Try it out:

cd plugins/basic/
make editable

Verify that the cloe-plugin-basic package is currently in editable mode:

make status

Note

Positive-Example:

editable : cloe-plugin-basic/0.18.0-rc5-3-g53c80db@cloe/develop

Negative-Example:

ok       : cloe-plugin-basic/0.18.0-rc5-3-g53c80db@cloe/develop

Now, you can build the package binaries in your local working directory:

make clean all

Since the package is in editable mode, the binaries will be created in the ./build/ directory in your package sub-directory.

When you finalize work on your package, remember to remove the editable mode:

make uneditable

Verify the package status:

make status

If you execute the latter command from the top-level directory, you will see the status of all Cloe packages.