{"id":23911897,"url":"https://github.com/sherif-mooo/adaptiveautosar-cpp17","last_synced_at":"2025-04-11T13:44:35.431Z","repository":{"id":269348679,"uuid":"906795498","full_name":"Sherif-MoOo/AdaptiveAUTOSAR-Cpp17","owner":"Sherif-MoOo","description":"Adaptive Autosar Platform based on Cpp-17","archived":false,"fork":false,"pushed_at":"2025-04-04T22:26:13.000Z","size":219,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"master_integration","last_synced_at":"2025-04-04T23:24:24.971Z","etag":null,"topics":["adaptive-autosar","bash-scripting","cmake","cpp17","embedded-systems","gcc11","linux","modern-cpp","os","platform-engineering","qnx","qnx8","scalability"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sherif-MoOo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-21T23:31:57.000Z","updated_at":"2025-04-04T22:26:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"265034c0-e93c-4e40-af1b-cba87ea7043c","html_url":"https://github.com/Sherif-MoOo/AdaptiveAUTOSAR-Cpp17","commit_stats":null,"previous_names":["sherif-mooo/adaptiveautosar-cpp17"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sherif-MoOo%2FAdaptiveAUTOSAR-Cpp17","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sherif-MoOo%2FAdaptiveAUTOSAR-Cpp17/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sherif-MoOo%2FAdaptiveAUTOSAR-Cpp17/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sherif-MoOo%2FAdaptiveAUTOSAR-Cpp17/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sherif-MoOo","download_url":"https://codeload.github.com/Sherif-MoOo/AdaptiveAUTOSAR-Cpp17/tar.gz/refs/heads/master_integration","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248410914,"owners_count":21098797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adaptive-autosar","bash-scripting","cmake","cpp17","embedded-systems","gcc11","linux","modern-cpp","os","platform-engineering","qnx","qnx8","scalability"],"created_at":"2025-01-05T08:32:16.026Z","updated_at":"2025-04-11T13:44:35.414Z","avatar_url":"https://github.com/Sherif-MoOo.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenAA: Adaptive AUTOSAR CXX_STANDARD 17 Project\n\nThis is a **modular** and **scalable** open‑source Adaptive AUTOSAR demo using **CXX_STANDARD 17**.\nThe project leverages **CMake** for build configuration, enabling straightforward integration, testing, and future expansion.\n \n ---\n \n ## Table of Contents\n 1. [Key Features](#key-features)\n 2. [Repository Structure](#repository-structure)\n 3. [Components Overview](#components-overview)\n    - [open-aa-platform-os-abstraction-libs](#1-open-aa-platform-os-abstraction-libs)\n    - [open-aa-std-adaptive-autosar-libs](#2-open-aa-std-adaptive-autosar-libs)\n    - [open-aa-example-apps](#3-open-aa-example-apps)\n 4. [Tests Overview](#tests-overview)\n 5. [Prerequisites and Environment Setup](#prerequisites-and-environment-setup)\n    - [Ubuntu (GCC 11 \u0026 GCC 13)](#ubuntu-gcc-11--gcc-13)\n    - [Cross Compilation for AArch64 (GCC 11/13)](#cross-compilation-for-aarch64)\n    - [QNX Environment](#qnx-environment)\n 6. [Building the Project](#building-the-project)\n    - [Usage](#usage)\n    - [Options](#options)\n    - [Example Commands](#example-commands)\n 7. [Build Targets](#build-targets)\n 8. [Testing the Project](#testing-the-project)\n 9. [Running the Examples](#running-the-examples)\n 10. [Advanced Configuration](#advanced-configuration)\n     - [Adding a New Build Target](#adding-a-new-build-target)\n     - [Integrating Additional Components](#integrating-additional-components)\n 11. [Troubleshooting](#troubleshooting)\n 12. [Contributing](#contributing)\n 13. [License](#license)\n \n---\n\n## Key Features\n\n- **Modular Architecture**: Easily add or remove components as needed.\n- **Scalable Design**: Suitable for both small-scale applications and large automotive systems.\n- **Comprehensive Testing**: Extensive tests ensure reliability and correctness.\n- **Cross‑Platform Support**: Build and run on Linux (Ubuntu 22.04, Ubuntu 24.04) and QNX with various architectures.\n- **Modern CXX_STANDARD 17 Implementation**: Leverages inline variables, constexpr where possible, robust error handling, and other modern features.\n- **Multiple Compiler Support**: Use GCC 11, GCC 13 (including cross-compilation for AArch64), and QNX QCC.\n\n---\n\n## Repository Structure\n\nThe repository is organized as follows:\n\n```\n.\n├── CMake                                       // CMake configuration and toolchain files\n├── components                                  // Source code for components:\n│   ├── open-aa-std-adaptive-autosar-libs       // Core Adaptive AUTOSAR libraries (e.g., array, abort)\n│   ├── open-aa-platform-os-abstraction-libs    // OS abstraction layers for Linux and QNX\n│   └── open-aa-example-apps                    // Example applications demonstrating library usage\n├── open-aa-tests                               // Test applications for core platform components\n├── build.sh                                    // Build script\n├── CMakeLists.txt                              // Top-level CMake configuration\n├── LICENSE\n└── README.md\n```\n\n---\n\n## Components Overview\n\n### 1. open-aa-platform-os-abstraction-libs\nProvides OS abstraction layers to facilitate cross‑platform development.\n\n- **Interface Layer**: Abstract interfaces for process management (e.g., `process_factory.h`, `process_interaction.h`).\n- **Linux Implementation**: Concrete implementations for Linux (`process.cpp` under the Linux folder).\n- **QNX Implementation**: Concrete implementations for QNX (`process.cpp` under the QNX folder).\n\n### 2. open-aa-std-adaptive-autosar-libs\nContains core utilities and internal mechanisms essential for Adaptive AUTOSAR:\n\n- **ara::core::Array**: A fixed‑size array container with enhanced functionality.\n- **ara::core::Abort**: API for explicitly aborting operations when violations occur.\n- **Internal Utilities**: Helpers for location handling and violation management (e.g., `location_utils.h`, `violation_handler.h`).\n\n### 3. open-aa-example-apps\nDemonstrates how to use the Adaptive AUTOSAR libraries via sample applications.\n\n- **demo/app**: A sample application illustrating integration through a `demo_manager`.\n\n---\n\n## Tests Overview\n\nThe `open-aa-tests` directory contains test applications for the core platform:\n- **core_platform tests**: Validate components such as `ara::core::Array` and `ara::core::Abort`.\n- Tests include both positive scenarios and negative (compile‑time or runtime) tests (the latter are commented out).\n\n---\n\n## Prerequisites and Environment Setup\n\n### Ubuntu (GCC 11 || GCC 13)\n\n**Operating System**: Ubuntu 22.04 or Ubuntu 24.04\n\n**Required Packages:**\n\n```bash\n$ sudo apt-get update\n$ sudo apt-get install -y software-properties-common lsb-release\n$ sudo apt-get remove --purge cmake\n$ sudo apt-get install -y apt-transport-https ca-certificates gnupg wget\n$ wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc | sudo apt-key add -\n$ sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main'\n$ sudo apt-get update\n$ sudo apt-get install -y cmake build-essential\n\n# For GCC 11 and GCC 13 (Ubuntu 24.04 supports both)\n$ sudo apt-get install -y gcc-11 g++-11 gcc-13 g++-13\n```\n\n### Cross Compilation for AArch64\n\n**Operating System**: Ubuntu (22.04 or 24.04)\n\n**Required Packages:**\n\n```bash\n$ sudo apt-get update\n$ sudo apt-get install -y gcc-11-aarch64-linux-gnu g++-11-aarch64-linux-gnu gcc-13-aarch64-linux-gnu g++-13-aarch64-linux-gnu\n```\n\n**Note:** Ensure that the toolchain file (e.g., `CMake/Toolchain/*.cmake`) exists for your desired env\n### QNX Environment\n\n**Operating System:** QNX or Linux for QNX cross-compilation\n\n**Requirements:**\n\n- QNX Software Development Platform (SDP) version 7.1 or later (refer to [QNX documentation](http://www.qnx.com/download/) for installation instructions).\n- QNX QCC (typically version 12) must be installed and properly configured.\n\n**Setup:**\n\n1. Install QNX SDP as per QNX documentation.\n2. Source the QNX environment script before building or use the build script in the repo with --sdp-path /path/to/qnxsdp-env.sh\n\n```bash\n$ source /path/to/qnxsdp-env.sh\n```\n\n3. In the build command, specify the QNX toolchain target (e.g., `qcc12_qnx800_aarch64` or `qcc12_qnx800_x86_64`).\n\n---\n\n## Building the Project\n\nThe project is built using CMake and the provided `build.sh` script.\n\n### Usage\n\n```bash\n$ ./build.sh [OPTIONS]\n```\n\n### Options\n- **`-h, --help`**: Show help message and exit.\n- **`-c, --clean`**: Remove existing build and install directories.\n- **`-t, --build-type`**: Build type (`Debug` or `Release`). Default: `Release`.\n- **`-b, --build-target`**: Build target (e.g., `gcc11_linux_x86_64`, `gcc11_linux_aarch64`, `gcc13_linux_x86_64`, `gcc13_linux_aarch64`, `qcc12_qnx800_aarch64`, `qcc12_qnx800_x86_64`).\n- **`-s, --sdp-path`**: Path to `qnxsdp-env.sh` for QNX builds.\n- **`-j, --jobs`**: Number of parallel jobs.\n- **`-e, --exception-safety`**: Choose exception safety mode:\n    - `conditional` (default): Defines `ARA_CORE_ARRAY_ENABLE_CONDITIONAL_EXCEPTIONS`\n    - `safe`: Does not define the macro (safe mode)\n\n### Example Commands\n\n**1. Clean and Build for GCC 11 Linux x86_64 (Release):**\n```bash\n$ ./build.sh --clean -b gcc11_linux_x86_64 -t Release -j 8\n```\n\n**2. Build for QNX aarch64 (Debug) with safe exception mode:**\n```bash\n$ ./build.sh -b qcc12_qnx800_aarch64 -t Debug -s /path/to/qnxsdp-env.sh -e safe -j 4\n```\n\n**3. Build for GCC 11 Linux aarch64 (Release) with conditional exceptions:**\n```bash\n$ ./build.sh --clean -b gcc11_linux_aarch64 -t Release -e conditional\n```\n\n**4. Build for GCC 13 Linux x86_64 (Release) on Ubuntu 24.04:**\n```bash\n$ ./build.sh --clean -b gcc13_linux_x86_64 -t Release -j 8\n```\n\n**5. Build for GCC 13 Linux aarch64 (Release) on Ubuntu 24.04:**\n```bash\n$ ./build.sh --clean -b gcc13_linux_aarch64 -t Release -j 1\n```\n\n---\n\n## Build Targets\n\n| Build Target              | Compiler | Platform | Architecture | Build Types    |\n|---------------------------|----------|----------|--------------|----------------|\n| `gcc11_linux_x86_64`      | GCC 11   | Linux    | x86_64       | Debug/Release  |\n| `gcc11_linux_aarch64`     | GCC 11   | Linux    | aarch64le    | Debug/Release  |\n| `gcc13_linux_x86_64`      | GCC 13   | Linux    | x86_64       | Debug/Release  |\n| `gcc13_linux_aarch64`     | GCC 13   | Linux    | aarch64le    | Debug/Release  |\n| `qcc12_qnx800_aarch64`    | QCC 12   | QNX      | aarch64le    | Debug/Release  |\n| `qcc12_qnx800_x86_64`     | QCC 12   | QNX      | x86_64       | Debug/Release  |\n\n*Note: “Debug” or “Release” is appended internally based on the build type.*\n\n---\n\n## Testing the Project\n\nAfter building, test executables are located in:\n```bash\n$ cd install/\u003cbuild-target\u003e/\n$ ./platform_core_test/core_array_test/bin/core_array_test [OPTION]\n$ ./platform_core_test/core_abort_test/bin/core_abort_test [OPTION]\n```\nThe repository includes comprehensive tests for core platform components. In particular, the \n`ara::core::Array` test suite (located in `tests/core_platform/ara_core_array_test`) covers a wide range \nof scenarios to ensure reliability and correctness. The test executable accepts a test number as a \ncommand-line argument to run specific tests.\n\n---\n\n## Running the Examples\n\nThe **open-aa-example-apps** component contains demo applications to illustrate library usage.\n\n1. **Build** the project:\n   ```bash\n   $ ./build.sh --clean -b gcc11_linux_x86_64 -t Release\n   ```\n2. **Navigate** to the installed directory for your target:\n   ```bash\n   $ cd install/\u003cbuild-target\u003e/adaptive_platform/opt/demo_app/bin\n   ```\n3. **Run** the demo application:\n   ```bash\n   $ ./demo_app\n   ```\n\n---\n\n## Advanced Configuration\n\n### Adding a New Build Target\n1. Create a new CMake configuration file in `CMake/CMakeConfig/` (for example, by copying an existing one).\n2. Define the new target in the build script (`build.sh`) and the ToolChain Folder.\n3. Update `CMakePresets.json` with a new preset for the target.\n\n### Integrating Additional Components\n1. Add a new component directory under `components/`.\n2. Create a CMakeLists.txt file for the component with the required includes, sources, and dependencies.\n3. Integrate the component in the root CMakeLists.txt using `add_subdirectory()`.\n\n---\n\n## Troubleshooting\n\n1. **CMake Not Found**  \n   - **Error**: `cmake: command not found`\n   - **Solution**: Install CMake and ensure it’s in your PATH:\n     ```bash\n     $ cmake --version\n     ```\n\n2. **Compiler Not Found (GCC / Cross-Compiler)**  \n   - **Error**: `... is not a full path and was not found in the PATH.`\n   - **Solution**: Verify the compiler installation and update the PATH or specify full paths in the toolchain file.\n\n3. **QNX Environment Variables Not Set**  \n   - **Error**: `Error: QNX_HOST and QNX_TARGET environment variables must be set.`\n   - **Solution**: Source `qnxsdp-env.sh` or specify the path via the `-s` option.\n\n4. **Toolchain File Not Found**  \n   - **Error**: `Error: Toolchain file not found: ...`\n   - **Solution**: Verify the file exists in `CMake/CMakeConfig/` and that your build target is correct.\n\n5. **Compilation Errors**  \n   - **Cause**: Mismatched compiler versions or missing dependencies.\n   - **Solution**: Use the correct compiler and install any missing dependencies.\n\n---\n\n## Contributing\n\nContributions are welcome! Follow these steps:\n1. **Fork the Repository**.\n2. **Create a Feature Branch**:\n   ```bash\n   $ git checkout -b feature/my-new-feature\n   ```\n3. **Commit Your Changes** with clear messages.\n4. **Push to Your Fork**:\n   ```bash\n   $ git push origin feature/my-new-feature\n   ```\n5. **Open a Pull Request** targeting the `master_integration` branch.\n\n---\n\n## License\n\nThis project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.\n\n---\n\nThank you for using and contributing to OpenAA: Adaptive AUTOSAR CXX_STANDARD 17 Project!\nFor more information, visit the [GitHub repository](https://github.com/Sherif-MoOo/AdaptiveAutosAR-Cpp17).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsherif-mooo%2Fadaptiveautosar-cpp17","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsherif-mooo%2Fadaptiveautosar-cpp17","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsherif-mooo%2Fadaptiveautosar-cpp17/lists"}