This project serves to provide common used utility functions across multiple NXAI applications. Placing these commonly used functions in a single source library reduces code duplication, bugs and maintenance costs.
The design is to have multiple libraries which can be used from multiple projects, and can be extended in the future.
Currently the projects include:
- NXAI C Utilities. A C/C++ based library which can be imported in any C/C++ application to provide convenience functions as well as interface functions for the NXAI AI Manager.
The application can be compiled on any architecture in a Linux environment.
For easy compilation, ensure CMake
is installed. On Debian based systems:
sudo apt install cmake
In the source directory,
Create folder for build:
mkdir build && cd build
Configure build:
cmake ..
Compile library:
cmake --build .
To add this library to your CMake project, add the following to the CMakeLists.txt
:
# Add NXAI C Utilities library
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/path/to/nxai-utilities)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/path/to/nxai-utilities/include)
target_link_libraries(<target> nxai-c-utilities)
add_subdirectory
tells your project where to find the NXAI C Utilities library.include_directores
tells your project where to find the header files. This allows you to call the utility functions from your source files.target_link_libraries
links the library to your target. This also ensures that the library will be built when you build your target.
If you have CI/CD enabled in your project which makes use of this repository, you need to instruct the CI/CD pipeline to also pull submodules. You can do this by adding the following variables, either per job or globally in the file:
variables:
GIT_SUBMODULE_STRATEGY: normal
GIT_SUBMODULE_FORCE_HTTPS: "true"
GIT_SUBMODULE_DEPTH: 1
The second step is to give your project access rights to use this project in CI/CD. This project has restricted access for CI/CD jobs, so each project that uses it must be added manually.
To do this:
- Navigate to this project in GitLab
- Navigate to
Settings
->CI/CD
- Navigate to
Token Access
- Add the path to your project starting with
ai/
Your project should now be able to pull the project and use it during CI/CD jobs.
Copyright 2024, Network Optix, All rights reserved.