Coder Social home page Coder Social logo

boschmitt / tweedledum Goto Github PK

View Code? Open in Web Editor NEW
96.0 8.0 34.0 13.83 MB

C++17 Library for analysis, compilation/synthesis, and optimization of quantum circuits

License: MIT License

CMake 1.40% C++ 91.80% Python 6.30% C 0.49%
quantum-computing quantum optimization synthesis quantum-circuit quantum-compiler

tweedledum's Introduction

/!\ (Warning) If you have used tweedledum before: the master branch history is broken.
/!\ The new master branch is a completely rewrite of the library. The old version can be found
/!\ on **alpha** branch. (Sorry for the inconvenience!!---but it is for a great cause)

tweedledum is a library for synthesis, compilation, and optimization of quantum circuits. The library is written to be scalable up to problem sizes in which quantum circuits outperform classical ones. Also, it is meant to be used both independently and alongside established tools.

Its design is guided by three mantras:

  • Gotta run fast: execution-time performance is a priority.

  • Your compiler, your rules. You know better. At least, Tweedledum hopes so! The library provides a standard set of operators that can be easily extended (thanks to some type-erasure black magic). However, the library will leave your operators completely alone if you don't write passes that specifically manipulate them. Furthermore, Tweedledum will rarely take any decision in your behalf, i.e., it does not provide generic methods to optimize or synthesize circuits, you need to specifically call the algorithms you want.

  • Opinionated, but not stubborn. Many passes and synthesis algorithms have many configuration parameters. Tweedledum comes with reasonable defaults and curated opinions of what value such parameters should take. But in the end, it all up to you.

Corollary: Because of it's flexibility, Tweedledum is capable of accepting gates/operators that are defined as python classes. Indeed, any pythonic framework can use the library as a circuit manager. Meaning that the library can be used to slowly transition the core and performance sensitive parts of a pythonic framework to C++, while maintaining the capability of users to develop passes in python.

Installation

Known issues with macOS High Sierra (10.13) and macOS Mojave (10.14).

tweedledum has two python packages that can be installed using pip. For both, you will at least Python 3.6. The tweedledum package contains the latest stable release. You can install it from PyPI using:

  • Latest stable release (Linux/Mac/Windows)
pip install tweedledum

For the developers, users or researchers who are comfortable living on the absolute bleeding edge, tweedledum-dev contains that latest developments merged into the master branch.

  • Latest (Linux/Mac/Windows)
pip install tweedledum-dev

Warning: The two packages cannot be installed together.

Installation from source (Development)

Installing tweedledum from the source, instead of using the Python Package Index (PyPI) repository version, allows you to extend the latest version of the code. In the following, I will explain two workflows I personally use for development. Choose one that best suits your needs.

Alright, both workflows start the same way. You clone the repository:

git clone https://github.com/boschmitt/tweedledum.git

C++

The first workflow is pure C++. We start by creating a directory to hold the build output:

mkdir build      
cd build

Note that the library has a directory named examples/. If we set the TWEEDLEDUM_EXAMPLES CMake variable to TRUE. Any .cpp file in this directory will be compiled to its own executable.

So, lets assume you have a file named hello_world.cpp in the examples/. First we configure our project and enable the examples:

cmake -DTWEEDLEDUM_EXAMPLES=TRUE ..

If you are on a *nix system, you should now see a Makefile in the current directory. Now you can build the library by running make. At this point you can build the hello_world executable by calling

make hello_world

Once the examples have been built you can run it:

./examples/hello_world

C++ and Python

The second workflow is a bit of a hack. In Python we can install libraries in editable mode, meaning that code changes to the Python code in the project don't require a reinstall to be applied.

If you want to install it in editable mode, you can do this with:

pip install -e .

The only problem now, is that if we change the C++ code, we will need to reinstall the library. Fortunately, there is a way to circumvent this annoyance.

After installing in editable mode, you will see that in python/tweedledum/ there is a cpython shared library _tweedledum.cpython-... Remove this file:

rm python/tweedledum/_tweedledum.cpython-...

Now, we create a build directory as we did with the C++ workflow:

mkdir build      
cd build

We can manually build the cpython shared library using:

make _tweedledum

This will create the library in the build/ directory. Now, all we need to create a symbolic link in python/tweedledum/ that points the library in build/:

ln -s _tweedledum.cpython-39-darwin.so ../python/tweedledum/

Now, whenever we change the C++ code and rebuild the python library, the changes won't require a reinstall of the library to be available.

Used third-party tools

The library it is built, tested, bind to python, and whatnot using many third-party tools and services. Thanks a lot!

  • abc - ABC: System for Sequential Logic Synthesis and Formal Verification
  • bill - C++ header-only reasoning library
  • Catch2 test framework for unit-tests, TDD and BDD
  • CMake for build automation
  • Eigen template library for linear algebra
  • {fmt} - A modern formatting library
  • kitty - truth table library
  • lorina - C++ parsing library for simple formats used in logic synthesis and formal verification
  • mockturtle - C++ logic network library
  • nlohmann/json - JSON for Modern C++
  • parallel_hashmap - A family of header-only, very fast and memory-friendly hashmap and btree containers.
  • percy - C++ header-only exact synthesis library
  • pybind11 - Seamless operability between C++11 and Python
  • rang - A Minimal, Header only Modern c++ library for terminal goodies

Known issues

These are issues that hopefully will be fixed, but currently are unsolved. If you know how to help with one of these issues, contributions are welcome!

macOS: High Sierra (10.13) and Mojave (10.14)

tweedledum offers limited support for both systems. While wheels might be available for some releases, it is strongly advised to install tweedledum or tweedledum-dev by building them directly from source. For example:

CC=gcc-10 CXX=g++-10 CXXFLAGS="-static-libgcc -static-libstdc++" pip install tweedledum --no-binary :all:

Note that such command requires a working gcc10 installation. (It also works with gcc11, but no further tests were made.) I recommend the use of Homebrew to install gcc. (Or maybe Tigerbrew)

License

This software is licensed under the MIT licence (see LICENSE).

EPFL logic synthesis libraries

tweedledum is part of the EPFL logic synthesis libraries. The other libraries and several examples on how to use and integrate the libraries can be found in the logic synthesis tool showcase.

tweedledum's People

Contributors

1ucian0 avatar cyc124 avatar drewrisinger avatar eendebakpt avatar mtreinish avatar paniash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tweedledum's Issues

Expand the IR to handle hierarchy

The current circuit representation is flat. Meaning that a circuit is simply a list of primitive gates.
It is necessary to implement higher level structures to handle gates (or sub-circuits) that might be defined by a user. Then I circuit could be a mixed list of primitive and user defined gates.

pip install fails

On a standard up-to-date Ubuntu 18 system:

python3.7 -m pip install tweedledum

    In file included from ../../../src/Parser/QASM/Lexer.h:8:0,
                     from ../../../src/Parser/QASM/Lexer.cpp:5:
    ../../../include/tweedledum/Utils/Source.h:8:10: fatal error: filesystem: No such file or directory
     #include <filesystem>
              ^~~~~~~~~~~~
    compilation terminated.

