From 3168e415381a10b70207dfade981416c53372dfd Mon Sep 17 00:00:00 2001 From: spefk Date: Sun, 18 Jan 2026 15:55:24 +0300 Subject: [PATCH 01/33] feat all: make precalculated databases part of cirbo, add data paths utils, fix repeated compilation of all C targets, fix ABC compilation arguments settigns, fix how DISABLE_ABC_CEXT is parsed, add print of circuit signature to the tutorial --- .github/workflows/build_wheels.yaml | 45 ++++++++++++----------------- CMakeLists.txt | 12 ++++---- build.py | 14 +++++++-- 3 files changed, 35 insertions(+), 36 deletions(-) diff --git a/.github/workflows/build_wheels.yaml b/.github/workflows/build_wheels.yaml index 6b9d65a..27f49be 100644 --- a/.github/workflows/build_wheels.yaml +++ b/.github/workflows/build_wheels.yaml @@ -4,42 +4,35 @@ on: workflow_dispatch jobs: build_wheels: - name: Build wheels for ${{ matrix.os }}, python ${{ matrix.pyver }} + name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - # windows-latest is not enabled because is untested yet. - # macos-latest is not enabled because ABC refures to compile. - os: [ubuntu-latest] - pyver: [cp39, cp310, cp311, cp312, cp313] - + include: + - os: ubuntu-latest + cibw_archs_macos: "" + - os: macos-15-intel + cibw_archs_macos: x86_64 + - os: macos-14 + cibw_archs_macos: arm64 + - os: windows-latest + cibw_archs_macos: "" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: submodules: 'true' - - name: Update CMake - uses: jwlawson/actions-setup-cmake@v2.0 - - - name: Install brew dependencies - run: | - HOMEBREW_NO_AUTO_UPDATE=1 brew install readline ninja - if: ${{ contains(matrix.os, 'macos') }} - - name: Build wheels - uses: pypa/cibuildwheel@v2.22.0 + uses: pypa/cibuildwheel@v3.3.1 env: - CIBW_BUILD: ${{matrix.pyver}}-* - CIBW_ARCHS_LINUX: auto - CIBW_ARCHS_MACOS: auto - CIBW_ARCHS_WINDOWS: auto + CIBW_BUILD: "cp3{9,10,11,12,13,14}-*" + CIBW_ARCHS_MACOS: ${{ matrix.cibw_archs_macos }} + CIBW_BEFORE_ALL_MACOS: "HOMEBREW_NO_AUTO_UPDATE=1 brew install ninja readline" + CIBW_BEFORE_ALL_LINUX: "yum install -y ninja-build" CIBW_TEST_REQUIRES: pytest mock - CIBW_TEST_COMMAND: pytest {package}/tests - CIBW_TEST_SKIP: >- - *-musllinux_* - *-macosx_universal2:arm64 - pp*-macosx_* + CIBW_TEST_COMMAND: pytest -m 'not manual' {package}/tests + CIBW_TEST_SKIP: "*-musllinux_*" with: package-dir: . output-dir: wheelhouse @@ -47,5 +40,5 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: wheel-${{ matrix.pyver }}-${{ matrix.os }} + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} path: ./wheelhouse/*.whl diff --git a/CMakeLists.txt b/CMakeLists.txt index 649df9e..d02e3fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,10 +11,6 @@ option(DISABLE_ABC_CEXT "Controls if ABC should be compiled." OFF) # Note: must be before mockturtle's CMakeLists is added. SET(MOCKTURTLE_EXAMPLES OFF CACHE BOOL "Build examples" FORCE) -# Disabled because it requires gnu readline to be installed on build -# machine, but not necessary for the ABC compilation as library. -list(APPEND ABC_READLINE_FLAGS "ABC_USE_NO_READLINE=1") - add_subdirectory(third_party/pybind11) add_subdirectory(third_party/mockturtle) @@ -24,11 +20,13 @@ target_include_directories(mockturtle_wrapper PRIVATE third_party) # ABC related libs can be disabled using environment variable. IF(NOT DISABLE_ABC_CEXT) + # Disabled because it requires gnu readline to be installed on build + # machine, but is not necessary for the ABC compilation as library. + set(READLINE_FOUND FALSE CACHE BOOL "" FORCE) + add_subdirectory(third_party/abc) - # Needed for correct library compilation. - target_compile_options(libabc PRIVATE -fPIC) pybind11_add_module(abc_wrapper extensions/abc_wrapper/src/module.cpp) - target_link_libraries(abc_wrapper PRIVATE libabc) + target_link_libraries(abc_wrapper PRIVATE libabc-pic) target_include_directories(abc_wrapper PRIVATE third_party) ENDIF(NOT DISABLE_ABC_CEXT) diff --git a/build.py b/build.py index 0827d0f..c0f7ae8 100644 --- a/build.py +++ b/build.py @@ -20,11 +20,19 @@ "win-arm64": "ARM64", } +def _parse_env_flag(name: str, default: bool = False) -> bool: + v = os.environ.get(name) + if v is None: + return default + v = v.strip().lower() + return v not in ("", "0", "false", "no", "off") + + # Disables building extensions and subdirectories related to ABC -DISABLE_ABC_CEXT = bool(os.environ.get('DISABLE_ABC_CEXT', False)) +DISABLE_ABC_CEXT = _parse_env_flag('DISABLE_ABC_CEXT', False) -# A CMakeExtension needs a sourcedir instead of a file list. +# A CMakeExtension needs a source dir instead of a file list. # The name must be the _single_ output extension from the CMake build. # If you need multiple extensions, see scikit-build. class CMakeExtension(Extension): @@ -130,7 +138,7 @@ def build_extension(self, ext: CMakeExtension) -> None: ["cmake", ext.sourcedir, *cmake_args], cwd=build_temp, check=True ) subprocess.run( - ["cmake", "--build", ".", *build_args], cwd=build_temp, check=True + ["cmake", "--build", ".", *build_args, "--target", ext.name], cwd=build_temp, check=True ) From 82d194f92c9e65a1af16820b01965f01552252a3 Mon Sep 17 00:00:00 2001 From: spefk Date: Sun, 18 Jan 2026 16:03:30 +0300 Subject: [PATCH 02/33] remove windows from actions --- .github/workflows/build_wheels.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yaml b/.github/workflows/build_wheels.yaml index 27f49be..9097eba 100644 --- a/.github/workflows/build_wheels.yaml +++ b/.github/workflows/build_wheels.yaml @@ -16,8 +16,8 @@ jobs: cibw_archs_macos: x86_64 - os: macos-14 cibw_archs_macos: arm64 - - os: windows-latest - cibw_archs_macos: "" +# - os: windows-latest +# cibw_archs_macos: "" steps: - uses: actions/checkout@v5 with: From 454b93633ea34df66a69f33dff43b39c5fa5f038 Mon Sep 17 00:00:00 2001 From: spefk Date: Mon, 19 Jan 2026 00:13:34 +0300 Subject: [PATCH 03/33] try fix --- .github/workflows/build_wheels.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_wheels.yaml b/.github/workflows/build_wheels.yaml index 9097eba..504f7e2 100644 --- a/.github/workflows/build_wheels.yaml +++ b/.github/workflows/build_wheels.yaml @@ -27,6 +27,8 @@ jobs: uses: pypa/cibuildwheel@v3.3.1 env: CIBW_BUILD: "cp3{9,10,11,12,13,14}-*" + CIBW_BUILD_FRONTEND: "pip" + CIBW_BUILD_VERBOSITY: "2" CIBW_ARCHS_MACOS: ${{ matrix.cibw_archs_macos }} CIBW_BEFORE_ALL_MACOS: "HOMEBREW_NO_AUTO_UPDATE=1 brew install ninja readline" CIBW_BEFORE_ALL_LINUX: "yum install -y ninja-build" From b2d22dea66b7c58eb2de4bef3891dbf72aa243ff Mon Sep 17 00:00:00 2001 From: spefk Date: Mon, 19 Jan 2026 00:18:58 +0300 Subject: [PATCH 04/33] try fix --- .github/workflows/build_wheels.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build_wheels.yaml b/.github/workflows/build_wheels.yaml index 504f7e2..54e010e 100644 --- a/.github/workflows/build_wheels.yaml +++ b/.github/workflows/build_wheels.yaml @@ -23,6 +23,14 @@ jobs: with: submodules: 'true' + - name: Update CMake + uses: jwlawson/actions-setup-cmake@v2.0 + + - name: Install brew dependencies + run: | + HOMEBREW_NO_AUTO_UPDATE=1 brew install readline ninja + if: ${{ contains(matrix.os, 'macos') }} + - name: Build wheels uses: pypa/cibuildwheel@v3.3.1 env: From ff0f39ea1b2139b22e5dba096ffa27408fae7d85 Mon Sep 17 00:00:00 2001 From: spefk Date: Mon, 19 Jan 2026 00:38:10 +0300 Subject: [PATCH 05/33] try fix --- .github/workflows/build_wheels.yaml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_wheels.yaml b/.github/workflows/build_wheels.yaml index 54e010e..c8a9ea5 100644 --- a/.github/workflows/build_wheels.yaml +++ b/.github/workflows/build_wheels.yaml @@ -23,14 +23,6 @@ jobs: with: submodules: 'true' - - name: Update CMake - uses: jwlawson/actions-setup-cmake@v2.0 - - - name: Install brew dependencies - run: | - HOMEBREW_NO_AUTO_UPDATE=1 brew install readline ninja - if: ${{ contains(matrix.os, 'macos') }} - - name: Build wheels uses: pypa/cibuildwheel@v3.3.1 env: @@ -49,6 +41,10 @@ jobs: config-file: "{package}/pyproject.toml" - uses: actions/upload-artifact@v4 + if: always() with: name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} - path: ./wheelhouse/*.whl + path: | + wheelhouse/*.whl + **/CMakeFiles/CMakeOutput.log + **/CMakeFiles/CMakeError.log \ No newline at end of file From aff574118d5455dbd75bb7658a50e031744305d0 Mon Sep 17 00:00:00 2001 From: spefk Date: Mon, 19 Jan 2026 00:55:20 +0300 Subject: [PATCH 06/33] try fix --- .github/workflows/build_wheels.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yaml b/.github/workflows/build_wheels.yaml index c8a9ea5..32a4327 100644 --- a/.github/workflows/build_wheels.yaml +++ b/.github/workflows/build_wheels.yaml @@ -31,7 +31,7 @@ jobs: CIBW_BUILD_VERBOSITY: "2" CIBW_ARCHS_MACOS: ${{ matrix.cibw_archs_macos }} CIBW_BEFORE_ALL_MACOS: "HOMEBREW_NO_AUTO_UPDATE=1 brew install ninja readline" - CIBW_BEFORE_ALL_LINUX: "yum install -y ninja-build" + CIBW_BEFORE_ALL_LINUX: "yum install -y ninja-build; python -m pip install ninja" CIBW_TEST_REQUIRES: pytest mock CIBW_TEST_COMMAND: pytest -m 'not manual' {package}/tests CIBW_TEST_SKIP: "*-musllinux_*" From e3e7d6172fda15fa8c03eea42b1613f6d63f3769 Mon Sep 17 00:00:00 2001 From: spefk Date: Mon, 19 Jan 2026 01:03:11 +0300 Subject: [PATCH 07/33] try fix --- .github/workflows/build_wheels.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yaml b/.github/workflows/build_wheels.yaml index 32a4327..465eed2 100644 --- a/.github/workflows/build_wheels.yaml +++ b/.github/workflows/build_wheels.yaml @@ -21,7 +21,17 @@ jobs: steps: - uses: actions/checkout@v5 with: - submodules: 'true' + fetch-depth: 0 + submodules: recursive + ref: my-branch + + - name: Debug submodules state + run: | + git submodule status --recursive + git -C third_party/mockturtle rev-parse HEAD + python -V + cmake --version || true + g++ --version || true - name: Build wheels uses: pypa/cibuildwheel@v3.3.1 From d0b3ba64a60e098bc09bccfba93b1d789f5f9ea5 Mon Sep 17 00:00:00 2001 From: spefk Date: Mon, 19 Jan 2026 01:04:28 +0300 Subject: [PATCH 08/33] try fix --- .github/workflows/build_wheels.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build_wheels.yaml b/.github/workflows/build_wheels.yaml index 465eed2..91543ef 100644 --- a/.github/workflows/build_wheels.yaml +++ b/.github/workflows/build_wheels.yaml @@ -23,7 +23,6 @@ jobs: with: fetch-depth: 0 submodules: recursive - ref: my-branch - name: Debug submodules state run: | From 967dc8a3e0c429a386a0b009a992d428dc75d6f9 Mon Sep 17 00:00:00 2001 From: spefk Date: Mon, 19 Jan 2026 01:25:18 +0300 Subject: [PATCH 09/33] try fix --- .github/workflows/build_wheels.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yaml b/.github/workflows/build_wheels.yaml index 91543ef..d0859f1 100644 --- a/.github/workflows/build_wheels.yaml +++ b/.github/workflows/build_wheels.yaml @@ -14,8 +14,10 @@ jobs: cibw_archs_macos: "" - os: macos-15-intel cibw_archs_macos: x86_64 + macos_deploy_target: "10.15" - os: macos-14 cibw_archs_macos: arm64 + macos_deploy_target: "11.0" # - os: windows-latest # cibw_archs_macos: "" steps: @@ -36,9 +38,12 @@ jobs: uses: pypa/cibuildwheel@v3.3.1 env: CIBW_BUILD: "cp3{9,10,11,12,13,14}-*" - CIBW_BUILD_FRONTEND: "pip" +# CIBW_BUILD_FRONTEND: "pip" CIBW_BUILD_VERBOSITY: "2" CIBW_ARCHS_MACOS: ${{ matrix.cibw_archs_macos }} + CIBW_ENVIRONMENT_MACOS: >- + MACOSX_DEPLOYMENT_TARGET=${{ matrix.macos_deploy_target }} + CMAKE_ARGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.macos_deploy_target }}" CIBW_BEFORE_ALL_MACOS: "HOMEBREW_NO_AUTO_UPDATE=1 brew install ninja readline" CIBW_BEFORE_ALL_LINUX: "yum install -y ninja-build; python -m pip install ninja" CIBW_TEST_REQUIRES: pytest mock From 07716821717cf4e60ca3a8ef8139881a970fec25 Mon Sep 17 00:00:00 2001 From: spefk Date: Mon, 19 Jan 2026 01:54:36 +0300 Subject: [PATCH 10/33] try fix --- .github/workflows/build_wheels.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build_wheels.yaml b/.github/workflows/build_wheels.yaml index d0859f1..ad70821 100644 --- a/.github/workflows/build_wheels.yaml +++ b/.github/workflows/build_wheels.yaml @@ -45,7 +45,6 @@ jobs: MACOSX_DEPLOYMENT_TARGET=${{ matrix.macos_deploy_target }} CMAKE_ARGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.macos_deploy_target }}" CIBW_BEFORE_ALL_MACOS: "HOMEBREW_NO_AUTO_UPDATE=1 brew install ninja readline" - CIBW_BEFORE_ALL_LINUX: "yum install -y ninja-build; python -m pip install ninja" CIBW_TEST_REQUIRES: pytest mock CIBW_TEST_COMMAND: pytest -m 'not manual' {package}/tests CIBW_TEST_SKIP: "*-musllinux_*" From c4763654c8cb61fa91b7ab8be33e5be6963fa118 Mon Sep 17 00:00:00 2001 From: spefk Date: Mon, 19 Jan 2026 01:56:52 +0300 Subject: [PATCH 11/33] try fix --- .github/workflows/build_wheels.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yaml b/.github/workflows/build_wheels.yaml index ad70821..f06909b 100644 --- a/.github/workflows/build_wheels.yaml +++ b/.github/workflows/build_wheels.yaml @@ -38,7 +38,7 @@ jobs: uses: pypa/cibuildwheel@v3.3.1 env: CIBW_BUILD: "cp3{9,10,11,12,13,14}-*" -# CIBW_BUILD_FRONTEND: "pip" + CIBW_BUILD_FRONTEND: "pip" CIBW_BUILD_VERBOSITY: "2" CIBW_ARCHS_MACOS: ${{ matrix.cibw_archs_macos }} CIBW_ENVIRONMENT_MACOS: >- From 837b2b12ed939c481edc0d47b95ea6ba3b950788 Mon Sep 17 00:00:00 2001 From: spefk Date: Mon, 19 Jan 2026 01:59:43 +0300 Subject: [PATCH 12/33] try fix --- .github/workflows/build_wheels.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_wheels.yaml b/.github/workflows/build_wheels.yaml index f06909b..0712c4b 100644 --- a/.github/workflows/build_wheels.yaml +++ b/.github/workflows/build_wheels.yaml @@ -45,6 +45,7 @@ jobs: MACOSX_DEPLOYMENT_TARGET=${{ matrix.macos_deploy_target }} CMAKE_ARGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.macos_deploy_target }}" CIBW_BEFORE_ALL_MACOS: "HOMEBREW_NO_AUTO_UPDATE=1 brew install ninja readline" + CIBW_BEFORE_ALL_LINUX: "yum install -y ninja-build; python -m pip install ninja" CIBW_TEST_REQUIRES: pytest mock CIBW_TEST_COMMAND: pytest -m 'not manual' {package}/tests CIBW_TEST_SKIP: "*-musllinux_*" From 5b09780c344119969900495de1d311c4c20e1aeb Mon Sep 17 00:00:00 2001 From: spefk Date: Mon, 19 Jan 2026 02:12:50 +0300 Subject: [PATCH 13/33] try bump abc --- third_party/abc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/abc b/third_party/abc index 037971d..57544eb 160000 --- a/third_party/abc +++ b/third_party/abc @@ -1 +1 @@ -Subproject commit 037971d9c9aff5dffb6260a844023b9634a50e13 +Subproject commit 57544eb9ca04015120e589b3c80d9edc1e5a8db9 From 811a19cfa6189a063c52e64e85414675d7e1ba74 Mon Sep 17 00:00:00 2001 From: spefk Date: Mon, 19 Jan 2026 02:17:28 +0300 Subject: [PATCH 14/33] try fix --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d02e3fa..e8dad3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,16 @@ IF(NOT DISABLE_ABC_CEXT) add_subdirectory(third_party/abc) + # Fixes case in CI, when ABC compilation + # fails with "#error unknown platform" on + # macos runners (both intel and apple silicon). + if(NOT WIN32) + target_compile_definitions(libabc-pic PRIVATE ABC_USE_STDINT_H) + if(TARGET libabc) + target_compile_definitions(libabc PRIVATE ABC_USE_STDINT_H) + endif() + endif() + pybind11_add_module(abc_wrapper extensions/abc_wrapper/src/module.cpp) target_link_libraries(abc_wrapper PRIVATE libabc-pic) target_include_directories(abc_wrapper PRIVATE third_party) From 5ce1b902248a6fc4fdce0dfe8aa40bcfd1b92a21 Mon Sep 17 00:00:00 2001 From: spefk Date: Mon, 19 Jan 2026 02:40:13 +0300 Subject: [PATCH 15/33] fix --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e8dad3b..2df852b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,17 +26,17 @@ IF(NOT DISABLE_ABC_CEXT) add_subdirectory(third_party/abc) + pybind11_add_module(abc_wrapper extensions/abc_wrapper/src/module.cpp) + target_link_libraries(abc_wrapper PRIVATE libabc-pic) + target_include_directories(abc_wrapper PRIVATE third_party) # Fixes case in CI, when ABC compilation # fails with "#error unknown platform" on # macos runners (both intel and apple silicon). if(NOT WIN32) + target_compile_definitions(abc_wrapper PRIVATE ABC_USE_STDINT_H) target_compile_definitions(libabc-pic PRIVATE ABC_USE_STDINT_H) if(TARGET libabc) target_compile_definitions(libabc PRIVATE ABC_USE_STDINT_H) endif() endif() - - pybind11_add_module(abc_wrapper extensions/abc_wrapper/src/module.cpp) - target_link_libraries(abc_wrapper PRIVATE libabc-pic) - target_include_directories(abc_wrapper PRIVATE third_party) ENDIF(NOT DISABLE_ABC_CEXT) From 6c5dae7dfb3c88eaaada83e4df26389b22375f2b Mon Sep 17 00:00:00 2001 From: spefk Date: Mon, 19 Jan 2026 02:49:44 +0300 Subject: [PATCH 16/33] fix --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2df852b..ad380d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,4 +39,11 @@ IF(NOT DISABLE_ABC_CEXT) target_compile_definitions(libabc PRIVATE ABC_USE_STDINT_H) endif() endif() + + # Fixes failure of pybind11. + if (MSVC) + target_compile_options(abc_wrapper PRIVATE /EHsc /GR) + else() + target_compile_options(abc_wrapper PRIVATE -fexceptions -frtti) + endif() ENDIF(NOT DISABLE_ABC_CEXT) From f4c8c653f78b967db2272ec2cef270b31d53a3f6 Mon Sep 17 00:00:00 2001 From: spefk Date: Mon, 19 Jan 2026 02:54:39 +0300 Subject: [PATCH 17/33] bump version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index deed3ea..e9592bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cirbo" -version = "0.1.0" +version = "0.1.1" requires-python = ">= 3.9" description = "A New Tool for Boolean Circuit Analysis and Synthesis." authors = [ From 110bba6a8a2aff7aef76896a43c8c4376337a9c2 Mon Sep 17 00:00:00 2001 From: spefk Date: Mon, 19 Jan 2026 03:09:35 +0300 Subject: [PATCH 18/33] fix --- build.py | 2 +- pyproject.toml | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/build.py b/build.py index c0f7ae8..c500161 100644 --- a/build.py +++ b/build.py @@ -138,7 +138,7 @@ def build_extension(self, ext: CMakeExtension) -> None: ["cmake", ext.sourcedir, *cmake_args], cwd=build_temp, check=True ) subprocess.run( - ["cmake", "--build", ".", *build_args, "--target", ext.name], cwd=build_temp, check=True + ["cmake", "--build", ".", *build_args, "--target", ext.name, "--verbose"], cwd=build_temp, check=True ) diff --git a/pyproject.toml b/pyproject.toml index e9592bf..2a8bbb0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,17 +4,7 @@ version = "0.1.1" requires-python = ">= 3.9" description = "A New Tool for Boolean Circuit Analysis and Synthesis." authors = [ - {name = "Alexander S. Kulikov"}, - {name = "Daniil Averkov"}, - {name = "Tatiana Belova"}, - {name = "Gregory Emdin"}, - {name = "Mikhail Goncharov"}, - {name = "Viktoriia Krivogornitsyna"}, - {name = "Fedor Kurmazov", email = "f.kurmazov.b@gmail.com"}, - {name = "Daniil Levtsov"}, - {name = "Georgie Levtsov"}, - {name = "Vsevolod Vaskin"}, - {name = "Aleksey Vorobiev"} + {name = "Cirbo contributors"}, ] maintainers = [ {name = "Fedor Kurmazov", email = "f.kurmazov.b@gmail.com"} From 8fce46b907ef55817f249eb1bb2b18afde9372a1 Mon Sep 17 00:00:00 2001 From: spefk Date: Mon, 19 Jan 2026 03:22:19 +0300 Subject: [PATCH 19/33] fix --- CMakeLists.txt | 15 ++++++++------- build.py | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ad380d2..e539b52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,14 @@ IF(NOT DISABLE_ABC_CEXT) add_subdirectory(third_party/abc) + # Prevent ABC from forcing -fno-exceptions/-fno-rtti onto dependents (pybind11 needs exceptions) + get_target_property(_abc_iface_opts libabc-pic INTERFACE_COMPILE_OPTIONS) + if(_abc_iface_opts) + list(REMOVE_ITEM _abc_iface_opts -fno-exceptions) + list(REMOVE_ITEM _abc_iface_opts -fno-rtti) + set_property(TARGET libabc-pic PROPERTY INTERFACE_COMPILE_OPTIONS "${_abc_iface_opts}") + endif() + pybind11_add_module(abc_wrapper extensions/abc_wrapper/src/module.cpp) target_link_libraries(abc_wrapper PRIVATE libabc-pic) target_include_directories(abc_wrapper PRIVATE third_party) @@ -39,11 +47,4 @@ IF(NOT DISABLE_ABC_CEXT) target_compile_definitions(libabc PRIVATE ABC_USE_STDINT_H) endif() endif() - - # Fixes failure of pybind11. - if (MSVC) - target_compile_options(abc_wrapper PRIVATE /EHsc /GR) - else() - target_compile_options(abc_wrapper PRIVATE -fexceptions -frtti) - endif() ENDIF(NOT DISABLE_ABC_CEXT) diff --git a/build.py b/build.py index c500161..c0f7ae8 100644 --- a/build.py +++ b/build.py @@ -138,7 +138,7 @@ def build_extension(self, ext: CMakeExtension) -> None: ["cmake", ext.sourcedir, *cmake_args], cwd=build_temp, check=True ) subprocess.run( - ["cmake", "--build", ".", *build_args, "--target", ext.name, "--verbose"], cwd=build_temp, check=True + ["cmake", "--build", ".", *build_args, "--target", ext.name], cwd=build_temp, check=True ) From 294af704cc449121ff5fec19f1814755e88aae21 Mon Sep 17 00:00:00 2001 From: spefk Date: Mon, 19 Jan 2026 21:35:31 +0300 Subject: [PATCH 20/33] fix --- CMakeLists.txt | 21 ++++++++++++++++----- build.py | 4 ++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e539b52..5ad4fae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,11 +27,20 @@ IF(NOT DISABLE_ABC_CEXT) add_subdirectory(third_party/abc) # Prevent ABC from forcing -fno-exceptions/-fno-rtti onto dependents (pybind11 needs exceptions) - get_target_property(_abc_iface_opts libabc-pic INTERFACE_COMPILE_OPTIONS) - if(_abc_iface_opts) - list(REMOVE_ITEM _abc_iface_opts -fno-exceptions) - list(REMOVE_ITEM _abc_iface_opts -fno-rtti) - set_property(TARGET libabc-pic PROPERTY INTERFACE_COMPILE_OPTIONS "${_abc_iface_opts}") + get_target_property(_abc_pic_interface_opts libabc-pic INTERFACE_COMPILE_OPTIONS) + if(_abc_pic_interface_opts) + list(REMOVE_ITEM _abc_pic_interface_opts -fno-exceptions) + list(REMOVE_ITEM _abc_pic_interface_opts -fno-rtti) + set_property(TARGET libabc-pic PROPERTY INTERFACE_COMPILE_OPTIONS "${_abc_pic_interface_opts}") + endif() + + if(TARGET libabc) + get_target_property(_abc_interface_opts libabc INTERFACE_COMPILE_OPTIONS) + if(_abc_interface_opts) + list(REMOVE_ITEM _abc_interface_opts -fno-exceptions) + list(REMOVE_ITEM _abc_interface_opts -fno-rtti) + set_property(TARGET libabc PROPERTY INTERFACE_COMPILE_OPTIONS "${_abc_interface_opts}") + endif() endif() pybind11_add_module(abc_wrapper extensions/abc_wrapper/src/module.cpp) @@ -47,4 +56,6 @@ IF(NOT DISABLE_ABC_CEXT) target_compile_definitions(libabc PRIVATE ABC_USE_STDINT_H) endif() endif() + + target_compile_options(abc_wrapper PRIVATE -fexceptions -frtti) ENDIF(NOT DISABLE_ABC_CEXT) diff --git a/build.py b/build.py index c0f7ae8..c0bc272 100644 --- a/build.py +++ b/build.py @@ -58,7 +58,7 @@ def build_extension(self, ext: CMakeExtension) -> None: cmake_generator = os.environ.get("CMAKE_GENERATOR", "") # Set Python_EXECUTABLE instead if you use PYBIND11_FINDPYTHON - # EXAMPLE_VERSION_INFO shows you how to pass a value into the C++ code + # VERSION_INFO shows you how to pass a value into the C++ code # from Python. cmake_args = [ f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}{os.sep}", @@ -72,7 +72,7 @@ def build_extension(self, ext: CMakeExtension) -> None: cmake_args += [item for item in os.environ["CMAKE_ARGS"].split(" ") if item] # In this example, we pass in the version to C++. You might not need to. - cmake_args += [f"-DEXAMPLE_VERSION_INFO={self.distribution.get_version()}"] + cmake_args += [f"-DVERSION_INFO={self.distribution.get_version()}"] if DISABLE_ABC_CEXT: cmake_args += [f"-DDISABLE_ABC_CEXT=ON"] From 336a7b1b0d7e3ffa5a4bea06656b19bbce379e50 Mon Sep 17 00:00:00 2001 From: spefk Date: Mon, 19 Jan 2026 21:45:50 +0300 Subject: [PATCH 21/33] fix --- CMakeLists.txt | 1 + third_party/abc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ad4fae..7866758 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,5 +57,6 @@ IF(NOT DISABLE_ABC_CEXT) endif() endif() + # Fixes pybing11 build errors when exceptions are not defined. target_compile_options(abc_wrapper PRIVATE -fexceptions -frtti) ENDIF(NOT DISABLE_ABC_CEXT) diff --git a/third_party/abc b/third_party/abc index 57544eb..037971d 160000 --- a/third_party/abc +++ b/third_party/abc @@ -1 +1 @@ -Subproject commit 57544eb9ca04015120e589b3c80d9edc1e5a8db9 +Subproject commit 037971d9c9aff5dffb6260a844023b9634a50e13 From 3cba06df405b3e6370d417aa05aec8718c1bb648 Mon Sep 17 00:00:00 2001 From: spefk Date: Tue, 20 Jan 2026 01:39:03 +0300 Subject: [PATCH 22/33] remove 3.14 from buildwheels --- .github/workflows/build_wheels.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yaml b/.github/workflows/build_wheels.yaml index 0712c4b..f09c5e6 100644 --- a/.github/workflows/build_wheels.yaml +++ b/.github/workflows/build_wheels.yaml @@ -37,7 +37,7 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v3.3.1 env: - CIBW_BUILD: "cp3{9,10,11,12,13,14}-*" + CIBW_BUILD: "cp3{9,10,11,12,13}-*" CIBW_BUILD_FRONTEND: "pip" CIBW_BUILD_VERBOSITY: "2" CIBW_ARCHS_MACOS: ${{ matrix.cibw_archs_macos }} From 66ab23e03fa171bcc6f406d065bc5b2746e11561 Mon Sep 17 00:00:00 2001 From: spefk Date: Tue, 20 Jan 2026 20:34:45 +0300 Subject: [PATCH 23/33] enable windows --- .github/workflows/build_wheels.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yaml b/.github/workflows/build_wheels.yaml index f09c5e6..b4b44b3 100644 --- a/.github/workflows/build_wheels.yaml +++ b/.github/workflows/build_wheels.yaml @@ -18,8 +18,8 @@ jobs: - os: macos-14 cibw_archs_macos: arm64 macos_deploy_target: "11.0" -# - os: windows-latest -# cibw_archs_macos: "" + - os: windows-latest + cibw_archs_macos: "" steps: - uses: actions/checkout@v5 with: From 6d0333bf7807ed0d3e9af34d0c879d686061d002 Mon Sep 17 00:00:00 2001 From: spefk Date: Tue, 20 Jan 2026 20:36:33 +0300 Subject: [PATCH 24/33] fix --- .github/workflows/build_wheels.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/build_wheels.yaml b/.github/workflows/build_wheels.yaml index b4b44b3..b5c38d0 100644 --- a/.github/workflows/build_wheels.yaml +++ b/.github/workflows/build_wheels.yaml @@ -26,14 +26,6 @@ jobs: fetch-depth: 0 submodules: recursive - - name: Debug submodules state - run: | - git submodule status --recursive - git -C third_party/mockturtle rev-parse HEAD - python -V - cmake --version || true - g++ --version || true - - name: Build wheels uses: pypa/cibuildwheel@v3.3.1 env: From ca99c5d7d7054c74393effa4abb43babadfa8d76 Mon Sep 17 00:00:00 2001 From: spefk Date: Tue, 20 Jan 2026 20:37:42 +0300 Subject: [PATCH 25/33] fix --- pyproject.toml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 2a8bbb0..f079d2a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,17 @@ requires-python = ">= 3.9" description = "A New Tool for Boolean Circuit Analysis and Synthesis." authors = [ {name = "Cirbo contributors"}, +# {name = "Alexander S. Kulikov"}, +# {name = "Daniil Averkov"}, +# {name = "Tatiana Belova"}, +# {name = "Gregory Emdin"}, +# {name = "Mikhail Goncharov"}, +# {name = "Viktoriia Krivogornitsyna"}, +# {name = "Fedor Kurmazov", email = "f.kurmazov.b@gmail.com"}, +# {name = "Daniil Levtsov"}, +# {name = "Georgie Levtsov"}, +# {name = "Vsevolod Vaskin"}, +# {name = "Aleksey Vorobiev"} ] maintainers = [ {name = "Fedor Kurmazov", email = "f.kurmazov.b@gmail.com"} From d683514d3a39d8ac4280acbf3f2691b8f39c94e5 Mon Sep 17 00:00:00 2001 From: spefk Date: Tue, 20 Jan 2026 20:41:01 +0300 Subject: [PATCH 26/33] fix --- CMakeLists.txt | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7866758..583ea61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,26 +26,10 @@ IF(NOT DISABLE_ABC_CEXT) add_subdirectory(third_party/abc) - # Prevent ABC from forcing -fno-exceptions/-fno-rtti onto dependents (pybind11 needs exceptions) - get_target_property(_abc_pic_interface_opts libabc-pic INTERFACE_COMPILE_OPTIONS) - if(_abc_pic_interface_opts) - list(REMOVE_ITEM _abc_pic_interface_opts -fno-exceptions) - list(REMOVE_ITEM _abc_pic_interface_opts -fno-rtti) - set_property(TARGET libabc-pic PROPERTY INTERFACE_COMPILE_OPTIONS "${_abc_pic_interface_opts}") - endif() - - if(TARGET libabc) - get_target_property(_abc_interface_opts libabc INTERFACE_COMPILE_OPTIONS) - if(_abc_interface_opts) - list(REMOVE_ITEM _abc_interface_opts -fno-exceptions) - list(REMOVE_ITEM _abc_interface_opts -fno-rtti) - set_property(TARGET libabc PROPERTY INTERFACE_COMPILE_OPTIONS "${_abc_interface_opts}") - endif() - endif() - pybind11_add_module(abc_wrapper extensions/abc_wrapper/src/module.cpp) target_link_libraries(abc_wrapper PRIVATE libabc-pic) target_include_directories(abc_wrapper PRIVATE third_party) + # Fixes case in CI, when ABC compilation # fails with "#error unknown platform" on # macos runners (both intel and apple silicon). From f3877e0f1db64a2c9d01c2695bace056804e1e26 Mon Sep 17 00:00:00 2001 From: spefk Date: Tue, 20 Jan 2026 20:56:58 +0300 Subject: [PATCH 27/33] fix --- .github/workflows/build_wheels.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yaml b/.github/workflows/build_wheels.yaml index b5c38d0..bb221e4 100644 --- a/.github/workflows/build_wheels.yaml +++ b/.github/workflows/build_wheels.yaml @@ -5,7 +5,6 @@ on: workflow_dispatch jobs: build_wheels: name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -20,6 +19,14 @@ jobs: macos_deploy_target: "11.0" - os: windows-latest cibw_archs_macos: "" + + runs-on: ${{ matrix.os }} + + # To use bash commands syntax on Windows. + defaults: + run: + shell: bash + steps: - uses: actions/checkout@v5 with: From b863730cf24d3dc1331624925e236b9615abc0c7 Mon Sep 17 00:00:00 2001 From: spefk Date: Tue, 20 Jan 2026 21:10:51 +0300 Subject: [PATCH 28/33] fix --- .github/workflows/build_wheels.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yaml b/.github/workflows/build_wheels.yaml index bb221e4..3805e21 100644 --- a/.github/workflows/build_wheels.yaml +++ b/.github/workflows/build_wheels.yaml @@ -39,14 +39,18 @@ jobs: CIBW_BUILD: "cp3{9,10,11,12,13}-*" CIBW_BUILD_FRONTEND: "pip" CIBW_BUILD_VERBOSITY: "2" + # win32 conflicts with mockturtle + # "...conversion from '_Ty2' to 'size_t' requires a narrowing conversion..." + CIBW_SKIP: "*-win32" CIBW_ARCHS_MACOS: ${{ matrix.cibw_archs_macos }} + CIBW_ARCHS_WINDOWS: "AMD64" CIBW_ENVIRONMENT_MACOS: >- MACOSX_DEPLOYMENT_TARGET=${{ matrix.macos_deploy_target }} CMAKE_ARGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.macos_deploy_target }}" CIBW_BEFORE_ALL_MACOS: "HOMEBREW_NO_AUTO_UPDATE=1 brew install ninja readline" CIBW_BEFORE_ALL_LINUX: "yum install -y ninja-build; python -m pip install ninja" CIBW_TEST_REQUIRES: pytest mock - CIBW_TEST_COMMAND: pytest -m 'not manual' {package}/tests + CIBW_TEST_COMMAND: pytest -m "not manual" {package}/tests CIBW_TEST_SKIP: "*-musllinux_*" with: package-dir: . From cac3753652f8c1bb16cfedeca13b3b5d2351d74e Mon Sep 17 00:00:00 2001 From: spefk Date: Wed, 21 Jan 2026 20:22:22 +0300 Subject: [PATCH 29/33] fix --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 583ea61..c35ab97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,14 @@ IF(NOT DISABLE_ABC_CEXT) endif() endif() + if (MSVC) + # Fixes Windows build: `pthreads-win32` tried to redefine `timespec`. + target_compile_definitions(libabc-pic PRIVATE HAVE_STRUCT_TIMESPEC=1) + if(TARGET libabc) + target_compile_definitions(libabc PRIVATE HAVE_STRUCT_TIMESPEC=1) + endif() + endif() + # Fixes pybing11 build errors when exceptions are not defined. target_compile_options(abc_wrapper PRIVATE -fexceptions -frtti) ENDIF(NOT DISABLE_ABC_CEXT) From f1a68d36eb1903cb2c9b5c8ac6b61d9fef8d0a4d Mon Sep 17 00:00:00 2001 From: spefk Date: Wed, 21 Jan 2026 23:47:02 +0300 Subject: [PATCH 30/33] bump abc --- third_party/abc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/abc b/third_party/abc index 037971d..8e93af4 160000 --- a/third_party/abc +++ b/third_party/abc @@ -1 +1 @@ -Subproject commit 037971d9c9aff5dffb6260a844023b9634a50e13 +Subproject commit 8e93af4589c5bfe5bbc5bcd25193208da9848d8a From 6911fe86532ff0c702df4bbd8aeb91be5b5c35a8 Mon Sep 17 00:00:00 2001 From: spefk Date: Thu, 22 Jan 2026 00:13:06 +0300 Subject: [PATCH 31/33] Revert "bump abc" This reverts commit f1a68d36eb1903cb2c9b5c8ac6b61d9fef8d0a4d. --- third_party/abc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/abc b/third_party/abc index 8e93af4..037971d 160000 --- a/third_party/abc +++ b/third_party/abc @@ -1 +1 @@ -Subproject commit 8e93af4589c5bfe5bbc5bcd25193208da9848d8a +Subproject commit 037971d9c9aff5dffb6260a844023b9634a50e13 From b315586f6042c13ec7f2150876086709530f90dc Mon Sep 17 00:00:00 2001 From: spefk Date: Thu, 22 Jan 2026 00:13:24 +0300 Subject: [PATCH 32/33] fix data --- build.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.py b/build.py index c0bc272..7d132a2 100644 --- a/build.py +++ b/build.py @@ -156,4 +156,9 @@ def build(setup_kwargs): "ext_modules": ext_modules, "cmdclass": {"build_ext": CMakeBuild}, "zip_safe": False, + + "package_data": {"cirbo": ["data/**/*"]}, + # Strange option naming, but it actually disables + # *automatically* detected package data inclusion. + "include_package_data": False, }) From 98f4e85181c070b75ed7cc61f5143f19634f4f87 Mon Sep 17 00:00:00 2001 From: spefk Date: Thu, 22 Jan 2026 00:14:08 +0300 Subject: [PATCH 33/33] disable windows --- .github/workflows/build_wheels.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yaml b/.github/workflows/build_wheels.yaml index 3805e21..9a719ea 100644 --- a/.github/workflows/build_wheels.yaml +++ b/.github/workflows/build_wheels.yaml @@ -17,8 +17,9 @@ jobs: - os: macos-14 cibw_archs_macos: arm64 macos_deploy_target: "11.0" - - os: windows-latest - cibw_archs_macos: "" + # FIXME: troubles with ABC build, need proper investigation. +# - os: windows-latest +# cibw_archs_macos: "" runs-on: ${{ matrix.os }}