Skip to content
Snippets Groups Projects
Christophe Guillon's avatar
Christophe Guillon authored
Add support for pip -e development (editable) mode.
Add some environment vars for configuring the cmake build in
development mode:
- AIDGE_BUILD_GEN=<cmake_backend>: for instance Ninja to use
  the ninja backend which better supports incremental build
- AIDGE_BUILD_MODE=[Debug|Release]: define the build mode,
  defaults to Debug

Note that due to behavior changes depending on the
python/setuptools versions, the portable method to ensure
incremental build on C++ files is to use:

pip install --no-build-isolation -v -e .

Refer to the doc string of setup.py for details.
733b9b23
History

Pipeline status C++ coverage Python coverage

Aidge Core library

You can find here the C++ code of the Core library of Aidge.

Pip installation

To install aidge_core using pip, run the following command in your python environnement :

pip install . -v

Note: you can specify a custom install folder by setting an environment variable:

export AIDGE_INSTALL='<path_to_aidge>/install'

Development Mode installation

Install in development mode (local changes to python files and .cpp files do not require full installation) with:

pip install cmake ninja # enforce build dependencies (added also ninja here as we request it as build backend)
export AIDGE_BUILD_GEN=Ninja
pip install --no-build-isolation -v -e .

After changes in a python file, no action is required, for changes in .cpp/.h file, re-execute:

pip install --no-build-isolation -v -e .

In this mode, the C++ compilation build system is located in the local build/ directory.

Refer to the doc string in setup.pyfor more details on editable mode.

Standard C++ Compilation

Create two directories build and ìnstall.

Then inside build :


cmake -DCMAKE_INSTALL_PREFIX:PATH=$(path_to_install_folder) $(CMAKE PARAMETERS) $(projet_root)

make all install

Compilation options

Option Value type Description
-DCMAKE_INSTALL_PREFIX:PATH str Path to the install folder
-DCMAKE_BUILD_TYPE str If Debug, compile in debug mode, Release compile with highest optimisations, default= Release
-DWERROR bool If ON show warning as error during compilation phase, default=OFF
-DPYBIND bool If ON activate python binding, default=ON

If you have compiled with PyBind you can find at the root of the build file the python lib aidge_core.cpython*.so

Run tests

CPP

Inside of the build file run:


ctest --output-on-failure

Python