This is a modular and scalable open-source Adaptive AUTOSAR demo using C++17. The project leverages CMake for build configuration, enabling straightforward integration, testing, and future expansion.
- Key Features
- Repository Structure
- Components Overview
- Tests Overview
- Prerequisites
- Building the Project
- Build Targets
- Testing the Project
- Running the Examples
- Advanced Configuration
- Troubleshooting
- Contributing
- License
- 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 │ └── open-aa-example-apps │ ├── CMakeLists.txt │ └── demo │ ├── CMakeLists.txt │ └── app │ ├── CMakeLists.txt │ ├── include │ │ └── demo │ │ └── manager │ │ └── demo_manager.h │ └── src │ ├── demo │ │ └── manager │ │ └── demo_manager.cpp │ └── main.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 architectures. It includes:
- Interface Layer: Abstract interfaces for process interactions
(e.g.,
process_factory.h
,process_interaction.h
). - Linux Implementation: Concrete implementations for Linux platforms
(
process.cpp
underlinux/process
). - QNX Implementation: Concrete implementations for QNX platforms
(
process.cpp
underqnx/process
).
Encompasses standard Adaptive AUTOSAR libraries, including core utilities and internal mechanisms essential for the project's functionality.
- Core Utilities: Implements functionalities such as the
ara::core::Array
class (array.h
). - Internal Utilities: Includes helpers for location handling and
violation management (
location_utils.h
,violation_handler.h
).
Showcases example applications demonstrating how to use the Adaptive AUTOSAR libraries. Includes:
demo/app
: A sample application illustrating how to integrate and interact with the libraries via ademo_manager
.
The tests/core_platform
directory contains test applications to validate
the core platform components. These tests ensure reliability and correctness.
ara_core_array.cpp
: Test cases for theara::core::Array
class.
Before building, ensure 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 instructions.
The project is built via the build.sh
script, which supports multiple
configurations, toolchains, architectures, and exception safety modes.
./build.sh [OPTIONS]
-h
/--help
: Show help message and exit.-c
/--clean
: Remove existing build and install directories for a clean build.-t
/--build-type
: Build type (Debug
orRelease
). Default:Release
.-b
/--build-target
: Build target:gcc11_linux_x86_64
gcc11_linux_aarch64
qcc12_qnx800_aarch64
qcc12_qnx800_x86_64
-s
/--sdp-path
: Path toqnxsdp-env.sh
for QNX builds.-j
/--jobs
: Number of parallel jobs (defaults to number of CPU cores).-e
/--exception-safety
: New: Choose exception safety mode:conditional
(default): DefinesARA_CORE_ARRAY_ENABLE_CONDITIONAL_EXCEPTIONS
safe
: Does not define that macro (i.e., “safe” mode)
1. Clean and Build for GCC 11 Linux x86_64 (Release)
./build.sh --clean -b gcc11_linux_x86_64 -t Release -j 8
2. Build for QNX aarch64 (Debug) with safe exception mode
./build.sh -b qcc12_qnx800_aarch64 -t Debug -s /path/to/qnxsdp-env.sh -e safe -j 4
3. Build for GCC 11 Linux aarch64 (Release) with conditional exceptions
./build.sh --clean -b gcc11_linux_aarch64 -t Release -e conditional
4. Clean and Build for QNX x86_64 (Release)
./build.sh --clean -b qcc12_qnx800_x86_64 -t Release -s /path/to/qnxsdp-env.sh -j 4
Build Target | Compiler | Platform | Architecture | Build Types |
---|---|---|---|---|
gcc11_linux_x86_64 |
GCC 11 | Linux | x86_64 | Debug/Release |
gcc11_linux_aarch64 |
GCC 11 | Linux | aarch64le | Debug/Release |
qcc12_qnx800_aarch64 |
QCC 12 | QNX | aarch64le | Debug/Release |
qcc12_qnx800_x86_64 |
QCC 12 | QNX | x86_64 | Debug/Release |
Note: “Debug” or “Release” is appended internally, based on --build-type
.
After building, you can run the test executables as follows:
cd install/<build-target>/
./platform_core_test/bin/ara_core_array_test [OPTION]
The open-aa-example-apps component contains demo applications to illustrate how to use the Adaptive AUTOSAR libraries:
- Build the project:
./build.sh --clean -b gcc11_linux_x86_64 -t Release
- Navigate to the installed directory for your target:
cd install/<build-target>/adaptive_platform/opt/demo_app/bin
- Run the example binary (e.g.,
demo_app
, etc.):./demo_app
Inspect the source in components/open-aa-example-apps/demo/app/src
to
understand how the example is structured.
- Create a New CMake Configuration File:
- In
CMake/CMakeConfig/
, add a.cmake
file (e.g., copy an existing one).
- In
- Define the Build Target in
build.sh
:- Extend the script’s logic to map your new target to its config file.
- Update
CMakePresets.json
:- Add a new preset referencing the new target.
- Add a New Component Directory:
- Under
components/
, create a folder for your new component.
- Under
- Define
CMakeLists.txt
:- Set up includes, sources, and dependencies.
- Reference in Root
CMakeLists.txt
:- Use
add_subdirectory(components/your-new-component)
to integrate it.
- Use
If you encounter issues not covered in this section, feel free to open an issue on the GitHub repository.
-
CMake Not Found
- Error:
cmake: command not found
- Solution: Install CMake and ensure it’s in 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: Source
qnxsdp-env.sh
or specify via-s /path/to/qnxsdp-env.sh
.
- Error:
-
Toolchain File Not Found
- Error:
Error: Toolchain file not found: ...
- Solution: Verify the file exists in
CMake/CMakeConfig/
and that your build target is correct.
- Error:
-
Compilation Errors
- Cause: Mismatched compiler versions or missing dependencies.
- Solution: Ensure correct compiler usage and install any missing deps.
Contributions are welcome! Please:
- Fork the Repository: Create your personal fork.
- Create a Feature Branch:
git checkout -b feature/my-new-feature
- Commit Your Changes:
git commit -m "Add new feature XYZ"
- Push to Your Fork:
git push origin feature/my-new-feature
- Open a Pull Request: Target the
master_integration
branch of this repo.
This project is licensed under the MIT License. See the LICENSE file for more details.
Thank you for using and contributing to OpenAA: Adaptive AUTOSAR C++17 Project! For more information, visit the GitHub repository.