aqnwb 0.1.0
Loading...
Searching...
No Matches
Installation & Setup

Requirements

Please ensure that the required libraries described in the User Requirements section are installed.

For developers we also recommend to install the following optional command line tools used for generating the documentation, for code quality checks, and for debugging.

  • Documentation: Additional requirements for building the documentation (optional)
  • Code checks: Additional command line tools used in developer mode dev
    • cppcheck
    • clang-format (optional, required for target=format-check, target=format-fix)
    • codespell (optional, required for target=spell-check, target=spell-fix)

Developer Build

Build system targets that are only useful for developers of AqNWB are hidden if the aqnwb_DEVELOPER_MODE option is disabled. Enabling this option makes tests and other developer targets and options available. You can enable the option when configuring the build by adding -Daqnwb_DEVELOPER_MODE=ON, e.g.,

cmake -S . -B build -Daqnwb_DEVELOPER_MODE=ON

Use the flag -DBUILD_SHARED_LIBS=ON to generate the shared library file.

Note
If you are using custom installations of HDF5 or BOOST that are not being detected automatically by cmake, you can specify HDF5_ROOT and BOOST_ROOT environment variables to point to install directories of HDF5 and BOOST respectively.

Developer Presets

As a developer, you can create your own dev preset by making a CMakeUserPresets.json file at the root of the project:

{
"version": 2,
"cmakeMinimumRequired": {
"major": 3,
"minor": 15,
"patch": 0
},
"configurePresets": [
{
"name": "dev",
"binaryDir": "${sourceDir}/build/dev",
"inherits": ["dev-mode", "ci-<os>"],
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
}
],
"buildPresets": [
{
"name": "dev",
"configurePreset": "dev",
"configuration": "Debug"
}
],
"testPresets": [
{
"name": "dev",
"configurePreset": "dev",
"configuration": "Debug",
"output": {
"outputOnFailure": true
}
}
]
}

Replace <os> in the CMakeUserPresets.json file with the name of the operating system you have (win64, linux or darwin).

Configure, Build and Test

You can configure, build and test the project respectively with the following commands from the project root on any operating system with any build system:

cmake --preset=dev
cmake --build --preset=dev
ctest --preset=dev

Developer Mode Targets

Additional targets can be invoked when in development mode using the commands below

cmake --build --preset=dev --target=<name of the target>

Target options

  • format-check: run the clang-format tool on the codebase to check for formatting errors
  • format-fix : run the clang-format tool on the codebase with FIX=YES to both check and automatically fix for formatting errors
  • spell-check: run the codespell tool on the codebase to check for common spelling errors
  • spell-fix : run the codespell tool on the codebase with FIX=YES to both check and automatically fix common spelling errors
  • docs : builds the documentation using Doxygen. (Note: run cmake --preset=dev -DBUILD_DOCS=ON before building to add docs target)