From 5afa65f05ea7e6e5686d02e7f9d5377cee26fb37 Mon Sep 17 00:00:00 2001 From: Dogan Ulus Date: Mon, 27 Oct 2025 18:02:11 +0000 Subject: [PATCH 01/11] Update 2025-10 --- .devcontainer/Dockerfile | 13 ------- .devcontainer/devcontainer.json | 35 ++++++++---------- .gitignore | 3 ++ CMakeLists.txt | 58 +++++++++++++++++++++++------- Makefile | 4 ++- docker/devel/Dockerfile | 63 --------------------------------- docker/ryjson/Dockerfile | 40 --------------------- docker/ryjson/entrypoint.sh | 10 ------ include/reelay/version.hpp | 4 +-- pyproject.toml | 4 +-- python/reelay/__init__.py | 2 +- tests/CMakeLists.txt | 2 +- 12 files changed, 72 insertions(+), 166 deletions(-) delete mode 100644 .devcontainer/Dockerfile delete mode 100644 docker/devel/Dockerfile delete mode 100644 docker/ryjson/Dockerfile delete mode 100644 docker/ryjson/entrypoint.sh diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index bb7471f..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM ghcr.io/doganulus/reelay-devel:latest - -# Add a container user (good practice) -RUN groupadd reelay -g 1000 \ - && useradd -ms /bin/bash reelay -g 1000 -u 1000 \ - && printf "reelay:reelay" | chpasswd \ - && printf "reelay ALL= NOPASSWD: ALL\\n" >> /etc/sudoers - -USER reelay - -ENV PATH "/home/reelay/.local/bin:${PATH}" - -RUN python -m pip install black gcovr cmake-format diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7f8ef0d..02c0889 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,23 +1,22 @@ { "name": "Reelay", - "dockerFile": "Dockerfile", - "context": "..", - "remoteUser": "reelay", + "build": { + "dockerfile": "../containers/devel/Dockerfile", + "context": "../containers" + }, "postCreateCommand": "make configure", "customizations": { "vscode": { "extensions": [ - "EditorConfig.EditorConfig", - "llvm-vs-code-extensions.vscode-clangd", - "cheshirekow.cmake-format", - "esbenp.prettier-vscode", - "ms-azuretools.vscode-docker", - "github.vscode-github-actions", - "GitHub.copilot", - "ms-vscode.cmake-tools", - "ms-python.python", - "tamasfe.even-better-toml" - ], + "EditorConfig.EditorConfig", + "llvm-vs-code-extensions.vscode-clangd", + "cheshirekow.cmake-format", + "esbenp.prettier-vscode", + "github.vscode-github-actions", + "GitHub.copilot", + "ms-vscode.cmake-tools", + "ms-python.python" + ], "settings": { "clangd.arguments": [ "--background-index", @@ -28,13 +27,9 @@ "--all-scopes-completion", "--compile-commands-dir=/tmp/reelay/build" ], - "gcovViewer.buildDirectories": ["/tmp/reelay/build"], - "gcovViewer.highlightMissedLines": true, "editor.formatOnSave": true, - "editor.formatOnPaste": true, - "docker.languageserver.formatter.ignoreMultilineInstructions": true - }, - "recommendations": ["github.vscode-github-actions", "github.copilot"] + "editor.formatOnPaste": true + } } } } diff --git a/.gitignore b/.gitignore index 6d6f347..dc0f405 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# virtualenv +.venv/ + # compile_commands.json **/compile_commands.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 77f7d73..138905e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,7 @@ else() endif() option(BUILD_TESTS "Build the C++ unit tests" ON) -option(BUILD_REELAY_APPS "Build Reelay Apps" ON) +option(BUILD_REELAY_APPS "Build Reelay Apps" OFF) option(BUILD_PYTHON_BINDINGS "Build Python bindings" OFF) include(GNUInstallDirs) @@ -46,16 +46,37 @@ include(GNUInstallDirs) add_library(reelay INTERFACE) add_library(reelay::reelay ALIAS reelay) -find_package(Boost 1.82.0 REQUIRED) - -find_library(cudd_static NAMES libcudd.a REQUIRED NO_CACHE) +find_package(Threads REQUIRED) +find_package(Boost 1.82.0 REQUIRED CONFIG) + +include(FetchContent) +FetchContent_Declare( + cudd + GIT_REPOSITORY https://github.com/cuddorg/cudd.git + GIT_TAG 4.0.0 + SYSTEM + EXCLUDE_FROM_ALL +) +FetchContent_MakeAvailable(cudd) + +# Define a target for CUDD manually (if it doesn't export one) +if(NOT TARGET cudd) + add_library(cudd STATIC IMPORTED GLOBAL) + # Assume it’s built under cudd_SOURCE_DIR + set_target_properties(cudd PROPERTIES + IMPORTED_LOCATION ${cudd_BINARY_DIR}/libcudd.a + INTERFACE_INCLUDE_DIRECTORIES + "${cudd_SOURCE_DIR}/cudd;${cudd_SOURCE_DIR}/cplusplus" + ) +endif() # reelay-core target_include_directories( reelay INTERFACE $ + $ $) -target_link_libraries(reelay INTERFACE ${cudd_static}) +target_link_libraries(reelay INTERFACE Threads::Threads cudd::cudd) install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") install( @@ -65,14 +86,16 @@ install( LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") -export( - TARGETS reelay - NAMESPACE reelay:: - FILE "${CMAKE_CURRENT_BINARY_DIR}/reelay-config.cmake") -install( - EXPORT reelay-config - DESTINATION "${CMAKE_INSTALL_DATADIR}/reelay/cmake" - NAMESPACE reelay::) +# export( +# TARGETS reelay +# NAMESPACE reelay:: +# FILE "${CMAKE_CURRENT_BINARY_DIR}/reelay-config.cmake") + +# install( +# EXPORT reelay-config +# DESTINATION "${CMAKE_INSTALL_DATADIR}/reelay/cmake" +# NAMESPACE reelay:: +#) add_subdirectory(src) @@ -85,3 +108,12 @@ if(BUILD_REELAY_APPS) message(STATUS "Building Reelay apps...") add_subdirectory(apps) endif() + +if(PROJECT_IS_TOP_LEVEL AND UNIX) + # Create symlink to compile_commands.json on the project directory + execute_process( + COMMAND + ${CMAKE_COMMAND} -E create_symlink + ${CMAKE_BINARY_DIR}/compile_commands.json + ${CMAKE_SOURCE_DIR}/compile_commands.json) +endif() diff --git a/Makefile b/Makefile index 4bc1a7f..8a388e6 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ WORKSPACE := ${PWD} -BUILD_DIRECTORY := /tmp/$(basename $(notdir ${WORKSPACE}))/build +BUILD_DIRECTORY := /tmp/build/$(basename $(notdir ${WORKSPACE})) .PHONY: all configure build test cbuild cryjson @@ -24,3 +24,5 @@ cryjson: cbenchmark: docker build -t ghcr.io/doganulus/reelay-benchmark:latest docker/benchmark +clean: + rm -rf $(BUILD_DIRECTORY) diff --git a/docker/devel/Dockerfile b/docker/devel/Dockerfile deleted file mode 100644 index 23aee47..0000000 --- a/docker/devel/Dockerfile +++ /dev/null @@ -1,63 +0,0 @@ -FROM debian:12 - -ENV PIP_BREAK_SYSTEM_PACKAGES 1 -ENV CMAKE_GENERATOR=Ninja - -RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install \ - sudo \ - git \ - build-essential \ - tar curl wget zip unzip gnupg2 \ - cmake \ - ninja-build \ - python3-pip \ - python3-venv \ - python-is-python3 \ - && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* - -RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install \ - clang \ - clangd \ - clang-format \ - clang-tidy \ - clang-tools \ - && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* - -RUN git clone -j$(nproc) --recursive --depth 1 --branch boost-1.82.0 https://github.com/boostorg/boost.git /tmp/boost \ - && cd /tmp/boost \ - && ./bootstrap.sh --prefix=/usr/local --without-libraries=python \ - && ./b2 -j$(nproc) install \ - && cd / && rm -rf /tmp/boost - -RUN git clone --depth 1 --branch v3.4.0 https://github.com/catchorg/Catch2.git /tmp/catch2 \ - && cmake -S/tmp/catch2 -B/tmp/catch2/build \ - -DBUILD_TESTING=OFF \ - -DCATCH_INSTALL_DOCS=OFF \ - && cmake --build /tmp/catch2/build/ --target install -j$(nproc) \ - && rm -rf /tmp/catch2 - -RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install \ - automake \ - autotools-dev \ - && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* - -RUN git clone https://github.com/doganulus/cudd.git /tmp/cudd \ - && cd /tmp/cudd \ - && ./configure && aclocal && autoconf \ - && ./configure --enable-silent-rules --enable-shared --enable-obj \ - && make && make install \ - && cd / && rm -rf /tmp/cudd - -RUN git clone --depth 1 --branch v3.2.2 https://github.com/lemire/simdjson.git /tmp/simdjson \ - && cmake -S/tmp/simdjson -B/tmp/simdjson/build \ - && cmake --build /tmp/simdjson/build/ --target install -j$(nproc) \ - && rm -rf /tmp/simdjson - -RUN python -m pip install --upgrade pip \ - && pip install \ - gcovr \ - py-build-cmake \ - "pybind11[global]" diff --git a/docker/ryjson/Dockerfile b/docker/ryjson/Dockerfile deleted file mode 100644 index 705d4bb..0000000 --- a/docker/ryjson/Dockerfile +++ /dev/null @@ -1,40 +0,0 @@ -# -# docker build -t ghcr.io/doganulus/reelay:ryjson docker/ryjson -# -FROM ghcr.io/doganulus/reelay-devel:latest as builder - -RUN git clone https://github.com/doganulus/reelay.git /tmp/reelay \ - --depth 1 \ - --branch main \ - && cmake -S/tmp/reelay -B/tmp/reelay/build \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_REELAY_APPS=ON \ - -DBUILD_TESTS=OFF \ - && cmake --build /tmp/reelay/build/ --target install -j$(nproc) \ - && rm -rf /tmp/reelay - -# -# docker run --rm -v $(pwd):/app ghcr.io/doganulus/reelay:ryjson -# -FROM debian:12 - -RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install \ - tini \ - && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* - -# Copy the script to the container -COPY ./entrypoint.sh / -RUN chmod +x /entrypoint.sh - -# Tini correctly initialize the shell in the container -# With the -g option, tini kills the child process group. -# This corresponds more closely to what happens when you do ctrl-C -# See: https://github.com/krallin/tini - -COPY --from=builder /usr/local/bin/ryjson /usr/local/bin/ - -WORKDIR /app - -ENTRYPOINT ["tini", "-g", "--", "/entrypoint.sh"] -CMD ["--help"] diff --git a/docker/ryjson/entrypoint.sh b/docker/ryjson/entrypoint.sh deleted file mode 100644 index 3f4a289..0000000 --- a/docker/ryjson/entrypoint.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# Trigger an error if non-zero exit code is encountered -set -e - -# Make the command executable -# chmod +x ${1} - -# Execute the command -exec ryjson "${@}" diff --git a/include/reelay/version.hpp b/include/reelay/version.hpp index 6e0eebe..b2ae470 100644 --- a/include/reelay/version.hpp +++ b/include/reelay/version.hpp @@ -9,7 +9,7 @@ #ifndef REELAY_VERSION_HPP #define REELAY_VERSION_HPP -#define REELAY_VERSION_MAJOR 23 -#define REELAY_VERSION_MINOR 8 +#define REELAY_VERSION_MAJOR 25 +#define REELAY_VERSION_MINOR 10 #endif diff --git a/pyproject.toml b/pyproject.toml index 617d570..584c30c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,8 +59,8 @@ env = {} "BUILD_PYTHON_BINDINGS:BOOL" = "ON" [tool.py-build-cmake.linux.cmake] # Linux-specific options -generator = "Ninja Multi-Config" -config = ["Debug", "Release"] +generator = "Ninja" +config = ["Release"] options = { "CMAKE_DEBUG_POSTFIX" = "_d" } diff --git a/python/reelay/__init__.py b/python/reelay/__init__.py index 064e8e3..cb20dd4 100644 --- a/python/reelay/__init__.py +++ b/python/reelay/__init__.py @@ -9,7 +9,7 @@ """ Python bindings for Reelay C++ library """ -__version__ = '23.8' +__version__ = '25.10' from .dense_timed_monitor import dense_timed_monitor from .discrete_timed_monitor import discrete_timed_monitor diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 87276b7..847a993 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -12,7 +12,7 @@ add_executable( src/discrete_timed_data.test.cpp src/discrete_timed_robustness.test.cpp) -target_link_libraries(reelay_tests PRIVATE reelay::reelay) +target_link_libraries(reelay_tests PRIVATE reelay::reelay cudd) target_link_libraries(reelay_tests PRIVATE Catch2::Catch2WithMain) catch_discover_tests(reelay_tests) From 7d12a01a5075efb28a38391c9af155c9b5cfc6c4 Mon Sep 17 00:00:00 2001 From: Dogan Ulus Date: Mon, 27 Oct 2025 18:23:54 +0000 Subject: [PATCH 02/11] Fix version strings --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 138905e..7d69c2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,10 +2,10 @@ cmake_minimum_required(VERSION 3.22) file(READ "${CMAKE_SOURCE_DIR}/include/reelay/version.hpp" ver) -string(REGEX MATCH "VERSION_MAJOR ([0-9]*)" _ ${ver}) +string(REGEX MATCH "REELAY_VERSION_MAJOR ([0-9]*)" _ ${ver}) set(ver_major ${CMAKE_MATCH_1}) -string(REGEX MATCH "VERSION_MINOR ([0-9]*)" _ ${ver}) +string(REGEX MATCH "REELAY_VERSION_MINOR ([0-9]*)" _ ${ver}) set(ver_minor ${CMAKE_MATCH_1}) project( From 8827025de078f0b7442bef01e2cbf9b25279ad88 Mon Sep 17 00:00:00 2001 From: Dogan Ulus Date: Mon, 27 Oct 2025 18:26:15 +0000 Subject: [PATCH 03/11] Run tests when cmake build script changes --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bef678e..35a8694 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,6 +5,7 @@ on: push: paths: - "include/reelay/**" + - "CMakeLists.txt" - ".github/workflows/tests.yml" # Self-trigger jobs: From 9e8d5f114384920bd45b7e74e5d777b6289c5bd8 Mon Sep 17 00:00:00 2001 From: Dogan Ulus Date: Mon, 27 Oct 2025 18:37:28 +0000 Subject: [PATCH 04/11] Update containers --- containers/devel/Dockerfile | 46 ++++++++++++++++++ containers/ryjson/Dockerfile | 40 ++++++++++++++++ containers/ryjson/entrypoint.sh | 10 ++++ .../scripts/boost-source-cmake-install.sh | 47 +++++++++++++++++++ 4 files changed, 143 insertions(+) create mode 100644 containers/devel/Dockerfile create mode 100644 containers/ryjson/Dockerfile create mode 100644 containers/ryjson/entrypoint.sh create mode 100644 containers/scripts/boost-source-cmake-install.sh diff --git a/containers/devel/Dockerfile b/containers/devel/Dockerfile new file mode 100644 index 0000000..3f0ed88 --- /dev/null +++ b/containers/devel/Dockerfile @@ -0,0 +1,46 @@ +FROM quay.io/pypa/manylinux_2_28:latest +ARG TARGETARCH TARGETOS TARGETPLATFORM TARGETVARIANT + +RUN dnf install -y \ + curl \ + wget \ + unzip \ + git \ + make \ + cmake \ + ninja-build \ + diffutils \ + patch \ + clang \ + clangd \ + clang-analyzer \ + clang-tools-extra \ + && \ + dnf clean all + +RUN --mount=type=bind,source=./scripts/boost-source-cmake-install.sh,target=/container-build/scripts/boost-source-cmake-install.sh \ + . /container-build/scripts/boost-source-cmake-install.sh + +RUN mkdir -p /tmp/boost &&\ + curl -L https://github.com/boostorg/boost/releases/download/boost-1.89.0/boost-1.89.0-cmake.tar.gz | tar -xz --strip-components=1 -C /tmp/boost && \ + cmake -S /tmp/boost -B /tmp/boost/build \ + -DBOOST_ENABLE_MPI=OFF \ + -DBOOST_ENABLE_PYTHON=OFF \ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + && \ + cmake --build /tmp/boost/build --target install -- -j"$(nproc)" && \ + rm -rf /tmp/boost + +RUN git clone --depth 1 --branch v3.11.0 https://github.com/catchorg/Catch2.git /tmp/catch2 && \ + cmake -S/tmp/catch2 -B/tmp/catch2/build \ + -DBUILD_TESTING=OFF \ + -DCATCH_INSTALL_DOCS=OFF \ + && \ + cmake --build /tmp/catch2/build/ --target install -j$(nproc) && \ + rm -rf /tmp/catch2 + +RUN git clone --depth 1 --branch v4.0.7 https://github.com/lemire/simdjson.git /tmp/simdjson && \ + cmake -S/tmp/simdjson -B/tmp/simdjson/build && \ + cmake --build /tmp/simdjson/build/ --target install -j$(nproc) && \ + rm -rf /tmp/simdjson diff --git a/containers/ryjson/Dockerfile b/containers/ryjson/Dockerfile new file mode 100644 index 0000000..705d4bb --- /dev/null +++ b/containers/ryjson/Dockerfile @@ -0,0 +1,40 @@ +# +# docker build -t ghcr.io/doganulus/reelay:ryjson docker/ryjson +# +FROM ghcr.io/doganulus/reelay-devel:latest as builder + +RUN git clone https://github.com/doganulus/reelay.git /tmp/reelay \ + --depth 1 \ + --branch main \ + && cmake -S/tmp/reelay -B/tmp/reelay/build \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_REELAY_APPS=ON \ + -DBUILD_TESTS=OFF \ + && cmake --build /tmp/reelay/build/ --target install -j$(nproc) \ + && rm -rf /tmp/reelay + +# +# docker run --rm -v $(pwd):/app ghcr.io/doganulus/reelay:ryjson +# +FROM debian:12 + +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -y install \ + tini \ + && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* + +# Copy the script to the container +COPY ./entrypoint.sh / +RUN chmod +x /entrypoint.sh + +# Tini correctly initialize the shell in the container +# With the -g option, tini kills the child process group. +# This corresponds more closely to what happens when you do ctrl-C +# See: https://github.com/krallin/tini + +COPY --from=builder /usr/local/bin/ryjson /usr/local/bin/ + +WORKDIR /app + +ENTRYPOINT ["tini", "-g", "--", "/entrypoint.sh"] +CMD ["--help"] diff --git a/containers/ryjson/entrypoint.sh b/containers/ryjson/entrypoint.sh new file mode 100644 index 0000000..3f4a289 --- /dev/null +++ b/containers/ryjson/entrypoint.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Trigger an error if non-zero exit code is encountered +set -e + +# Make the command executable +# chmod +x ${1} + +# Execute the command +exec ryjson "${@}" diff --git a/containers/scripts/boost-source-cmake-install.sh b/containers/scripts/boost-source-cmake-install.sh new file mode 100644 index 0000000..ec7e6c4 --- /dev/null +++ b/containers/scripts/boost-source-cmake-install.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +# +# Example Usage: +# REELAY_INSTALL_PREFIX=/tmp/install REELAY_BOOST_VERSION=1.89.0 boost-source-cmake-install.sh + +set -ex + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)" + +# Ensure prerequisites are installed +if ! command -v cmake >/dev/null 2>&1; then + echo "Error: 'cmake' is required but not installed. Please install cmake and try again." >&2 + exit 1 +fi + +# Set default values for Boost build configuration +REELAY_BOOST_VERSION="${REELAY_BOOST_VERSION:-"1.89.0"}" +REELAY_BOOST_CMAKE_RELEASE_URL="${REELAY_BOOST_CMAKE_RELEASE_URL:-"https://github.com/boostorg/boost/releases/download/boost-${REELAY_BOOST_VERSION}/boost-${REELAY_BOOST_VERSION}-cmake.tar.gz"}" +REELAY_BOOST_SOURCE_DIR="${REELAY_BOOST_SOURCE_DIR:-"/tmp/src/boost"}" +REELAY_BOOST_BUILD_DIR="${REELAY_BOOST_BUILD_DIR:-"/tmp/build/boost"}" +REELAY_BOOST_INSTALL_PREFIX="${REELAY_INSTALL_PREFIX:-"/usr/local"}" +REELAY_BOOST_INSTALL_LIBDIR="${REELAY_INSTALL_LIBDIR:-"lib"}" + +# Get Boost CMake release tarball +mkdir -p "${REELAY_BOOST_SOURCE_DIR}" +curl -L "${REELAY_BOOST_CMAKE_RELEASE_URL}" | tar -xz --strip-components=1 -C "${REELAY_BOOST_SOURCE_DIR}" + +# Build and install Boost +cd "${REELAY_BOOST_SOURCE_DIR}" + +cmake \ + -S "${REELAY_BOOST_SOURCE_DIR}" \ + -B "${REELAY_BOOST_BUILD_DIR}" \ + -DBUILD_SHARED_LIBS=OFF \ + -DBOOST_ENABLE_MPI=OFF \ + -DBOOST_ENABLE_PYTHON=OFF \ + -DCMAKE_INSTALL_PREFIX="${REELAY_BOOST_INSTALL_PREFIX}" \ + -DCMAKE_INSTALL_LIBDIR="${REELAY_BOOST_INSTALL_LIBDIR}" \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + +cmake --build "${REELAY_BOOST_BUILD_DIR}" --target install -- -j"$(nproc)" + +# Clean up temporary directory +echo "Cleaning up..." +rm -rf "${REELAY_BOOST_SOURCE_DIR}" "${REELAY_BOOST_BUILD_DIR}" + +echo "Boost ${REELAY_BOOST_VERSION} installed successfully to ${REELAY_BOOST_INSTALL_PREFIX}." From 58f5565a8e2915003fe3cca54a105e4b43f32534 Mon Sep 17 00:00:00 2001 From: Dogan Ulus Date: Mon, 3 Nov 2025 12:18:27 +0300 Subject: [PATCH 05/11] Update build --- .github/workflows/wheels.yml | 29 +++++++++++++++++++++++++++++ CMakeLists.txt | 22 ++++++++++++++++++++-- cmake/CPM.cmake | 24 ++++++++++++++++++++++++ cmake/reelayConfig.cmake.in | 8 ++++++++ containers/devel/Dockerfile | 27 --------------------------- tests/CMakeLists.txt | 12 ++++++++++-- 6 files changed, 91 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/wheels.yml create mode 100644 cmake/CPM.cmake create mode 100644 cmake/reelayConfig.cmake.in diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml new file mode 100644 index 0000000..fe46840 --- /dev/null +++ b/.github/workflows/wheels.yml @@ -0,0 +1,29 @@ +name: Build + +on: [push, pull_request] + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, ubuntu-24.04-arm] + + steps: + - uses: actions/checkout@v5 + + - name: Build wheels + uses: pypa/cibuildwheel@v3.2.0 + # env: + # CIBW_SOME_OPTION: value + # ... + # with: + # package-dir: . + # output-dir: wheels + # config-file: "{package}/pyproject.toml" + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheels/*.whl diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d69c2c..04e79d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,15 +41,33 @@ option(BUILD_TESTS "Build the C++ unit tests" ON) option(BUILD_REELAY_APPS "Build Reelay Apps" OFF) option(BUILD_PYTHON_BINDINGS "Build Python bindings" OFF) +set(REELAY_BOOST_VERSION "1.89.0" CACHE STRING "Fetch Boost version") + include(GNUInstallDirs) +include(FetchContent) +include(cmake/CPM.cmake) add_library(reelay INTERFACE) add_library(reelay::reelay ALIAS reelay) find_package(Threads REQUIRED) -find_package(Boost 1.82.0 REQUIRED CONFIG) -include(FetchContent) +CPMAddPackage( + NAME Boost + VERSION ${REELAY_BOOST_VERSION} + URL https://github.com/boostorg/boost/releases/download/boost-${REELAY_BOOST_VERSION}/boost-${REELAY_BOOST_VERSION}-cmake.tar.gz + OPTIONS + "BOOST_USE_STATIC_LIBS=ON" +) + +# set(Boost_USE_STATIC_LIBS TRUE) +# FetchContent_Declare( +# Boost +# URL https://github.com/boostorg/boost/releases/download/boost-${REELAY_BOOST_VERSION}/boost-${REELAY_BOOST_VERSION}-cmake.tar.gz +# DOWNLOAD_EXTRACT_TIMESTAMP TRUE +# ) +# FetchContent_MakeAvailable(Boost) + FetchContent_Declare( cudd GIT_REPOSITORY https://github.com/cuddorg/cudd.git diff --git a/cmake/CPM.cmake b/cmake/CPM.cmake new file mode 100644 index 0000000..8474873 --- /dev/null +++ b/cmake/CPM.cmake @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: MIT +# +# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors + +set(CPM_DOWNLOAD_VERSION 0.42.0) +set(CPM_HASH_SUM "2020b4fc42dba44817983e06342e682ecfc3d2f484a581f11cc5731fbe4dce8a") + +if(CPM_SOURCE_CACHE) + set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +elseif(DEFINED ENV{CPM_SOURCE_CACHE}) + set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +else() + set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +endif() + +# Expand relative path. This is important if the provided path contains a tilde (~) +get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE) + +file(DOWNLOAD + https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake + ${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM} +) + +include(${CPM_DOWNLOAD_LOCATION}) diff --git a/cmake/reelayConfig.cmake.in b/cmake/reelayConfig.cmake.in new file mode 100644 index 0000000..52a0290 --- /dev/null +++ b/cmake/reelayConfig.cmake.in @@ -0,0 +1,8 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/reelayTargets.cmake") + +# Provide version info +set(REELAY_VERSION_MAJOR "@REELAY_VERSION_MAJOR@") +set(REELAY_VERSION_MINOR "@REELAY_VERSION_MINOR@") +set(REELAY_VERSION "@REELAY_VERSION@") diff --git a/containers/devel/Dockerfile b/containers/devel/Dockerfile index 3f0ed88..f06ba4e 100644 --- a/containers/devel/Dockerfile +++ b/containers/devel/Dockerfile @@ -17,30 +17,3 @@ RUN dnf install -y \ clang-tools-extra \ && \ dnf clean all - -RUN --mount=type=bind,source=./scripts/boost-source-cmake-install.sh,target=/container-build/scripts/boost-source-cmake-install.sh \ - . /container-build/scripts/boost-source-cmake-install.sh - -RUN mkdir -p /tmp/boost &&\ - curl -L https://github.com/boostorg/boost/releases/download/boost-1.89.0/boost-1.89.0-cmake.tar.gz | tar -xz --strip-components=1 -C /tmp/boost && \ - cmake -S /tmp/boost -B /tmp/boost/build \ - -DBOOST_ENABLE_MPI=OFF \ - -DBOOST_ENABLE_PYTHON=OFF \ - -DBUILD_SHARED_LIBS=OFF \ - -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ - && \ - cmake --build /tmp/boost/build --target install -- -j"$(nproc)" && \ - rm -rf /tmp/boost - -RUN git clone --depth 1 --branch v3.11.0 https://github.com/catchorg/Catch2.git /tmp/catch2 && \ - cmake -S/tmp/catch2 -B/tmp/catch2/build \ - -DBUILD_TESTING=OFF \ - -DCATCH_INSTALL_DOCS=OFF \ - && \ - cmake --build /tmp/catch2/build/ --target install -j$(nproc) && \ - rm -rf /tmp/catch2 - -RUN git clone --depth 1 --branch v4.0.7 https://github.com/lemire/simdjson.git /tmp/simdjson && \ - cmake -S/tmp/simdjson -B/tmp/simdjson/build && \ - cmake --build /tmp/simdjson/build/ --target install -j$(nproc) && \ - rm -rf /tmp/simdjson diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 847a993..afa23c4 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,4 +1,12 @@ -find_package(Catch2 REQUIRED) +set(REELAY_CATCH2_VERSION "3.11.0" CACHE STRING "Version of Catch2 to fetch for tests") + +FetchContent_Declare( + Catch2 + GIT_REPOSITORY https://github.com/catchorg/Catch2.git + GIT_TAG v${REELAY_CATCH2_VERSION} # change version as needed + FIND_PACKAGE_ARGS ${REELAY_CATCH2_VERSION_MIN} +) +FetchContent_MakeAvailable(Catch2) include(Catch) include(CTest) @@ -12,7 +20,7 @@ add_executable( src/discrete_timed_data.test.cpp src/discrete_timed_robustness.test.cpp) -target_link_libraries(reelay_tests PRIVATE reelay::reelay cudd) +target_link_libraries(reelay_tests PRIVATE reelay::reelay) target_link_libraries(reelay_tests PRIVATE Catch2::Catch2WithMain) catch_discover_tests(reelay_tests) From 0bdee6a2424a536c00bf34e9312e44b1f5ad360d Mon Sep 17 00:00:00 2001 From: Dogan Ulus Date: Mon, 3 Nov 2025 17:59:37 +0000 Subject: [PATCH 06/11] Update python versions --- .github/workflows/python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 07c7ea0..714c33a 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] steps: - name: Checkout repository uses: actions/checkout@v3 From c172113c17bf323aa599c91ea7ca868953df41fb Mon Sep 17 00:00:00 2001 From: Dogan Ulus Date: Mon, 3 Nov 2025 18:09:46 +0000 Subject: [PATCH 07/11] Update python workflow --- .github/workflows/python.yml | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 714c33a..4fa473d 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -7,30 +7,39 @@ on: - "python/**" - "include/reelay/**" - ".github/workflows/python.yml" # Self-trigger + pull_request: jobs: build: runs-on: ubuntu-latest - container: ghcr.io/doganulus/reelay-devel strategy: + fail-fast: false matrix: python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] + steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v5 - - name: Setup Python version - uses: actions/setup-python@v4 + - name: Setup Python + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - - name: Build Reelay Python package - run: pip install . + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential cmake ninja-build + + - name: Upgrade pip and build tools + run: | + python -m pip install --upgrade pip setuptools wheel build - - name: Install test dependencies - run: pip install pytest + - name: Build Reelay Python package (editable mode) + run: | + pip install -e .[test] - # Configure in pyproject.toml - name: Run tests - run: pytest + run: | + pytest -v From 14a8f44c8aaba9824d6c4baf5ef83115d080c671 Mon Sep 17 00:00:00 2001 From: Dogan Ulus Date: Wed, 5 Nov 2025 17:18:46 +0000 Subject: [PATCH 08/11] Update build system --- .github/workflows/python.yml | 1 - CMakeLists.txt | 31 +++++++++++++------------------ Makefile | 6 ++++-- include/reelay/intervals.hpp | 2 +- include/reelay/unordered_data.hpp | 3 +-- src/pybind11/CMakeLists.txt | 27 ++++++++++++++++++--------- 6 files changed, 37 insertions(+), 33 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 4fa473d..a16270a 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -7,7 +7,6 @@ on: - "python/**" - "include/reelay/**" - ".github/workflows/python.yml" # Self-trigger - pull_request: jobs: build: diff --git a/CMakeLists.txt b/CMakeLists.txt index 04e79d8..6d02675 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,7 +56,7 @@ CPMAddPackage( NAME Boost VERSION ${REELAY_BOOST_VERSION} URL https://github.com/boostorg/boost/releases/download/boost-${REELAY_BOOST_VERSION}/boost-${REELAY_BOOST_VERSION}-cmake.tar.gz - OPTIONS + OPTIONS "BOOST_USE_STATIC_LIBS=ON" ) @@ -69,32 +69,27 @@ CPMAddPackage( # FetchContent_MakeAvailable(Boost) FetchContent_Declare( - cudd + Cudd GIT_REPOSITORY https://github.com/cuddorg/cudd.git GIT_TAG 4.0.0 SYSTEM EXCLUDE_FROM_ALL ) -FetchContent_MakeAvailable(cudd) - -# Define a target for CUDD manually (if it doesn't export one) -if(NOT TARGET cudd) - add_library(cudd STATIC IMPORTED GLOBAL) - # Assume it’s built under cudd_SOURCE_DIR - set_target_properties(cudd PROPERTIES - IMPORTED_LOCATION ${cudd_BINARY_DIR}/libcudd.a - INTERFACE_INCLUDE_DIRECTORIES - "${cudd_SOURCE_DIR}/cudd;${cudd_SOURCE_DIR}/cplusplus" - ) -endif() +FetchContent_MakeAvailable(Cudd) # reelay-core target_include_directories( - reelay INTERFACE $ - $ - $) + reelay INTERFACE + $ + $ +) -target_link_libraries(reelay INTERFACE Threads::Threads cudd::cudd) +target_link_libraries( + reelay INTERFACE + Boost::icl + Cudd::cudd + Threads::Threads +) install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") install( diff --git a/Makefile b/Makefile index 8a388e6..29a04f0 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,12 @@ WORKSPACE := ${PWD} BUILD_DIRECTORY := /tmp/build/$(basename $(notdir ${WORKSPACE})) -.PHONY: all configure build test cbuild cryjson +.PHONY: default configure build test cbuild cryjson + +default: build configure: - cmake -S $(WORKSPACE) -B $(BUILD_DIRECTORY) + cmake -S $(WORKSPACE) -B $(BUILD_DIRECTORY) -DBUILD_TESTS=ON build: configure cmake --build $(BUILD_DIRECTORY) diff --git a/include/reelay/intervals.hpp b/include/reelay/intervals.hpp index d556811..84d4a6a 100644 --- a/include/reelay/intervals.hpp +++ b/include/reelay/intervals.hpp @@ -12,7 +12,7 @@ #include "boost/icl/interval_map.hpp" #include "boost/icl/interval_set.hpp" -#include "cuddObj.hh" +#include "cudd/cudd.hpp" namespace boost { namespace icl { diff --git a/include/reelay/unordered_data.hpp b/include/reelay/unordered_data.hpp index d8a9ce1..d0825ad 100644 --- a/include/reelay/unordered_data.hpp +++ b/include/reelay/unordered_data.hpp @@ -12,8 +12,7 @@ #include #include -#include "cudd.h" -#include "cuddObj.hh" +#include "cudd/cudd.hpp" template<> struct std::hash { diff --git a/src/pybind11/CMakeLists.txt b/src/pybind11/CMakeLists.txt index 49a047a..bfc3fa7 100644 --- a/src/pybind11/CMakeLists.txt +++ b/src/pybind11/CMakeLists.txt @@ -11,19 +11,27 @@ if(DEFINED PY_BUILD_CMAKE_PACKAGE_VERSION) endif() endif() -include(cmake/QueryPythonForPybind11.cmake) -find_pybind11_python_first() +# include(cmake/QueryPythonForPybind11.cmake) +# find_pybind11_python_first() # Find the Python development files find_package(Python3 REQUIRED COMPONENTS Development.Module) # pybind11 is header-only, so finding a native version is fine -find_package( - pybind11 - ${ARGN} - REQUIRED - CONFIG - CMAKE_FIND_ROOT_PATH_BOTH) +# find_package( +# pybind11 +# ${ARGN} +# REQUIRED +# CONFIG +# CMAKE_FIND_ROOT_PATH_BOTH) + +include(FetchContent) +FetchContent_Declare( + pybind11 + GIT_REPOSITORY https://github.com/pybind/pybind11 + GIT_TAG v3.0.1 +) +FetchContent_MakeAvailable(pybind11) # Compile the example Python module pybind11_add_module(_pybind11_module MODULE "main.cpp") @@ -51,4 +59,5 @@ install( TARGETS _pybind11_module EXCLUDE_FROM_ALL COMPONENT python_modules - DESTINATION ${PY_BUILD_CMAKE_MODULE_NAME}) + DESTINATION ${PY_BUILD_CMAKE_MODULE_NAME} +) From 5b21db478655274be6fdd3ebf3c14ec2329df4d4 Mon Sep 17 00:00:00 2001 From: Dogan Ulus Date: Wed, 5 Nov 2025 17:24:52 +0000 Subject: [PATCH 09/11] Update tests workflow --- .github/workflows/tests.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 35a8694..75292bb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,16 +5,28 @@ on: push: paths: - "include/reelay/**" + - "tests/**" - "CMakeLists.txt" - ".github/workflows/tests.yml" # Self-trigger jobs: test: runs-on: ubuntu-latest - container: ghcr.io/doganulus/reelay-devel steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v2 + with: + cmake-version: '3.22.x' + + - name: Configure CMake + run: cmake -B build -S . + + - name: Build + run: cmake --build build + - name: Run unit tests - run: make test + run: ctest --test-dir build --output-on-failure From fcacc194ed2bf45f1e7d0699ed2b8cba97ae4a99 Mon Sep 17 00:00:00 2001 From: Dogan Ulus Date: Wed, 5 Nov 2025 17:29:15 +0000 Subject: [PATCH 10/11] Update Reelay configuration variables --- .github/workflows/tests.yml | 2 +- CMakeLists.txt | 10 +++++----- Makefile | 2 +- pyproject.toml | 6 +++--- src/CMakeLists.txt | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 75292bb..bf28aa2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,7 +23,7 @@ jobs: cmake-version: '3.22.x' - name: Configure CMake - run: cmake -B build -S . + run: cmake -B build -S . -DREELAY_BUILD_TESTS=ON - name: Build run: cmake --build build diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d02675..b079785 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,9 +37,9 @@ else() message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") endif() -option(BUILD_TESTS "Build the C++ unit tests" ON) -option(BUILD_REELAY_APPS "Build Reelay Apps" OFF) -option(BUILD_PYTHON_BINDINGS "Build Python bindings" OFF) +option(REELAY_BUILD_TESTS "Build the C++ unit tests" OFF) +option(REELAY_BUILD_APPS "Build Reelay Apps" OFF) +option(REELAY_BUILD_PYTHON_BINDINGS "Build Python bindings" OFF) set(REELAY_BOOST_VERSION "1.89.0" CACHE STRING "Fetch Boost version") @@ -112,12 +112,12 @@ install( add_subdirectory(src) -if(BUILD_TESTS) +if(REELAY_BUILD_TESTS) enable_testing() add_subdirectory(tests) endif() -if(BUILD_REELAY_APPS) +if(REELAY_BUILD_APPS) message(STATUS "Building Reelay apps...") add_subdirectory(apps) endif() diff --git a/Makefile b/Makefile index 29a04f0..67ce9e6 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ BUILD_DIRECTORY := /tmp/build/$(basename $(notdir ${WORKSPACE})) default: build configure: - cmake -S $(WORKSPACE) -B $(BUILD_DIRECTORY) -DBUILD_TESTS=ON + cmake -S $(WORKSPACE) -B $(BUILD_DIRECTORY) -DREELAY_BUILD_TESTS=ON build: configure cmake --build $(BUILD_DIRECTORY) diff --git a/pyproject.toml b/pyproject.toml index 584c30c..84f1092 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,9 +54,9 @@ install_components = ["python_modules"] env = {} [tool.py-build-cmake.cmake.options] -"BUILD_TESTS:BOOL" = "OFF" -"BUILD_REELAY_APPS:BOOL" = "OFF" -"BUILD_PYTHON_BINDINGS:BOOL" = "ON" +"REELAY_BUILD_TESTS:BOOL" = "OFF" +"REELAY_BUILD_APPS:BOOL" = "OFF" +"REELAY_BUILD_PYTHON_BINDINGS:BOOL" = "ON" [tool.py-build-cmake.linux.cmake] # Linux-specific options generator = "Ninja" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 83d7dd0..01a528d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ # Python bindings -if(BUILD_PYTHON_BINDINGS) +if(REELAY_BUILD_PYTHON_BINDINGS) add_subdirectory(pybind11) endif() From 3e6a2340ee8c55f35111a7365b05855d055fab56 Mon Sep 17 00:00:00 2001 From: Dogan Ulus Date: Wed, 5 Nov 2025 19:23:52 +0000 Subject: [PATCH 11/11] Try a nwer cmake version --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bf28aa2..9b0e2c4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,7 +20,7 @@ jobs: - name: Setup cmake uses: jwlawson/actions-setup-cmake@v2 with: - cmake-version: '3.22.x' + cmake-version: '3.31' - name: Configure CMake run: cmake -B build -S . -DREELAY_BUILD_TESTS=ON