SWAP as gate primitive

It would be good to have SWAP as a gate primitive in the quantum circuit. Decomposition algorithms can then map it later into CNOTs, or CZ, or other circuits.

Push a release with python 3.9 wheels

Python 3.9 has been out for ~1 month now. It would be good if there was a tweedledum release that had a precompiled binary wheel with python 3.9. Looking at the CI setup for building and publishing wheels this will be done automatically on the next release since the latest cibuildwheel 1.6.x has support for 3.9 so it's just a matter of pushing a new release (or retriggering a build for the existing release).

Failure reading DIMACS files with 10 variables or more

Describe the bug

Reading DIMACS files fails with files having more than 10 variables from CNF.

Reproducible example code

main.cpp:

#include <lorina/common.hpp>
#include <tweedledum/Synthesis/pkrm_synth.h>
#include <kitty/dynamic_truth_table.hpp>
#include <mockturtle/networks/xag.hpp>
#include <mockturtle/io/dimacs_reader.hpp>
#include <tweedledum/Utils/Classical/xag_simulate.h>
#include <lorina/dimacs.hpp>

using namespace tweedledum;

int main()
{
  mockturtle::xag_network xag;
  lorina::return_code ret = lorina::read_dimacs("graphE.cnf", mockturtle::dimacs_reader(xag));
  if (ret != lorina::return_code::success)
    return 1;
  std::vector<kitty::dynamic_truth_table> truth_tables = xag_simulate(xag);
  Circuit circuit = pkrm_synth(truth_tables[0]);
  return 0;
}

graphE.cnf:

p cnf 12 31
1 2 3 0
4 5 6 0
7 8 9 0
10 11 12 0
-1 -2 0
-1 -3 0
-2 -3 0
-4 -5 0
-4 -6 0
-5 -6 0
-7 -8 0
-7 -9 0
-8 -9 0
-10 -11 0
-10 -12 0
-11 -12 0
-1 -4 0
-2 -5 0
-3 -6 0
-1 -7 0
-2 -8 0
-3 -9 0
-10 -1 0
-2 -11 0
-3 -12 0
-4 -7 0
-5 -8 0
-6 -9 0
-4 -10 0
-5 -11 0
-6 -12 0

Expected behavior

The DIMACS file is successfully read and the circuit is synthetized.

Information

  • tweedledum version: v1.1.1
  • Python version: v1.1.1
  • C++ compiler: 13.2.1
  • Operating system: Arch Linux

Additional context

Suggested fix for this issue:

diff --git a/external/lorina/lorina/dimacs.hpp b/external/lorina/lorina/dimacs.hpp
index dc44b9a..e8bd60f 100644
--- a/external/lorina/lorina/dimacs.hpp
+++ b/external/lorina/lorina/dimacs.hpp
@@ -99,7 +99,7 @@ public:
 namespace dimacs_regex
 {
 static std::regex problem_spec( R"(^p\s+([cd]nf)\s+([0-9]+)\s+([0-9]+)$)" );
-static std::regex clause( R"(((-?[1-9]+)+ +)+0)" );
+static std::regex clause( R"(((-?[1-9][0-9]*)+ +)+0)" );
 
 } // namespace dimacs_regex

Tests failing

On the travis CI it looks like tests are only being built (cmake -DTWEEDLEDUM_TESTS=on && make run_tests) but not run (./tests/run_tests). Travis sees this as success.

Locally, doing ./tests/run_tests is throwing the following errors:

$ ./tests/run_tests

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
run_tests is a Catch v2.7.0 host application.
Run with -? for options

-------------------------------------------------------------------------------
Decomposition based synthesis - gg_network<mcmt_gate>
  Synthesize PRIME(3) - spectrum
-------------------------------------------------------------------------------
/Users/mark.skilbeck/hackery/tweedledum/tests/algorithms/synthesis/dbs.cpp:25
...............................................................................

/Users/mark.skilbeck/hackery/tweedledum/tests/algorithms/synthesis/dbs.cpp:28: FAILED:
  CHECK( network.num_gates() == 48u )
with expansion:
  52 == 48

-------------------------------------------------------------------------------
Decomposition based synthesis - netlist<mcmt_gate>
  Synthesize PRIME(3) - spectrum
-------------------------------------------------------------------------------
/Users/mark.skilbeck/hackery/tweedledum/tests/algorithms/synthesis/dbs.cpp:25
...............................................................................

/Users/mark.skilbeck/hackery/tweedledum/tests/algorithms/synthesis/dbs.cpp:28: FAILED:
  CHECK( network.num_gates() == 48u )
with expansion:
  52 == 48

-------------------------------------------------------------------------------
Single-target gate synthesis - gg_network<mcmt_gate>
  Synthesize stg_from_spectrum
-------------------------------------------------------------------------------
/Users/mark.skilbeck/hackery/tweedledum/tests/algorithms/synthesis/stg.cpp:52
...............................................................................

/Users/mark.skilbeck/hackery/tweedledum/tests/algorithms/synthesis/stg.cpp:58: FAILED:
  CHECK( network.num_gates() == 185u )
with expansion:
  108 == 185

-------------------------------------------------------------------------------
Single-target gate synthesis - netlist<mcmt_gate>
  Synthesize stg_from_spectrum
-------------------------------------------------------------------------------
/Users/mark.skilbeck/hackery/tweedledum/tests/algorithms/synthesis/stg.cpp:52
...............................................................................

/Users/mark.skilbeck/hackery/tweedledum/tests/algorithms/synthesis/stg.cpp:58: FAILED:
  CHECK( network.num_gates() == 185u )
with expansion:
  108 == 185

===============================================================================
test cases:    60 |    56 passed | 4 failed
assertions: 15675 | 15671 passed | 4 failed

Build failure of tests (catch2) with gcc 10.3.0, glibc 2.34

Describe the bug

Error on certain build systems when building tests (catch2.hpp): MINSIGSTKSZ is not constexpr.

Error Log

[55/102] Building CXX object tests/CMakeFiles/run_tests.dir/run_tests.cpp.o
FAILED: tests/CMakeFiles/run_tests.dir/run_tests.cpp.o 
/nix/store/4ybkncn05qbhgbdxg9sxdgpm1jpdx76w-gcc-wrapper-10.3.0/bin/g++ -DABC_NAMESPACE=pabc -DABC_NO_USE_READLINE -DDISABLE_NAUTY -DFMT_HEADER_ONLY=1 -DLIN64 -DTEST_QASM_DIR=\"/build/source/tests/qasm\" -I/build/source/tests/catch2 -I/build/source/include -I/build/source/external/abcsat -I/build/source/external/abcesop -I/build/source/external/abcresub -isystem /build/source/external/eigen -isystem /build/source/external/fmt/include -isystem /build/source/external/mockturtle -isystem /build/source/external/kitty -isystem /build/source/external/lorina -isystem /build/source/external/rang -isystem /build/source/external/parallel_hashmap -isystem /build/source/external/percy -isystem /build/source/external/bill -O3 -DNDEBUG -std=gnu++17 -MD -MT tests/CMakeFiles/run_tests.dir/run_tests.cpp.o -MF tests/CMakeFiles/run_tests.dir/run_tests.cpp.o.d -o tests/CMakeFiles/run_tests.dir/run_tests.cpp.o -c /build/source/tests/run_tests.cpp
In file included from /nix/store/l1cds4dpaad47f1n6jwzva2sn1dzdn6a-glibc-2.34-115-dev/include/signal.h:328,
                 from /build/source/tests/catch2/catch.hpp:8034,
                 from /build/source/tests/run_tests.cpp:8:
