A PID environment provides a set of commands to manage its lifecycle. As usual these commands can be called from the build folder of the environmeny project using the native build tool (e.g. make) or by using the pid script directly into the wrapper folder.

If using the build tool, the project must be configured once before using CMake:

cd <workspace dir>/environments/<environment name>/build
cmake .. #building commands

We suppose here we use the pid script but any native build system (e.g. make, ninja) can be used with same commands (these commands are then targets for the build tool and arguments are environment variables).

Commands summary

  • build: building the environment with given platform and user-defined constraints. Used to test if environment works.
  • referencing: Referencing the environment in the workspace.
  • update: Update the environment from its official repository.
  • hard_clean: Hard cleaning of the environment build tree.

Building the environment

  • Call: pid build
  • Effect: evaluates environment against host configuration and if successful generates adequate CMake files used to configure workspace build process. This command is mainly used to test enviroments while they are developped.
  • Optional arguments:

    • platform: specify a constraint on target platform when evaluating environment (e.g. x86_64_linux_stdc++11).
    • instance: specify a constraint on target platform instance name to use when evaluating environment (e.g. my_robot_platform).
    • proc_type: specify a constraint on target processor type when evaluating environment (e.g. x86, arm).
    • proc_arch: specify a constraint on target processor architecture (e.g. 32, 64).
    • os: specify a constraint on target operating system (e.g. linux, macosx).
    • abi: specify a constraint on target C++ ABI (e.g. stdc++, stdc++11, c++).
    • distribution: specify a constraint on target distribution (e.g. ubuntu, debian).
    • distrib_version: specify a constraint on target distribution version.
    • sysroot: specify a sysroot for crosscompilation.
    • staging: specify a staging folder for crosscompilation.
    • other arguments are environment specific and defined by their respective constraints. A very common specific argument is version to specify minimal version of a toolchain and exact to tell if this required version must exactly match the constraint .
  • Example:

  • Evaluating if an environment is usable on your current host.
pid cd clang_toolchain
pid build version=3.8

If we suppose the clang version 3.8 is installed or installable on your host system, the output should be:

[PID] INFO : environment clang_toolchain has been evaluated.
[PID] description of environment clang_toolchain solution
- configured languages:
  + C:
    * compiler : /usr/bin/clang (id=Clang)

  + CXX:
    * compiler : /usr/bin/clang++ (id=Clang)

  + ASM:
    * compiler : /usr/bin/clang (id=Clang)

It gives the languages that are configured by the nvironment, here the default languages.

  • Evaluating if an environment providing extra dev tools is usable in your current host.
pid cd pkg-config
pid build

If the pkg-config tool is usable, the output should look like :

[PID] INFO : environment pkg-config has been evaluated.
[PID] description of environment pkg-config solution
- configured extra tools:
  + pkg-config:
    * program: /usr/bin/pkg-config
    * plugin callbacks:
         + after components: /home/robin/soft/PID/pid-workspace/environments/pkg-config/src/use_pkg-config.cmake

This environment provides the possibility to use the pkg-config program that is an extra tool. Extra tools are those programs that are not natively managed by PID or CMake (like compiler toolchains) but for which we can define plugin mechanism to allow so. Here the pkg-config environment defines a plugin that activate after components of a package are specified. It automatically generates pkg-config description of the components generated by the package.

Referencing the environment in the workspace

  • Call: pid referencing
  • Effect: generates the reference file for the environment and places it in the adequate folder of the workspace. When done, the environment is known in the local workspace and will be known by all users when workspace official repository will be updated accordingly.
  • Arguments: none

  • Example:
pid cd <environment>
pid referencing

Updating the environment

  • Call: pid update
  • Effect: updates the local repository of the environment from its official remote.
  • Arguments: none

  • Example:
pid cd <environment>
pid update

Cleaning the environment

  • Call: pid hard_clean
  • Effect: Cleaning the environment build tree in a agressive and definitive way.
  • Arguments: none

  • Example:
pid cd <environment>
pid hard_clean