.. include:: ../../../../exports/alias.include .. include:: ../../../../exports/roles.include .. _developer_manual_installation_sources_windows_colcon: ############################################## Windows installation from sources using colcon ############################################## colcon_ is a command line tool based on CMake_ aimed at building sets of software packages in a tidy and easy way. The instructions for installing the |amlip| using colcon_ application from sources and its required dependencies are provided in this page. Installation ============ This section explains how to install |amlip| using colcon_. Download eProsima dependencies ------------------------------ #. Create a :code:`AML-IP` directory and download the :code:`.repos` file that will be used to install |amlip| and its dependencies: .. code-block:: bash mkdir \AML-IP cd \AML-IP mkdir src wget https://raw.githubusercontent.com/eProsima/AML-IP/main/amlip.repos vcs import src < amlip.repos .. note:: In case there are already some eProsima libraries installed in the system, it is not required to download and build every dependency in the :code:`.repos` file, but just those projects that are not already in the system. Refer to section :ref:`eprosima_dependencies` in order to check how to source those libraries. Build packages -------------- #. Build the packages: .. code-block:: bash colcon build --packages-up-to-regex amlip .. note:: Not all the sub-packages of all the dependencies are required. In order to build only the packages required, use the colcon_ option :code:`--packages-up-to `. *e.g. the* |amlip| *C++ library is completely built using* :code:`--packages-up-to amlip_cpp` For more details about the colcon_ available arguments, please refer to `packages selection `_ page of the colcon_ manual. .. note:: Being based on CMake_, it is possible to pass the CMake_ configuration options to the :code:`colcon build` command. For more information on the specific syntax, please refer to the `CMake specific arguments `_ page of the colcon_ manual. For more details about the available CMake_ options, please refer to the :ref:`cmake_options` section. Run Tests --------- Tests are not automatically built within the |amlip| project. Use CMake_ option `BUILD_TESTS` when building the project in order to activate tests. This could also be done by a `colcon.meta file `_ to only activate tests in the desired packages. #. Build the packages with tests: .. code-block:: bash colcon build --packages-select-regex amlip --cmake-args "-DBUILD_TESTS=ON" #. Run tests. Use :code:`--packages-select ` to only execute tests of a specific package: .. code-block:: bash colcon test --event-handlers=console_direct+ --packages-select amlip_cpp Source installation =================== To source the installation of the |amlip| previously built in order to link it to another built or to use its tools, use the following command: * Command prompt: .. code-block:: bat install/setup.bat * PowerShell: .. code-block:: bash install/setup.ps1 .. External links .. _colcon: https://colcon.readthedocs.io/en/released/ .. _CMake: https://cmake.org Build demos =========== There is a demo sub-package that can be installed along with the project. In order to install this package use one of these 2 commands: .. code-block:: bash # To build all sub-packages colcon build .. code-block:: bash # To only build demo package and its dependencies colcon build --packages-up-to \ amlip_collaborative_learning_demo \ amlip_tensorflow_inference_demo \ amlip_tensorflow_inference_rosbot2r_demo \ amlip_tensorflow_inference_rosbot2r_demo