/build/source/tests/catch2/catch.hpp:10822:58: error: call to non-'constexpr' function 'long int sysconf(int)'
10822 |     static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
      |                                                          ^~~~~~~~~~~
In file included from /nix/store/l1cds4dpaad47f1n6jwzva2sn1dzdn6a-glibc-2.34-115-dev/include/bits/sigstksz.h:24,
                 from /nix/store/l1cds4dpaad47f1n6jwzva2sn1dzdn6a-glibc-2.34-115-dev/include/signal.h:328,
                 from /build/source/tests/catch2/catch.hpp:8034,
                 from /build/source/tests/run_tests.cpp:8:
/nix/store/l1cds4dpaad47f1n6jwzva2sn1dzdn6a-glibc-2.34-115-dev/include/unistd.h:640:17: note: 'long int sysconf(int)' declared here
  640 | extern long int sysconf (int __name) __THROW;
      |                 ^~~~~~~
In file included from /build/source/tests/run_tests.cpp:8:
/build/source/tests/catch2/catch.hpp:10881:45: error: size of array 'altStackMem' is not an integral constant-expression
10881 |     char FatalConditionHandler::altStackMem[sigStackSize] = {};
      |                                             ^~~~~~~~~~~~

Expected behavior

Build should pass.

Information

  • tweedledum version: 1.1.1
  • C++ compiler: GCC 10.3.0, glibc 2.34-115
  • Operating system: Linux (WSL Ubuntu), but confirmed on multiple PCs.

Debugging

Traced bug to

static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
.
When comparing against upstream catch2, this line was removed in May 2021, see catchorg/Catch2@c0d0a50
Bugfix should basically just be applying the patch from catchorg/Catch2@c0d0a50

Make extending the set of primitive gates easier.

The current set of primitive gates can be found at: include/tweedledum/ir/gate_lib.def.

Ideally, adding a new gate to tweedledum would require just modifying this file. This, however, is really far from the current reality! Indeed, adding a new gate is an annoying task. There are too many places of the code that must be modified and things are not really intuitive.

Unable to pip install -- invalid pyproject.toml configuration

Describe the bug

Running pip install tweedledum yields the following output:

Collecting tweedledum
  Downloading tweedledum-1.1.1.tar.gz (4.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.8/4.8 MB 3.7 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [35 lines of output]
      Traceback (most recent call last):
        File "C:\\Users\\...", line 353, in <module>
          main()
        File "C:\\Users\\...", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\\Users\\...", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\\Users\\...", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\\Users\\...", line 295, in _get_build_requires
          self.run_setup()
        File "C:\\Users\\...", line 480, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "C:\\Users\\...", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 27, in <module>
        File "C:\\Users\\...", line 488, in setup
          ) = _parse_setuptools_arguments(kw)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\\Users\\...", line 221, in _parse_setuptools_arguments
          dist.parse_config_files()
        File "C:\\Users\\...", line 627, in parse_config_files
          pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
        File "C:\\Users\\...", line 66, in apply_configuration
          config = read_configuration(filepath, True, ignore_option_errors, dist)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\\Users\\...", line 127, in read_configuration
          validate(subset, filepath)
        File "C:\\Users\\...", line 55, in validate
          raise ValueError(f"{error}\n{summary}") from None
      ValueError: invalid pyproject.toml config: `project`.
      configuration error: `project` must contain ['name'] properties
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.


Expected behavior

Successful install.

Information

  • tweedledum version: 1.1.1
  • Python version: 3.11.1
  • Operating system: Windows 11

Add support for python dimacs reader in memory

Is your feature request related to a problem? Please describe.

Currently the read_dimacs_file method exposed through the python api requires a file path and works by opening the file. This puts an unnecessary constraint when using the api to write out a file to disk especially if the string is constructed in python this just seems unecessary.

Describe the solution you'd like

The dimacs parser being used supports passing in a dimacs file as an std::istream: https://lorina.readthedocs.io/en/latest/dimacs.html#_CPPv4N6lorina11read_dimacsERNSt7istreamERK13dimacs_readerP17diagnostic_engine

we can expose this via the python interface as a file like object (not sure how that connects with pybind11 but there should be a way). Ideally the interface would take either a file like object like a file, BytesIO,or a raw string we can pass to this.

Describe alternatives you've considered

The other alternative is just in pure python, basically adds a method that takes a stream or string and dumps it to a temp file and then we pass the temp file path to the existing read_dimacs, but doing it this way would just be shifting the current workaround from external to tweedledum to internal.

Additional context

CMake: doesn't install anything if -DTWEEDLEDUM_PYBINDS=OFF

Nothing is installed if the CMake flag -DTWEEDLEDUM_PYBINDS=OFF. (i.e. make install does nothing after configuring & building).

I'm not the most well-versed in CMake/C++ library building, but it seems to me that at least the *.so should be installed if the python bindings are not installed.

Relevant code:

if(TWEEDLEDUM_PYBINDS)
pybind11_add_module(_tweedledum MODULE)
target_include_directories(_tweedledum PRIVATE ${PROJECT_SOURCE_DIR}/include)
target_link_libraries(_tweedledum PRIVATE eigen fmt::fmt-header-only mockturtle ${CXX_FILESYSTEM_LIBRARIES})
add_subdirectory(python/tweedledum)
if(SKBUILD)
install(TARGETS _tweedledum LIBRARY DESTINATION python/tweedledum)
endif()
endif()
# Library
# =============================================================================
add_library(tweedledum OBJECT)
target_include_directories(tweedledum PUBLIC ${PROJECT_SOURCE_DIR}/include)
target_link_libraries(tweedledum PUBLIC eigen fmt::fmt-header-only mockturtle ${CXX_FILESYSTEM_LIBRARIES})
add_subdirectory(lib)

ability to specify a timeout on exact synthesis

Is your feature request related to a problem? Please describe.

It is hard to know apriori how long a SAT-based or A*-based synthesis will take.
Therefore a particular synthesis can get stuck for a long time, with no ability to skip it from e.g. an outer loop.

Describe the solution you'd like

A timeout argument could be used to cap the runtime, and raise a TimeoutError when it is hit. In that case the user can choose to fall back on heuristics.

Build fails with Python 3.11 because of outdated pybind11

