Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .devcontainer/Dockerfile

This file was deleted.

35 changes: 15 additions & 20 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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
}
}
}
}
30 changes: 19 additions & 11 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,34 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: ghcr.io/doganulus/reelay-devel

strategy:
fail-fast: false
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
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
19 changes: 16 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +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.31'

- name: Configure CMake
run: cmake -B build -S . -DREELAY_BUILD_TESTS=ON

- name: Build
run: cmake --build build

- name: Run unit tests
run: make test
run: ctest --test-dir build --output-on-failure
29 changes: 29 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
# 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# virtualenv
.venv/

# compile_commands.json
**/compile_commands.json

Expand Down
89 changes: 67 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -37,25 +37,59 @@ 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" ON)
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")

include(GNUInstallDirs)
include(FetchContent)
include(cmake/CPM.cmake)

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)

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
GIT_TAG 4.0.0
SYSTEM
EXCLUDE_FROM_ALL
)
FetchContent_MakeAvailable(Cudd)

# reelay-core
target_include_directories(
reelay INTERFACE $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include/>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

target_link_libraries(reelay INTERFACE ${cudd_static})
reelay INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

target_link_libraries(
reelay INTERFACE
Boost::icl
Cudd::cudd
Threads::Threads
)

install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(
Expand All @@ -65,23 +99,34 @@ 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)

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()

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()
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
WORKSPACE := ${PWD}
BUILD_DIRECTORY := /tmp/$(basename $(notdir ${WORKSPACE}))/build
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) -DREELAY_BUILD_TESTS=ON

build: configure
cmake --build $(BUILD_DIRECTORY)
Expand All @@ -24,3 +26,5 @@ cryjson:
cbenchmark:
docker build -t ghcr.io/doganulus/reelay-benchmark:latest docker/benchmark

clean:
rm -rf $(BUILD_DIRECTORY)
24 changes: 24 additions & 0 deletions cmake/CPM.cmake
Original file line number Diff line number Diff line change
@@ -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})
8 changes: 8 additions & 0 deletions cmake/reelayConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -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@")
19 changes: 19 additions & 0 deletions containers/devel/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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
File renamed without changes.
File renamed without changes.
Loading
Loading