-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a74b82
commit c811e93
Showing
14 changed files
with
255 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "AllocX Dev Environment", | ||
"build": { | ||
"dockerfile": "../Dockerfile", | ||
"context": ".." | ||
}, | ||
"features": {}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-vscode.cpptools", | ||
"ms-vscode.cmake-tools", | ||
"GitHub.vscode-github-actions", | ||
"ms-python.python" | ||
], | ||
"settings": { | ||
"terminal.integrated.defaultProfile.linux": "bash", | ||
"editor.formatOnSave": true, | ||
"editor.tabSize": 4 | ||
} | ||
} | ||
}, | ||
"postCreateCommand": "cmake -S . -B build && cmake --build build", | ||
"remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: AllocX CI Pipeline | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y \ | ||
build-essential \ | ||
gcc-11 \ | ||
g++-11 \ | ||
cmake \ | ||
python3-pip \ | ||
clang-format | ||
- name: Configure and Build | ||
run: | | ||
cmake -S . -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release | ||
cmake --build build | ||
- name: Run Tests | ||
run: | | ||
pytest tests --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Minimum CMake version required | ||
cmake_minimum_required(VERSION 3.15) | ||
|
||
# Project name and description | ||
project(AllocX | ||
VERSION 1.0 | ||
DESCRIPTION "A high-performance, cross-platform memory management library designed for low-latency, high-frequency systems." | ||
LANGUAGES C CXX | ||
) | ||
|
||
# Set the C++ standard | ||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
# Enable testing | ||
enable_testing() | ||
|
||
# Options | ||
option(ALLOCX_BUILD_TESTS "Build unit tests" ON) | ||
option(ALLOCX_BUILD_EXAMPLES "Build examples" ON) | ||
|
||
# Define output directories | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | ||
|
||
# Include source directories | ||
add_subdirectory(src) | ||
add_subdirectory(include) | ||
|
||
# Add tests if enabled | ||
if(ALLOCX_BUILD_TESTS) | ||
add_subdirectory(tests) | ||
endif() | ||
|
||
# Add examples if enabled | ||
if(ALLOCX_BUILD_EXAMPLES) | ||
add_subdirectory(examples) | ||
endif() | ||
|
||
# Documentation target | ||
find_package(Doxygen) | ||
if(Doxygen_FOUND) | ||
add_subdirectory(docs) | ||
else() | ||
message(STATUS "Doxygen not found. Documentation will not be generated.") | ||
endif() | ||
|
||
# Installation rules | ||
include(GNUInstallDirs) | ||
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) | ||
install(TARGETS AllocX | ||
EXPORT AllocXTargets | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
) | ||
|
||
# Export targets for downstream projects | ||
install(EXPORT AllocXTargets | ||
FILE AllocXConfig.cmake | ||
NAMESPACE AllocX:: | ||
DESTINATION ${CMAKE_INSTALL_DATADIR}/AllocX | ||
) | ||
|
||
# Display configuration summary | ||
message(STATUS "Project: ${PROJECT_NAME}") | ||
message(STATUS "Version: ${PROJECT_VERSION}") | ||
message(STATUS "Description: ${PROJECT_DESCRIPTION}") | ||
message(STATUS "C++ Standard: ${CMAKE_CXX_STANDARD}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Use a stable base image | ||
FROM ubuntu:22.04 | ||
|
||
# Set environment variables to minimise interaction during installation | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV LANG=C.UTF-8 | ||
ENV LC_ALL=C.UTF-8 | ||
ENV CC=/usr/bin/gcc | ||
ENV CXX=/usr/bin/g++ | ||
ENV VIRTUAL_ENV=/venv | ||
ENV PATH="$VIRTUAL_ENV/bin:$PATH" | ||
|
||
# Install core development tools and dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
gcc-11 \ | ||
g++-11 \ | ||
cmake \ | ||
python3 \ | ||
python3-pip \ | ||
python3-venv \ | ||
clang-format \ | ||
git \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Set GCC/G++ version explicitly | ||
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 \ | ||
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100 | ||
|
||
# Create a workspace directory | ||
WORKDIR /workspace | ||
|
||
# Copy the entire project into the container | ||
COPY . . | ||
|
||
# Create and activate Python virtual environment | ||
RUN python3 -m venv /venv | ||
RUN pip install --no-cache-dir pytest | ||
|
||
# Ensure required scripts are executable (if applicable) | ||
RUN chmod +x scripts/* || true | ||
|
||
# Build the project using CMake | ||
RUN cmake -S . -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release | ||
RUN cmake --build build | ||
|
||
# Default command for development | ||
CMD ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: "3.9" | ||
|
||
services: | ||
allocx-dev: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
volumes: | ||
- .:/workspace:cached | ||
ports: | ||
- 8080:8080 # Example port mapping | ||
environment: | ||
- DEBIAN_FRONTEND=noninteractive | ||
- LANG=C.UTF-8 | ||
- LC_ALL=C.UTF-8 | ||
command: /bin/bash |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.