Describe the bug

Building tweedledum-1.1.1 with Python 3.11 fails as follows:

[...]
/var/tmp/portage/dev-python/tweedledum-1.1.1-r1/work/tweedledum-1.1.1/external/pybind11/include/pybind11/pybind11.h:2296:18: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
 2296 |             frame->f_locals, PyTuple_GET_ITEM(frame->f_code->co_varnames, 0));
      |                  ^~
/usr/include/python3.11/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’}
   22 | typedef struct _frame PyFrameObject;
      |                ^~~~~~
In file included from /usr/include/python3.11/Python.h:38:
/var/tmp/portage/dev-python/tweedledum-1.1.1-r1/work/tweedledum-1.1.1/external/pybind11/include/pybind11/pybind11.h:2296:30: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
 2296 |             frame->f_locals, PyTuple_GET_ITEM(frame->f_code->co_varnames, 0));
      |                              ^~~~~~~~~~~~~~~~
/usr/include/python3.11/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’}
   22 | typedef struct _frame PyFrameObject;
      |                ^~~~~~
[30/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Decomposition/BarencoDecomposer.cpp.o
[31/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Parser/QASM/Parser.cpp.o
[32/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/Placer/ApprxSatPlacer.cpp.o
[33/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/Placer/SatPlacer.cpp.o
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/skbuild/setuptools_wrap.py", line 642, in setup
    cmkr.make(make_args, install_target=cmake_install_target, env=env)
  File "/usr/lib/python3.11/site-packages/skbuild/cmaker.py", line 679, in make
    self.make_impl(clargs=clargs, config=config, source_dir=source_dir, install_target=install_target, env=env)
  File "/usr/lib/python3.11/site-packages/skbuild/cmaker.py", line 710, in make_impl
    raise SKBuildError(

An error occurred while building with CMake.
  Command:
    /usr/bin/cmake --build . --target install --config Release -- -j 32
  Install target:
    install
  Source directory:
    /var/tmp/portage/dev-python/tweedledum-1.1.1-r1/work/tweedledum-1.1.1
  Working directory:
    /var/tmp/portage/dev-python/tweedledum-1.1.1-r1/work/tweedledum-1.1.1/_skbuild/linux-x86_64-3.11/cmake-build
Please check the install target is valid and see CMake's output for more information.
[EE] ERROR: dev-python/tweedledum-1.1.1-r1::gentoo failed (compile phase):

I think this is because the bundled copy of pybind11 is a bit stale.

Reproducible example code

/usr/bin/cmake /var/tmp/portage/dev-python/tweedledum-1.1.1-r1/work/tweedledum-1.1.1 -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=/var/tmp/portage/dev-python/tweedledum-1.1.1-r1/work/tweedledum-1.1.1/_skbuild/linux-x86_64-3.11/cmake-install/python -DPYTHON_VERSION_STRING:STRING=3.11.2 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/usr/lib/python3.11/site-packages/skbuild/resources/cmake -DPYTHON_EXECUTABLE:PATH=/usr/bin/python3.11 -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.11 -DPYTHON_LIBRARY:PATH=/usr/lib64/libpython3.11.so -DPython_EXECUTABLE:PATH=/usr/bin/python3.11 -DPython_ROOT_DIR:PATH=/usr -DPython_INCLUDE_DIR:PATH=/usr/include/python3.11 -DPython_FIND_REGISTRY:STRING=NEVER -DPython_NumPy_INCLUDE_DIRS:PATH=/usr/lib/python3.11/site-packages/numpy/core/include -DPython3_EXECUTABLE:PATH=/usr/bin/python3.11 -DPython3_ROOT_DIR:PATH=/usr -DPython3_INCLUDE_DIR:PATH=/usr/include/python3.11 -DPython3_FIND_REGISTRY:STRING=NEVER -DPython3_NumPy_INCLUDE_DIRS:PATH=/usr/lib/python3.11/site-packages/numpy/core/include -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_BUILD_TYPE=RelWithDebInfo
/usr/bin/cmake --build . --target install --config Release -- -j 32

Expected behavior

Successful build.

Information

  • tweedledum version: 1.1.1
  • Python version: Python 3.11.2
  • C++ compiler: GCC 12.2.1_p20230218
  • Operating system: Gentoo

Install Issue on m1 macs

Describe the bug

Does not install on m1 macs.

Reproducible example code

pip install tweedledum

Expected behavior

Successful installation.

Information

  • tweedledum version: Latest
  • Python version: Python 3.9.13
  • C++ compiler: NA
  • Operating system: MacOS 12.5.1 Monterey

Additional context

I got this issue while installing qiskit which depends on tweedledum.

I can confirm that pip install tweedledum==1.1.0 works but pip install tweedledum doesn't.

(base)  ~/Downloads/ pip install tweedledum
Collecting tweedledum
  Using cached tweedledum-1.1.1.tar.gz (4.8 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: tweedledum
  Building wheel for tweedledum (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for tweedledum (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [282 lines of output]
      /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-build-env-7mx474op/overlay/lib/python3.9/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-build-env-7mx474op/overlay/lib/python3.9/site-packages/setuptools/config/pyprojecttoml.py:129: _InvalidFile: The given `pyproject.toml` file is invalid and would be ignored.
          !!


          ############################
          # Invalid `pyproject.toml` #
          ############################

          Any configurations in `pyproject.toml` will be ignored.
          Please note that future releases of setuptools will halt the build process
          if an invalid file is given.

          To prevent setuptools from considering `pyproject.toml` please
          DO NOT include the `[project]` or `[tool.setuptools]` tables in your file.


      !!

        if _skip_bad_config(project_table, orig_setuptools_table, dist):
      Not searching for unused variables given on the command line.
      -- The C compiler identification is AppleClang 13.1.6.13160021
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- The CXX compiler identification is AppleClang 13.1.6.13160021
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Configuring done
      -- Generating done
      -- Build files have been written to: /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/_cmake_test_compile/build
      -- The CXX compiler identification is AppleClang 13.1.6.13160021
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Found PkgConfig: /opt/homebrew/bin/pkg-config (found version "0.29.2")
      -- Found Eigen3: /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/external/eigen (found suitable version "3.4.0", minimum required is "3.3")
      -- Found fmt: /opt/homebrew/include (found suitable version "9.1.0", minimum required is "7.0.0")
      -- Found nlohmann_json: /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/external/nlohmann (found suitable version "3.9.1", minimum required is "3.9.0")
      -- Found phmap: /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/external/parallel_hashmap (found suitable version "1.0.0", minimum required is "1.0.0")
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
      -- Found Threads: TRUE
      -- pybind11 v2.6.2
      CMake Warning (dev) at /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-build-env-7mx474op/overlay/lib/python3.9/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.24/Modules/CMakeDependentOption.cmake:89 (message):
        Policy CMP0127 is not set: cmake_dependent_option() supports full Condition
        Syntax.  Run "cmake --help-policy CMP0127" for policy details.  Use the
        cmake_policy command to set the policy and suppress this warning.
      Call Stack (most recent call first):
        external/pybind11/CMakeLists.txt:98 (cmake_dependent_option)
      This warning is for project developers.  Use -Wno-dev to suppress it.

      -- Found PythonInterp: /Users/thisas/miniforge3/bin/python3.9 (found version "3.9.13")
      -- Found PythonLibs: /Users/thisas/miniforge3/lib/libpython3.9.dylib
      -- Performing Test HAS_FLTO
      -- Performing Test HAS_FLTO - Success
      -- Performing Test HAS_FLTO_THIN
      -- Performing Test HAS_FLTO_THIN - Success
      -- Configuring done
      -- Generating done
      CMake Warning:
        Manually-specified variables were not used by the project:

          Python3_EXECUTABLE
          Python3_INCLUDE_DIR
          Python3_LIBRARY
          Python_EXECUTABLE
          Python_INCLUDE_DIR
          Python_LIBRARY


      -- Build files have been written to: /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/_skbuild/macosx-12.0-arm64-3.9/cmake-build
      [1/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/classical/kitty.cpp.o
      [2/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/ir/wires.cpp.o
      [3/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/bindings.cpp.o
      [4/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/operators/meta.cpp.o
      [5/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/operators/ising.cpp.o
      [6/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/operators/extension.cpp.o
      [7/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/ir/instruction.cpp.o
      [8/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Parser/QASM/Lexer.cpp.o
      [9/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/target/mapping.cpp.o
      [10/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/utils/utils.cpp.o
      [11/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/ir/circuit.cpp.o
      /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/python/tweedledum/ir/circuit.cpp:86:35: warning: 'size' is deprecated: Use num_instructions(). [-Wdeprecated-declarations]
              .def("__len__", &Circuit::size)
                                        ^
      /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/include/tweedledum/Utils/Visualization/../../IR/Circuit.h:41:7: note: 'size' has been explicitly marked deprecated here
          [[deprecated("Use num_instructions().")]]
            ^
      1 warning generated.
      [12/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/target/device.cpp.o
      [13/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/operators/standard.cpp.o
      [14/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Parser/qasm.cpp.o
      [15/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Parser/QASM/Parser.cpp.o
      [16/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Parser/tfc.cpp.o
      [17/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Decomposition/BridgeDecomposer.cpp.o
      [18/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Decomposition/ParityDecomposer.cpp.o
      [19/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Decomposition/barenco_decomp.cpp.o
      [20/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/classical/mockturtle.cpp.o
      /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/python/tweedledum/classical/mockturtle.cpp:54:9: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]
              lorina::read_aiger(filename, aiger_reader(xag));
              ^~~~~~~~~~~~~~~~~~
      /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/python/tweedledum/classical/mockturtle.cpp:60:9: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]
              lorina::read_dimacs(filename, dimacs_reader(xag));
              ^~~~~~~~~~~~~~~~~~~
      /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/python/tweedledum/classical/mockturtle.cpp:66:9: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]
              lorina::read_verilog(filename, verilog_reader(xag));
              ^~~~~~~~~~~~~~~~~~~~
      3 warnings generated.
      [21/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/passes/passes.cpp.o
      [22/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Decomposition/BarencoDecomposer.cpp.o
      [23/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Decomposition/bridge_decomp.cpp.o
      [24/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Decomposition/OneQubitDecomposer.cpp.o
      [25/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Decomposition/parity_decomp.cpp.o
      [26/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Decomposition/one_qubit_decomp.cpp.o
      [27/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/Placer/LinePlacer.cpp.o
      [28/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/Placer/RandomPlacer.cpp.o
      [29/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/Placer/TrivialPlacer.cpp.o
      [30/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/synthesis/synthesis.cpp.o
      [31/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/Placer/ApprxSatPlacer.cpp.o
      [32/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/Placer/SatPlacer.cpp.o
      [33/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Optimization/gate_cancellation.cpp.o
      [34/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/RePlacer/JitRePlacer.cpp.o
      [35/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/RePlacer/SabreRePlacer.cpp.o
      [36/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/classical/utils.cpp.o
      [37/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Optimization/linear_resynth.cpp.o
      [38/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/Router/BridgeRouter.cpp.o
      [39/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Optimization/steiner_resynth.cpp.o
      [40/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Optimization/phase_folding.cpp.o
      [41/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/Router/JitRouter.cpp.o
      [42/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/Router/SabreRouter.cpp.o
      [43/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/all_linear_synth.cpp.o
      [44/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/a_star_swap_synth.cpp.o
      [45/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/xag/xag_synth.cpp.o
      [46/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/decomp_synth.cpp.o
      [47/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/diagonal_synth.cpp.o
      [48/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/cx_dihedral_synth.cpp.o
      [49/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/linear_synth.cpp.o
      [50/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/lhrs/lhrs_synth.cpp.o
      [51/73] Building CXX object external/abcesop/CMakeFiles/libabcesop.dir/exorBits.cpp.o
      [52/73] Building CXX object external/abcesop/CMakeFiles/libabcesop.dir/exor.cpp.o
      [53/73] Building CXX object external/abcesop/CMakeFiles/libabcesop.dir/exorCubes.cpp.o
      [54/73] Building CXX object external/abcesop/CMakeFiles/libabcesop.dir/exorLink.cpp.o
      [55/73] Building CXX object external/abcesop/CMakeFiles/libabcesop.dir/exorUtil.cpp.o
      [56/73] Building CXX object external/abcesop/CMakeFiles/libabcesop.dir/exorList.cpp.o
      [57/73] Linking CXX static library external/abcesop/liblibabcesop.a
      [58/73] Building CXX object external/abcsat/CMakeFiles/libabcsat.dir/AbcGlucose.cpp.o
      [59/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/gray_synth.cpp.o
      [60/73] Building CXX object external/abcsat/CMakeFiles/libabcsat.dir/SimpSolver.cpp.o
      [61/73] Building CXX object external/abcsat/CMakeFiles/libabcsat.dir/satStore.cpp.o
      [62/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Utils/Visualization/string_utf8.cpp.o
      FAILED: CMakeFiles/_tweedledum.dir/src/Utils/Visualization/string_utf8.cpp.o
      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DABC_NAMESPACE=pabc -DABC_NO_USE_READLINE -DDISABLE_NAUTY -DFMT_HEADER_ONLY=1 -DLIN64 -D_tweedledum_EXPORTS -I/private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/include -I/private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/external/abcsat -I/private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/external/abcesop -I/private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/external/abcresub -isystem /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/external/pybind11/include -isystem /Users/thisas/miniforge3/include/python3.9 -isystem /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/external/eigen -isystem /opt/homebrew/include -isystem /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/external/mockturtle -isystem /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/external/kitty -isystem /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/external/lorina -isystem /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/external/rang -isystem /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/external/parallel_hashmap -isystem /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/external/percy -isystem /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/external/nlohmann -isystem /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/external/bill -O3 -DNDEBUG -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -mmacosx-version-min=12.0 -fPIC -fvisibility=hidden -flto -std=gnu++17 -MD -MT CMakeFiles/_tweedledum.dir/src/Utils/Visualization/string_utf8.cpp.o -MF CMakeFiles/_tweedledum.dir/src/Utils/Visualization/string_utf8.cpp.o.d -o CMakeFiles/_tweedledum.dir/src/Utils/Visualization/string_utf8.cpp.o -c /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/src/Utils/Visualization/string_utf8.cpp
      /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/src/Utils/Visualization/string_utf8.cpp:328:15: error: no matching function for call to 'format'
                    fmt::format(U"{:>2}", wire - diagram.num_qubits());
                    ^~~~~~~~~~~
      /opt/homebrew/include/fmt/core.h:3204:31: note: candidate function [with T = <unsigned int>] not viable: no known conversion from 'const char32_t [6]' to 'format_string<unsigned int>' (aka 'basic_format_string<char, unsigned int>') for 1st argument
      FMT_NODISCARD FMT_INLINE auto format(format_string<T...> fmt, T&&... args)
                                    ^
      /opt/homebrew/include/fmt/format.h:4183:13: note: candidate template ignored: requirement 'detail::is_locale<char32_t [6], void>::value' was not satisfied [with Locale = char32_t [6], T = <>]
      inline auto format(const Locale& loc, format_string<T...> fmt, T&&... args)
                  ^
      /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/src/Utils/Visualization/string_utf8.cpp:327:34: error: no viable conversion from 'basic_string<char, char_traits<char>, allocator<char>>' to 'const basic_string<char32_t, char_traits<char32_t>, allocator<char32_t>>'
                  std::u32string const wire_label =
                                       ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:822:5: note: candidate constructor not viable: no known conversion from 'std::string' (aka 'basic_string<char, char_traits<char>, allocator<char>>') to 'const std::u32string &' for 1st argument
          basic_string(const basic_string& __str);
          ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:827:5: note: candidate constructor not viable: no known conversion from 'std::string' (aka 'basic_string<char, char_traits<char>, allocator<char>>') to 'std::u32string &&' for 1st argument
          basic_string(basic_string&& __str)
          ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:840:5: note: candidate constructor template not viable: no known conversion from 'std::string' (aka 'basic_string<char, char_traits<char>, allocator<char>>') to 'const char32_t *' for 1st argument
          basic_string(const _CharT* __s) : __r_(__default_init_tag(), __default_init_tag()) {
          ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:895:5: note: candidate constructor not viable: no known conversion from 'std::string' (aka 'basic_string<char, char_traits<char>, allocator<char>>') to 'initializer_list<char32_t>' for 1st argument
          basic_string(initializer_list<_CharT> __il);
          ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:815:40: note: explicit constructor is not a candidate
          _LIBCPP_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a)
                                             ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:881:18: note: explicit constructor is not a candidate
              explicit basic_string(const _Tp& __t);
                       ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:903:5: note: candidate function
          operator __self_view() const _NOEXCEPT { return __self_view(data(), size()); }
          ^
      /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/src/Utils/Visualization/string_utf8.cpp:424:11: error: no matching function for call to 'format'
                fmt::format(U"{:>2}", wires_.back() - diagram.num_qubits());
                ^~~~~~~~~~~
      /opt/homebrew/include/fmt/core.h:3204:31: note: candidate function [with T = <unsigned int>] not viable: no known conversion from 'const char32_t [6]' to 'format_string<unsigned int>' (aka 'basic_format_string<char, unsigned int>') for 1st argument
      FMT_NODISCARD FMT_INLINE auto format(format_string<T...> fmt, T&&... args)
                                    ^
      /opt/homebrew/include/fmt/format.h:4183:13: note: candidate template ignored: requirement 'detail::is_locale<char32_t [6], void>::value' was not satisfied [with Locale = char32_t [6], T = <>]
      inline auto format(const Locale& loc, format_string<T...> fmt, T&&... args)
                  ^
      /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/src/Utils/Visualization/string_utf8.cpp:423:30: error: no viable conversion from 'basic_string<char, char_traits<char>, allocator<char>>' to 'const basic_string<char32_t, char_traits<char32_t>, allocator<char32_t>>'
              std::u32string const wire_label =
                                   ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:822:5: note: candidate constructor not viable: no known conversion from 'std::string' (aka 'basic_string<char, char_traits<char>, allocator<char>>') to 'const std::u32string &' for 1st argument
          basic_string(const basic_string& __str);
          ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:827:5: note: candidate constructor not viable: no known conversion from 'std::string' (aka 'basic_string<char, char_traits<char>, allocator<char>>') to 'std::u32string &&' for 1st argument
          basic_string(basic_string&& __str)
          ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:840:5: note: candidate constructor template not viable: no known conversion from 'std::string' (aka 'basic_string<char, char_traits<char>, allocator<char>>') to 'const char32_t *' for 1st argument
          basic_string(const _CharT* __s) : __r_(__default_init_tag(), __default_init_tag()) {
          ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:895:5: note: candidate constructor not viable: no known conversion from 'std::string' (aka 'basic_string<char, char_traits<char>, allocator<char>>') to 'initializer_list<char32_t>' for 1st argument
          basic_string(initializer_list<_CharT> __il);
          ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:815:40: note: explicit constructor is not a candidate
          _LIBCPP_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a)
                                             ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:881:18: note: explicit constructor is not a candidate
              explicit basic_string(const _Tp& __t);
                       ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:903:5: note: candidate function
          operator __self_view() const _NOEXCEPT { return __self_view(data(), size()); }
          ^
      4 errors generated.
      [63/73] Building CXX object external/abcsat/CMakeFiles/libabcsat.dir/Glucose.cpp.o
      [64/73] Building CXX object external/abcsat/CMakeFiles/libabcsat.dir/satSolver.cpp.o
      [65/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Target/Device.cpp.o
      [66/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/pprm_synth.cpp.o
      [67/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/transform_synth.cpp.o
      [68/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/steiner_gauss_synth.cpp.o
      [69/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/spectrum_synth.cpp.o
      [70/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/pkrm_synth.cpp.o
      ninja: build stopped: subcommand failed.
        File "/private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-build-env-7mx474op/overlay/lib/python3.9/site-packages/skbuild/setuptools_wrap.py", line 645, in setup
          cmkr.make(make_args, install_target=cmake_install_target, env=env)
        File "/private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-build-env-7mx474op/overlay/lib/python3.9/site-packages/skbuild/cmaker.py", line 680, in make
          self.make_impl(clargs=clargs, config=config, source_dir=source_dir, install_target=install_target, env=env)
        File "/private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-build-env-7mx474op/overlay/lib/python3.9/site-packages/skbuild/cmaker.py", line 704, in make_impl
          raise SKBuildError(


      --------------------------------------------------------------------------------
      -- Trying "Ninja" generator
      --------------------------------
      ---------------------------
      ----------------------
      -----------------
      ------------
      -------
      --
      --
      -------
      ------------
      -----------------
      ----------------------
      ---------------------------
      --------------------------------
      -- Trying "Ninja" generator - success
      --------------------------------------------------------------------------------

      Configuring Project
        Working directory:
          /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/_skbuild/macosx-12.0-arm64-3.9/cmake-build
        Command:
          cmake /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1 -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=/private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/_skbuild/macosx-12.0-arm64-3.9/cmake-install/python -DPYTHON_VERSION_STRING:STRING=3.9.13 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-build-env-7mx474op/overlay/lib/python3.9/site-packages/skbuild/resources/cmake -DPython3_EXECUTABLE:FILEPATH=/Users/thisas/miniforge3/bin/python3.9 -DPython3_INCLUDE_DIR:PATH=/Users/thisas/miniforge3/include/python3.9 -DPython3_LIBRARY:PATH=/Users/thisas/miniforge3/lib/libpython3.9.dylib -DPython_EXECUTABLE:FILEPATH=/Users/thisas/miniforge3/bin/python3.9 -DPython_INCLUDE_DIR:PATH=/Users/thisas/miniforge3/include/python3.9 -DPython_LIBRARY:PATH=/Users/thisas/miniforge3/lib/libpython3.9.dylib -DPYTHON_EXECUTABLE:FILEPATH=/Users/thisas/miniforge3/bin/python3.9 -DPYTHON_INCLUDE_DIR:PATH=/Users/thisas/miniforge3/include/python3.9 -DPYTHON_LIBRARY:PATH=/Users/thisas/miniforge3/lib/libpython3.9.dylib -DCMAKE_MAKE_PROGRAM:FILEPATH=/private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-build-env-7mx474op/overlay/lib/python3.9/site-packages/ninja/data/bin/ninja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=12.0 -DCMAKE_OSX_ARCHITECTURES:STRING=arm64

      Traceback (most recent call last):

      An error occurred while building with CMake.
        Command:
          cmake --build . --target install --config Release --
        Install target:
          install
        Source directory:
          /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1
        Working directory:
          /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-ecsfj_0r/tweedledum_73fddbf973d0489580a9594f5ae33ec1/_skbuild/macosx-12.0-arm64-3.9/cmake-build
      Please check the install target is valid and see CMake's output for more information.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for tweedledum
Failed to build tweedledum
ERROR: Could not build wheels for tweedledum, which is required to install pyproject.toml-based projects

"license_file" will be deprecated 10/30/2023 (replaced with "license_files")

Is your feature request related to a problem? Please describe.

This pre-emptive feature request to avoid issues during future installations of tweedledum

Describe the solution you'd like

Not exactly sure what is needed to be don so that it doesn't break install during earlier versions of python, but imagine there is a way.

Describe alternatives you've considered

N/A

Additional context

The following appears during the installation of tweedledum:
The license_file parameter is deprecated, use license_files instead.
By 2023-Oct-30, you need to update your project and remove deprecated calls
or your builds will no longer be supported.
See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.

Building fails

Describe the bug

Cannot build the C++ library or the python package from source code.

Reproducible example code

Both

git clone https://github.com/boschmitt/tweedledum.git
cd tweedledum
mkdir build && cd build
cmake ..
make

and

git clone https://github.com/boschmitt/tweedledum.git
cd tweedledum
python setup.py build

fail to compile.

Information

  • tweedledum version: v1.1.1 and master branch
  • Python version: 3.10.1
  • C++ compiler: gcc 11.1.0
  • Operating system: Arch Linux

CMakeError.log
CMakeOutput.log

Import tweedledum failing on MacOS

Describe the bug

Whenever I'm trying to import something from the tweedledum module, it throws an ImportError.
e.g.
from tweedledum.classical import simulate
or
import tweedledum
fail with the following stacktrace-

>>> from tweedledum.classical import simulate
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/arihant/opt/anaconda3/envs/qiskit/lib/python3.8/site-packages/tweedledum/__init__.py", line 5, in <module>
    from ._tweedledum import *
ImportError: dlopen(/Users/arihant/opt/anaconda3/envs/qiskit/lib/python3.8/site-packages/tweedledum/_tweedledum.cpython-38-darwin.so, 2): Symbol not found: _aligned_alloc
  Referenced from: /Users/arihant/opt/anaconda3/envs/qiskit/lib/python3.8/site-packages/tweedledum/_tweedledum.cpython-38-darwin.so
  Expected in: /usr/lib/libSystem.B.dylib
 in /Users/arihant/opt/anaconda3/envs/qiskit/lib/python3.8/site-packages/tweedledum/_tweedledum.cpython-38-darwin.so

Expected behavior

The libraries get imported.

Information

  • tweedledum version: 1.1.0
  • Python version: 3.8.10
  • Operating system: MacOS Mojave Version 10.14.6 (18G8022)

Additional context

I'm running it from a conda environment - conda 4.10.1.(which I have tried re-installing to try fixing this)

EDIT: The same works on my windows machine, so might be a MacOS specific issue.

Tests fail: E ModuleNotFoundError: No module named 'pybind11_tests'

==================================================================================== test session starts =====================================================================================
platform freebsd13 -- Python 3.9.13, pytest-7.1.2, pluggy-1.0.0 -- /usr/local/bin/python3.9
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/disk-samsung/freebsd-ports/science/py-tweedledum/work-py39/tweedledum-1.1.1/.hypothesis/examples')
rootdir: /disk-samsung/freebsd-ports/science/py-tweedledum/work-py39/tweedledum-1.1.1
plugins: forked-1.4.0, hypothesis-6.53.0, xdist-2.5.0, cov-2.9.0, typeguard-2.13.3, mock-1.10.4
collected 0 items / 1 error                                                                                                                                                                  

=========================================================================================== ERRORS ===========================================================================================
_______________________________________________________________________________ ERROR collecting test session ________________________________________________________________________________
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1030: in _gcd_import
    ???
<frozen importlib._bootstrap>:1007: in _find_and_load
    ???
<frozen importlib._bootstrap>:986: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:680: in _load_unlocked
    ???
/usr/local/lib/python3.9/site-packages/_pytest/assertion/rewrite.py:168: in exec_module
    exec(co, module.__dict__)
external/pybind11/tests/conftest.py:19: in <module>
    import pybind11_tests  # noqa: F401
E   ModuleNotFoundError: No module named 'pybind11_tests'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
====================================================================================== 1 error in 2.77s ======================================================================================
*** Error code 2

Version: 1.1.1

Centralized configuration/parameters

Many of the implemented algorithms can be configured/parameterised. For each of those, I have implemented this weird *_params structs. I think it would be better to have a centralized configuration from which the algorithms would take the parameters. If a parameter is not defined, then it would use a default value.

Inefficient compilation of Fredkin gate (from permutation)

The Fredkin gate (CSWAP) can be decomposed into 7 CNOTs (Smolin, 1996). The following program produces 18 CNOTs. Am I misusing the library?

The code:

#include <iostream>
#include <tweedledum/gates/io3_gate.hpp>
#include <tweedledum/io/quil.hpp>
#include <tweedledum/networks/gg_network.hpp>
#include <tweedledum/algorithms/synthesis/stg.hpp>
#include <tweedledum/algorithms/synthesis/dbs.hpp>

int main(int argc, char** argv)
{
	(void) argc;
	(void) argv;
	using namespace tweedledum;

        std::vector<uint32_t> permutation{{0, 1, 2, 3, 4, 6, 5, 7}};
        auto network = dbs<gg_network<io3_gate>>(permutation, stg_from_spectrum());

        write_quil(network, std::cout);
        std::cout << "\n";
}

The output:

H 0
RZ(0.78539818525314331) 1
RZ(0.78539818525314331) 2
RZ(0.78539818525314331) 0
CNOT 1 0
RZ(-0.78539818525314331) 0
CNOT 2 0
RZ(0.78539818525314331) 0
CNOT 1 0
RZ(-0.78539818525314331) 0
CNOT 2 0
RZ(0.78539818525314331) 0
CNOT 1 2
RZ(-0.78539818525314331) 2
CNOT 1 2
RZ(0.78539818525314331) 2
H 0
H 1
RZ(0.78539818525314331) 0
RZ(0.78539818525314331) 2
RZ(0.78539818525314331) 1
CNOT 0 1
RZ(-0.78539818525314331) 1
CNOT 2 1
RZ(0.78539818525314331) 1
CNOT 0 1
RZ(-0.78539818525314331) 1
CNOT 2 1
RZ(0.78539818525314331) 1
CNOT 0 2
RZ(-0.78539818525314331) 2
CNOT 0 2
RZ(0.78539818525314331) 2
H 1
H 0
RZ(0.78539818525314331) 1
RZ(0.78539818525314331) 2
RZ(0.78539818525314331) 0
CNOT 1 0
RZ(-0.78539818525314331) 0
CNOT 2 0
RZ(0.78539818525314331) 0
CNOT 1 0
RZ(-0.78539818525314331) 0
CNOT 2 0
RZ(0.78539818525314331) 0
CNOT 1 2
RZ(-0.78539818525314331) 2
CNOT 1 2
RZ(0.78539818525314331) 2
H 0

including stg.hpp causes "error: non member named 'extract'"

This code

#include <iostream>
#include <tweedledum/gates/gate_set.hpp>
#include <tweedledum/gates/mcst_gate.hpp>
#include <tweedledum/io/write_unicode.hpp>
#include <tweedledum/io/quil.hpp>
#include <tweedledum/networks/netlist.hpp>
#include <tweedledum/algorithms/synthesis/dbs.hpp>
#include <tweedledum/algorithms/synthesis/stg.hpp>

int main(int argc, char** argv)
{
	(void) argc;
	(void) argv;
	using namespace tweedledum;

        std::vector<uint32_t> permutation{{0, 2, 3, 5, 7, 1, 4, 6}};
        auto network = dbs<netlist<mcst_gate>>(permutation, stg_from_spectrum());
}

causes the error

In file included from /Users/mark.skilbeck/hackery/tweedledum/examples/hello_world.cpp:13:
In file included from /Users/mark.skilbeck/hackery/tweedledum/include/tweedledum/algorithms/synthesis/stg.hpp:9:
/Users/mark.skilbeck/hackery/tweedledum/include/tweedledum/algorithms/synthesis/../../utils/parity_terms.hpp:65:37: error: no member named 'extract' in 'std::__1::unordered_map<unsigned int,
      tweedledum::angle, std::__1::hash<unsigned int>, std::__1::equal_to<unsigned int>, std::__1::allocator<std::__1::pair<const unsigned int, tweedledum::angle> > >'
                auto node_handle = term_to_angle_.extract(term);
                                   ~~~~~~~~~~~~~~ ^

I'm not much of a c++ hacker so any help debugging this would be greatly appreciated.

macOS 13 could not install tweedledum with CMake issue

Describe the bug

Could not install tweedledum with pip and macOS 13. (Python 3.10.5)

Reproducible example code

pip install tweedledum

Expected behavior

Collecting tweedledum
  Using cached tweedledum-1.1.1.tar.gz (4.8 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: tweedledum
  Building wheel for tweedledum (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for tweedledum (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [33 lines of output]
      /private/var/folders/7l/zgv8pj_d09d1_qm93p8tsc0h0000gn/T/pip-build-env-imba2oow/overlay/lib/python3.10/site-packages/setuptools/config/setupcfg.py:459: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      /private/var/folders/7l/zgv8pj_d09d1_qm93p8tsc0h0000gn/T/pip-build-env-imba2oow/overlay/lib/python3.10/site-packages/setuptools/config/pyprojecttoml.py:102: _ExperimentalProjectMetadata: Support for project metadata in `pyproject.toml` is still experimental and may be removed (or change) in future releases.
        warnings.warn(msg, _ExperimentalProjectMetadata)
      configuration error: `project` must contain ['name'] properties
      /private/var/folders/7l/zgv8pj_d09d1_qm93p8tsc0h0000gn/T/pip-build-env-imba2oow/overlay/lib/python3.10/site-packages/setuptools/config/pyprojecttoml.py:123: _InvalidFile: The given `pyproject.toml` file is invalid and would be ignored.
          !!
      
      
          ############################
          # Invalid `pyproject.toml` #
          ############################
      
          Any configurations in `pyproject.toml` will be ignored.
          Please note that future releases of setuptools will halt the build process
          if an invalid file is given.
      
          To prevent setuptools from considering `pyproject.toml` please
          DO NOT include the `[project]` or `[tool.setuptools]` tables in your file.
      
      
      !!
      
        if _skip_bad_config(project_table, orig_setuptools_table, dist):
        File "/private/var/folders/7l/zgv8pj_d09d1_qm93p8tsc0h0000gn/T/pip-build-env-imba2oow/overlay/lib/python3.10/site-packages/skbuild/setuptools_wrap.py", line 613, in setup
          cmkr = cmaker.CMaker(cmake_executable)
        File "/private/var/folders/7l/zgv8pj_d09d1_qm93p8tsc0h0000gn/T/pip-build-env-imba2oow/overlay/lib/python3.10/site-packages/skbuild/cmaker.py", line 141, in __init__
          self.cmake_version = get_cmake_version(self.cmake_executable)
        File "/private/var/folders/7l/zgv8pj_d09d1_qm93p8tsc0h0000gn/T/pip-build-env-imba2oow/overlay/lib/python3.10/site-packages/skbuild/cmaker.py", line 95, in get_cmake_version
          raise SKBuildError(
      Traceback (most recent call last):
      
      Problem with the CMake installation, aborting build. CMake executable is cmake
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for tweedledum
Failed to build tweedledum
ERROR: Could not build wheels for tweedledum, which is required to install pyproject.toml-based projects

Information

  • tweedledum version:
  • Python version: Python 3.10.5
  • C++ compiler:
  • Operating system: macOS 13 developer beta 1 (22A5266r)

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.