This is a modular and scalable open-source Adaptive AUTOSAR demo using C++17. The project utilizes CMake for build configuration, facilitating easy integration, testing, and future expansions.
- Modular Architecture: Easily add or remove components as needed.
- Scalable Design: Suitable for small-scale applications and large automotive systems.
- Comprehensive Testing: Includes tests to ensure reliability and correctness.
- Cross-Platform Support: Build and run on both Linux and QNX platforms with various architectures.
.
βββ CMake
βΒ Β βββ CMakeConfig
βΒ Β βΒ Β βββ gcc11_linux_aarch64_debug.cmake
βΒ Β βΒ Β βββ gcc11_linux_aarch64_release.cmake
βΒ Β βΒ Β βββ gcc11_linux_x86_64_debug.cmake
βΒ Β βΒ Β βββ gcc11_linux_x86_64_release.cmake
βΒ Β βΒ Β βββ qcc12_qnx800_aarch64_debug.cmake
βΒ Β βΒ Β βββ qcc12_qnx800_aarch64_release.cmake
βΒ Β βΒ Β βββ qcc12_qnx800_x86_64_debug.cmake
βΒ Β βΒ Β βββ qcc12_qnx800_x86_64_release.cmake
βΒ Β βββ Toolchain
βΒ Β βββ CMakeLogging
βΒ Β βΒ Β βββ tool_chain_log_config.cmake
βΒ Β βββ gcc11_linux_aarch64_debug.cmake
βΒ Β βββ gcc11_linux_aarch64_release.cmake
βΒ Β βββ gcc11_linux_x86_64_debug.cmake
βΒ Β βββ gcc11_linux_x86_64_release.cmake
βΒ Β βββ qcc12_qnx800_aarch64_debug.cmake
βΒ Β βββ qcc12_qnx800_aarch64_release.cmake
βΒ Β βββ qcc12_qnx800_x86_64_debug.cmake
βΒ Β βββ qcc12_qnx800_x86_64_release.cmake
βββ CMakeLists.txt
βββ CMakePresets.json
βββ LICENSE
βββ README.md
βββ build.sh
βββ components
βΒ Β βββ open-aa-platform-os-abstraction-libs
βΒ Β βΒ Β βββ CMakeLists.txt
βΒ Β βΒ Β βββ include
βΒ Β βΒ Β βΒ Β βββ ara
βΒ Β βΒ Β βΒ Β βββ os
βΒ Β βΒ Β βΒ Β βββ interface
βΒ Β βΒ Β βΒ Β βΒ Β βββ process
βΒ Β βΒ Β βΒ Β βΒ Β βββ process_factory.h
βΒ Β βΒ Β βΒ Β βΒ Β βββ process_interaction.h
βΒ Β βΒ Β βΒ Β βββ linux
βΒ Β βΒ Β βΒ Β βΒ Β βββ process
βΒ Β βΒ Β βΒ Β βΒ Β βββ process.h
βΒ Β βΒ Β βΒ Β βββ qnx
βΒ Β βΒ Β βΒ Β βββ process
βΒ Β βΒ Β βΒ Β βββ process.h
βΒ Β βΒ Β βββ src
βΒ Β βΒ Β βββ CMakeLists.txt
βΒ Β βΒ Β βββ ara
βΒ Β βΒ Β βββ os
βΒ Β βΒ Β βββ interface
βΒ Β βΒ Β βΒ Β βββ process
βΒ Β βΒ Β βΒ Β βββ CMakeLists.txt
βΒ Β βΒ Β βΒ Β βββ process_factory.cpp
βΒ Β βΒ Β βββ linux
βΒ Β βΒ Β βΒ Β βββ process
βΒ Β βΒ Β βΒ Β βββ CMakeLists.txt
βΒ Β βΒ Β βΒ Β βββ process.cpp
βΒ Β βΒ Β βββ qnx
βΒ Β βΒ Β βββ process
βΒ Β βΒ Β βββ CMakeLists.txt
βΒ Β βΒ Β βββ process.cpp
βΒ Β βββ open-aa-std-adaptive-autosar-libs
βΒ Β βββ CMakeLists.txt
βΒ Β βββ include
βΒ Β βΒ Β βββ ara
βΒ Β βΒ Β βββ core
βΒ Β βΒ Β βββ array.h
βΒ Β βΒ Β βββ internal
βΒ Β βΒ Β βββ location_utils.h
βΒ Β βΒ Β βββ violation_handler.h
βΒ Β βββ src
βΒ Β βββ ara
βΒ Β βββ core
βΒ Β βββ internal
βΒ Β βββ violation_handler.cpp
βββ tests
βββ core_platform
βββ CMakeLists.txt
βββ ara_core_array.cpp
This component provides OS abstraction layers, facilitating cross-platform support for different operating systems and chitectures. It includes interfaces and implementations for process management across Linux and QNX platforms.
Key Sub-components:
- Interface Layer: Defines abstract interfaces for process interactions (
process_factory.h
, `process_interaction.). - Linux Implementation: Provides concrete implementations for Linux platforms (
process.cpp
underlinux/process
). - QNX Implementation: Provides concrete implementations for QNX platforms (
process.cpp
underqnx/process
).
This component encompasses standard Adaptive AUTOSAR libraries, including core utilities and internal mechanisms sential for the project's functionality.
Key Sub-components:
- Core Utilities: Implements core functionalities such as the
ara::core::Array
class (array.h
). - Internal Utilities: Includes internal helpers for location handling and violation management (
location_utils.h
, violation_handler.h`).
Contains test applications to validate the core platform components. These tests ensure reliability and correctness of e implemented functionalities.
Key Files:
- ara_core_array.cpp: Test cases for the
ara::core::Array
class.
Before building the project, ensure that your system meets the following requirements:
- Operating System: Linux (tested on Ubuntu 22.04)
- C++ Compiler:
- GCC: Version 11.4.0 or later
- QNX QCC: Version 12 (for QNX builds)
- CMake: Version 3.27 or later
- Bash: Version 4.0 or later
- GNU Make: For building targets
sudo apt update
sudo apt install -y build-essential cmake gcc-11 g++-11
To build for QNX platforms, you need to install the QNX Software Development Platform (SDP). Please refer to QNX's official documentation for installation instructions.
The project is built via the build.sh
script. This script supports multiple configurations,
different toolchains, architectures, and exception safety modes.
./build.sh [OPTIONS]
-h
or--help
: Show help message and exit.-c
or--clean
: Perform a clean build by removing build and install directories.-t
or--build-type TYPE
: Specify the build type (Debug
orRelease
). Default isRelease
.-b
or--build-target TARGET
: Specify the build target. Supported options:gcc11_linux_x86_64
gcc11_linux_aarch64
qcc12_qnx800_aarch64
qcc12_qnx800_x86_64
-s
or--sdp-path PATH
: Specify the path toqnxsdp-env.sh
for QNX builds.-j
or--jobs N
: Specify the number of parallel jobs for the build. Defaults to number of CPU cores.-e
or--exception-safety MODE
: New: Specify exception safety mode:conditional
(default): only enableARA_CORE_ARRAY_ENABLE_CONDITIONAL_EXCEPTIONS
safe
: do not define that macro (i.e., βsafeβ mode)
./build.sh --clean -b gcc11_linux_x86_64 -t Release -j 8
./build.sh -b qcc12_qnx800_aarch64 -t Debug -s /path/to/qnxsdp-env.sh -e safe -j 4
./build.sh --clean -b gcc11_linux_aarch64 -t Release -e conditional
./build.sh --clean -b qcc12_qnx800_x86_64 -t Release -s /path/to/qnxsdp-env.sh -j 4
The project supports the following build targets:
Build Target | Compiler | Platform | Architecture | Build Type |
---|---|---|---|---|
gcc11_linux_x86_64 |
GCC 11 | Linux | x86_64 | Release/Debug |
gcc11_linux_aarch64 |
GCC 11 | Linux | aarch64le | Release/Debug |
qcc12_qnx800_aarch64 |
QCC 12 | QNX | aarch64le | Release/Debug |
qcc12_qnx800_x86_64 |
QCC 12 | QNX | x86_64 | Release/Debug |
Note: Append Debug
or Release
internally based on --build-type
, set by the script.
The tests
directory contains test apps for the project. After building, tests can be executed as follows:
cd install/<build-target>/
./platform_core_test/bin/ara_core_array_test [OPTION]
-
Create a New CMake Configuration File:
- Navigate to
CMake/CMakeConfig/
and create a new.cmake
file based on existing configurations.
- Navigate to
-
Define the Build Target in the Build Script:
- Update the
build.sh
script to recognize the new build target and map it to the appropriate configuration file.
- Update the
-
Update
CMakePresets.json
:- Add a new preset corresponding to the new build target for seamless integration with CMake.
-
Add a New Component Directory:
- Create a new directory under
components/
for your component.
- Create a new directory under
-
Define
CMakeLists.txt
for the Component:- Ensure that the component's
CMakeLists.txt
properly sets up include directories, dependencies, and installation les.
- Ensure that the component's
-
Include the Component in the Root
CMakeLists.txt
:- Add
add_subdirectory(components/your-component)
to include it in the build process.
- Add
-
CMake Not Found:
- Error:
cmake: command not found
- Solution:
Ensure that CMake is installed and added to your PATH.
sudo apt install -y cmake
- Error:
-
QNX Environment Variables Not Set:
- Error:
Error: QNX_HOST and QNX_TARGET environment variables must be set.
- Solution:
Ensure correct SDP path or environment is sourced via
-s /path/to/qnxsdp-env.sh
.
- Error:
-
Toolchain File Not Found:
- Error:
Error: Toolchain file not found: CMake/CMakeConfig/gcc11_pikeos5_armv8hf.cmake
- Solution: Verify that the toolchain file exists in the specified directory and that the build target is correctly specified.
- Error:
-
Compilation Errors:
- Cause: Possible mismatches between compiler versions or missing dependencies.
- Solution: Ensure that the correct compiler is being used and all dependencies are installed.
If you encounter issues not covered in this section, feel free to open an issue on the GitHub repository.
Contributions are welcome! Please follow these steps to contribute:
- Fork the Repository: Create your own fork of the project.
- Create a Feature Branch: Develop your feature or bug fix in a separate branch.
git checkout -b feature/my-new-feature
- Commit Your Changes: Make your changes and commit them with descriptive messages.
git commit -m "Add new feature XYZ"
- Push to Your Fork: Push your changes to your forked repository.
git push origin feature/my-new-feature
- Submit a Pull Request: Open a pull request against the
master_integration
branch of the main repository.
This project is licensed under the MIT License. See the LICENSE file for details.