Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
5.26k stars 2.37k forks source link

M1 install issue due to tweedledum #8716

Closed The-Real-Thisas closed 2 years ago

The-Real-Thisas commented 2 years ago

What is the expected behaviour?

pip install qiskit

Should install qiskit but instead currently fails while trying to build tweedledum.

I'm hoping there could maybe be a m1 wheel available that circumvents this issue.

(base)  ~/Downloads/ pip install qiskit

Collecting qiskit
  Using cached qiskit-0.37.2-py3-none-any.whl
Collecting qiskit-terra==0.21.2
  Using cached qiskit_terra-0.21.2-cp39-cp39-macosx_11_0_arm64.whl (6.3 MB)
Collecting qiskit-aer==0.10.4
  Using cached qiskit_aer-0.10.4-cp39-cp39-macosx_11_0_arm64.whl (8.4 MB)
Collecting qiskit-ibmq-provider==0.19.2
  Using cached qiskit_ibmq_provider-0.19.2-py3-none-any.whl (240 kB)
Requirement already satisfied: numpy>=1.16.3 in /Users/thisas/miniforge3/lib/python3.9/site-packages (from qiskit-aer==0.10.4->qiskit) (1.22.4)
Requirement already satisfied: scipy>=1.0 in /Users/thisas/miniforge3/lib/python3.9/site-packages (from qiskit-aer==0.10.4->qiskit) (1.8.1)
Requirement already satisfied: requests>=2.19 in /Users/thisas/miniforge3/lib/python3.9/site-packages (from qiskit-ibmq-provider==0.19.2->qiskit) (2.28.1)
Collecting websockets>=10.0
  Using cached websockets-10.3-cp39-cp39-macosx_11_0_arm64.whl (97 kB)
Requirement already satisfied: urllib3>=1.21.1 in /Users/thisas/miniforge3/lib/python3.9/site-packages (from qiskit-ibmq-provider==0.19.2->qiskit) (1.26.11)
Collecting websocket-client>=1.0.1
  Using cached websocket_client-1.4.1-py3-none-any.whl (55 kB)
Collecting requests-ntlm>=1.1.0
  Using cached requests_ntlm-1.1.0-py2.py3-none-any.whl (5.7 kB)
Requirement already satisfied: python-dateutil>=2.8.0 in /Users/thisas/miniforge3/lib/python3.9/site-packages (from qiskit-ibmq-provider==0.19.2->qiskit) (2.8.2)
Collecting tweedledum<2.0,>=1.1
  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
Collecting symengine>=0.9
  Using cached symengine-0.9.2-cp39-cp39-macosx_11_0_arm64.whl (14.9 MB)
Collecting psutil>=5
  Using cached psutil-5.9.2-cp39-cp39-macosx_12_0_arm64.whl
Collecting ply>=3.10
  Using cached ply-3.11-py2.py3-none-any.whl (49 kB)
Collecting sympy>=1.3
  Using cached sympy-1.11.1-py3-none-any.whl (6.5 MB)
Collecting dill>=0.3
  Using cached dill-0.3.5.1-py2.py3-none-any.whl (95 kB)
Collecting retworkx>=0.11.0
  Using cached retworkx-0.11.0-cp39-cp39-macosx_11_0_arm64.whl (1.2 MB)
Collecting stevedore>=3.0.0
  Using cached stevedore-4.0.0-py3-none-any.whl (49 kB)
Requirement already satisfied: six>=1.5 in /Users/thisas/miniforge3/lib/python3.9/site-packages (from python-dateutil>=2.8.0->qiskit-ibmq-provider==0.19.2->qiskit) (1.16.0)
Requirement already satisfied: charset-normalizer<3,>=2 in /Users/thisas/miniforge3/lib/python3.9/site-packages (from requests>=2.19->qiskit-ibmq-provider==0.19.2->qiskit) (2.1.0)
Requirement already satisfied: certifi>=2017.4.17 in /Users/thisas/miniforge3/lib/python3.9/site-packages (from requests>=2.19->qiskit-ibmq-provider==0.19.2->qiskit) (2022.6.15)
Requirement already satisfied: idna<4,>=2.5 in /Users/thisas/miniforge3/lib/python3.9/site-packages (from requests>=2.19->qiskit-ibmq-provider==0.19.2->qiskit) (3.3)
Requirement already satisfied: cryptography>=1.3 in /Users/thisas/miniforge3/lib/python3.9/site-packages (from requests-ntlm>=1.1.0->qiskit-ibmq-provider==0.19.2->qiskit) (37.0.4)
Collecting ntlm-auth>=1.0.2
  Using cached ntlm_auth-1.5.0-py2.py3-none-any.whl (29 kB)
Collecting pbr!=2.1.0,>=2.0.0
  Using cached pbr-5.10.0-py2.py3-none-any.whl (112 kB)
Collecting mpmath>=0.19
  Using cached mpmath-1.2.1-py3-none-any.whl (532 kB)
Requirement already satisfied: cffi>=1.12 in /Users/thisas/miniforge3/lib/python3.9/site-packages (from cryptography>=1.3->requests-ntlm>=1.1.0->qiskit-ibmq-provider==0.19.2->qiskit) (1.15.1)
Requirement already satisfied: pycparser in /Users/thisas/miniforge3/lib/python3.9/site-packages (from cffi>=1.12->cryptography>=1.3->requests-ntlm>=1.1.0->qiskit-ibmq-provider==0.19.2->qiskit) (2.21)
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
  ╰─> [283 lines of output]
      /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-build-env-4n2392hp/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-4n2392hp/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-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/_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-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/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-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/external/nlohmann (found suitable version "3.9.1", minimum required is "3.9.0")
      -- Found phmap: /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/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-4n2392hp/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-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/_skbuild/macosx-12.0-arm64-3.9/cmake-build
      [1/73] Building CXX object external/abcesop/CMakeFiles/libabcesop.dir/exorCubes.cpp.o
      [2/73] Building CXX object external/abcesop/CMakeFiles/libabcesop.dir/exorUtil.cpp.o
      [3/73] Building CXX object external/abcesop/CMakeFiles/libabcesop.dir/exorBits.cpp.o
      [4/73] Building CXX object external/abcsat/CMakeFiles/libabcsat.dir/satStore.cpp.o
      [5/73] Building CXX object external/abcesop/CMakeFiles/libabcesop.dir/exorLink.cpp.o
      [6/73] Building CXX object external/abcesop/CMakeFiles/libabcesop.dir/exorList.cpp.o
      [7/73] Building CXX object external/abcsat/CMakeFiles/libabcsat.dir/AbcGlucose.cpp.o
      [8/73] Building CXX object external/abcesop/CMakeFiles/libabcesop.dir/exor.cpp.o
      [9/73] Linking CXX static library external/abcesop/liblibabcesop.a
      [10/73] Building CXX object external/abcsat/CMakeFiles/libabcsat.dir/SimpSolver.cpp.o
      [11/73] Building CXX object external/abcsat/CMakeFiles/libabcsat.dir/satSolver.cpp.o
      [12/73] Building CXX object external/abcsat/CMakeFiles/libabcsat.dir/Glucose.cpp.o
      [13/73] Linking CXX static library external/abcsat/liblibabcsat.a
      [14/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/classical/kitty.cpp.o
      [15/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/ir/wires.cpp.o
      [16/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/bindings.cpp.o
      [17/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/ir/instruction.cpp.o
      [18/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/operators/extension.cpp.o
      [19/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/operators/meta.cpp.o
      [20/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/operators/ising.cpp.o
      [21/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Parser/QASM/Lexer.cpp.o
      [22/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/target/mapping.cpp.o
      [23/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/ir/circuit.cpp.o
      /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/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-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/include/tweedledum/Utils/Visualization/../../IR/Circuit.h:41:7: note: 'size' has been explicitly marked deprecated here
          [[deprecated("Use num_instructions().")]]
            ^
      1 warning generated.
      [24/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/utils/utils.cpp.o
      [25/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/operators/standard.cpp.o
      [26/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/target/device.cpp.o
      [27/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Parser/QASM/Parser.cpp.o
      [28/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Parser/qasm.cpp.o
      [29/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Parser/tfc.cpp.o
      [30/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Decomposition/BridgeDecomposer.cpp.o
      [31/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/classical/mockturtle.cpp.o
      /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/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-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/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-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/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.
      [32/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Decomposition/ParityDecomposer.cpp.o
      [33/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Decomposition/barenco_decomp.cpp.o
      [34/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/passes/passes.cpp.o
      [35/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Decomposition/BarencoDecomposer.cpp.o
      [36/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Decomposition/OneQubitDecomposer.cpp.o
      [37/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Decomposition/bridge_decomp.cpp.o
      [38/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Decomposition/parity_decomp.cpp.o
      [39/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Decomposition/one_qubit_decomp.cpp.o
      [40/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/synthesis/synthesis.cpp.o
      [41/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/Placer/LinePlacer.cpp.o
      [42/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/Placer/RandomPlacer.cpp.o
      [43/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/Placer/TrivialPlacer.cpp.o
      [44/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/Placer/ApprxSatPlacer.cpp.o
      [45/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/Placer/SatPlacer.cpp.o
      [46/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Optimization/gate_cancellation.cpp.o
      [47/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/RePlacer/JitRePlacer.cpp.o
      [48/73] Building CXX object CMakeFiles/_tweedledum.dir/python/tweedledum/classical/utils.cpp.o
      [49/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/RePlacer/SabreRePlacer.cpp.o
      [50/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Optimization/linear_resynth.cpp.o
      [51/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/Router/BridgeRouter.cpp.o
      [52/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Optimization/steiner_resynth.cpp.o
      [53/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Optimization/phase_folding.cpp.o
      [54/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/Router/JitRouter.cpp.o
      [55/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Passes/Mapping/Router/SabreRouter.cpp.o
      [56/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/all_linear_synth.cpp.o
      [57/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/a_star_swap_synth.cpp.o
      [58/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/xag/xag_synth.cpp.o
      [59/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/decomp_synth.cpp.o
      [60/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/diagonal_synth.cpp.o
      [61/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/cx_dihedral_synth.cpp.o
      [62/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/lhrs/lhrs_synth.cpp.o
      [63/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/linear_synth.cpp.o
      [64/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/gray_synth.cpp.o
      [65/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-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/include -I/private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/external/abcsat -I/private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/external/abcesop -I/private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/external/abcresub -isystem /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/external/pybind11/include -isystem /Users/thisas/miniforge3/include/python3.9 -isystem /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/external/eigen -isystem /opt/homebrew/include -isystem /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/external/mockturtle -isystem /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/external/kitty -isystem /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/external/lorina -isystem /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/external/rang -isystem /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/external/parallel_hashmap -isystem /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/external/percy -isystem /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/external/nlohmann -isystem /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/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-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/src/Utils/Visualization/string_utf8.cpp
      /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/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-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/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-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/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-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/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.
      [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/Target/Device.cpp.o
      [69/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/steiner_gauss_synth.cpp.o
      [70/73] Building CXX object CMakeFiles/_tweedledum.dir/src/Synthesis/spectrum_synth.cpp.o
      [71/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-4n2392hp/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-4n2392hp/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-4n2392hp/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-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/_skbuild/macosx-12.0-arm64-3.9/cmake-build
        Command:
          cmake /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=/private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/_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-4n2392hp/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-4n2392hp/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-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f
        Working directory:
          /private/var/folders/z8/sp2w4vyj3q71z22h0hz0vxs00000gn/T/pip-install-w7llld42/tweedledum_90f313832451432ebe424ead43996e4f/_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
jakelishman commented 2 years ago

Thanks for the report. Ideally this is something you'd take up with tweedledum rather than us, but as far as I know, Bruno (the maintainer) has been rather busy recently, so you might not get a very prompt response. If we can't work out a solution, we might need to consider making tweedledum an optional dependency instead - we don't use it too much internally.

On a brief glance on its PyPI page, it looks like tweedledum has wheels released for M1 Mac for tweedledum 1.1.0, but not 1.1.1. Unfortunately, the changelog for 1.1.1 just says "fix wheels on macOS", so I'm guessing 1.1.0 is broken. Still, you could try pip install tweedledum==1.1.0 qiskit, and see if it works.

Paul (@nonhermitian): I don't have an M1 - do you know any more about what's necessary here, since I'd thought we'd solved the M1 issues?

nonhermitian commented 2 years ago

I tried installing it in a new conda env with --no-cache-dir and the 1.1.1 wheel built fine. This is on Py310

nonhermitian commented 2 years ago

To be clear, I have not had any M1 problems outside of openblas+scipy issues in recent memory.

The-Real-Thisas commented 2 years ago

@jakelishman Thanks for the prompt response. I can confirm that pip install tweedledum==1.1.0 qiskit installs on my machine. I agree and I'll start an issue on the tweedledum repo but for documentation purposes I recommend keeping this issue active until it gets resolved just so anyone trying to just pip install qiskit like I did will know what to do till a fix is implemented. I also suggest changing the tag from feature request to something more appropriate as I don't think I can change it myself. Thanks again for the quick response, appreciate it.

jakelishman commented 2 years ago

It's quite possible that the build requires having specific C compiler tooling and potentially various header files of C/Fortran libraries available on your system, which may be why you're struggling while other people haven't been. There's also the chance that a recent update to macOS broke stuff - I saw you're on the macOS-12.3 SDK - as Apple have a very annoying tendency to remove stuff from their header files.

Either way, as long as it's working for now, that's good. Hopefully tweedledum can take a look, and if not, we'll have to make a bigger plan on the Qiskit side.

The-Real-Thisas commented 2 years ago

@jakelishman You reckon it might be feasible to change the requirements to use tweedledum==1.1.0 specifically until the problem gets resolved on tweedledum's end. I assume that won't break anything for people on x86 and would mean new users on m1 can just use pip install qiskit without having to look up the issue. It's a bit of a hack but wondering if thats a possibility. If so I can start a pull just making that switch.

PS: Totally agree with you on the possible cause, in fact there are some known issues with certain macos versions where it's recommended just to build from source https://github.com/boschmitt/tweedledum#known-issues

nonhermitian commented 2 years ago

It is a fair question to ask why is it a requirement in the first place?

The-Real-Thisas commented 2 years ago

@nonhermitian I believe this may answer your question.

We rely on tweedledum to synthesize phase oracles which is commonly used functionality and several issues have been opened. This use of tweedledum will likely continue to grow so we should just list it as a requirement moving forward.

Source: https://github.com/Qiskit/qiskit-terra/commit/927fd0226bf7c7e4e4cd9434d612bd7bb4b05ecc

nonhermitian commented 2 years ago

Yeah I know the backstory, but disagree with that decision as I do not think that that functionality is used by many people at all. I personally have never had to use it, but have run into similar issues as this previously with the builds of tweedledum. There is no tutorial, and no demonstration of usage beyond a single code block in the documentation (the supp mat does not open for me). So I push back on the fact that this should be a requirement at all. If it is a hard requirement then I would expect more demonstrations of value than a single snippet.

jakelishman commented 2 years ago

From a Terra dev meeting today: we made the decision to move tweedledum to being an optional dependency. Terra 0.22, which will release in about a month, will still have it as a core requirement because we need to issue deprecation warnings, but it will be removed in 0.23.

In the mean time, I'll see if we can do anything about getting a macOS ARM wheel for tweedledum 1.1.1, and if not, I might be able to tweak the requirement so that only 1.1.0 is permitted for ARM macs.

mtreinish commented 2 years ago

FWIW, my normal suggestion in this case is to do something like pip install --prefer-binary tweedledum qiskit-terra which should install tweedledum from a precompiled binary along with terra.

@jakelishman environment markers are gonna be a bit tricky here, the easiest way would probably to have 2 entries in the requirements list something like:

tweedledum>=1.1,<2.0;platform_machine != 'arm64'  or sys_platform != 'darwin'
tweedledum>=1.1,<2.0,!=1.1.1;platform_machine == 'arm64' and sys_platform == 'darwin'
The-Real-Thisas commented 2 years ago

Thanks @jakelishman , do let me know how I could help.

BoltzmannEntropy commented 2 years ago

Hello, This is my setup:

Python 3.8.10 (default, Sep 30 2022, 09:53:07) 
[Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin
 ~ % uname -a 
Darwin mprox 21.5.0 Darwin Kernel Version 21.5.0: root:xnu-8020.121.3~4/RELEASE_ARM64_T6000 arm64

% ARCHFLAGS="-arch arm64" pip install tweedledum==1.0.0 qiskit --compile --no-cache-dir

I was able to install tweedledum for arm64, but none of the suggestions above worked for me regarding qiskit.

jakelishman commented 2 years ago

Qiskit needs tweedledum 1.1+, and your install line there has 1.0, which might be the issue, but without a full error message, I can't be sure. If you change that to 1.1.0 you might have some success. In the interim, while we need to wait for Terra 0.23 to remove the requirement entirely, I've made #8818 that will add the required constraint to Terra's install requirements, and should go out with Terra 0.22 early/mid next week.

croquemadame commented 2 years ago

Has this been taken care of already? I am having the same issue.

 % uname -a
Darwin interstellar 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000 arm64
% python3 --version                                                   
Python 3.10.7
 % python3 -m pip install qiskit --no-cache --upgrade --force-reinstall 
Collecting qiskit
  Downloading qiskit-0.38.0.tar.gz (13 kB)
  Preparing metadata (setup.py) ... done
Collecting qiskit-terra==0.21.2
  Downloading qiskit_terra-0.21.2-cp310-cp310-macosx_11_0_arm64.whl (6.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.3/6.3 MB 7.6 MB/s eta 0:00:00
Collecting qiskit-aer==0.11.0
  Downloading qiskit_aer-0.11.0-cp310-cp310-macosx_11_0_arm64.whl (8.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.5/8.5 MB 7.5 MB/s eta 0:00:00
Collecting qiskit-ibmq-provider==0.19.2
  Downloading qiskit_ibmq_provider-0.19.2-py3-none-any.whl (240 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 240.4/240.4 kB 7.7 MB/s eta 0:00:00
Collecting numpy>=1.16.3
  Downloading numpy-1.23.3-cp310-cp310-macosx_11_0_arm64.whl (13.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.3/13.3 MB 7.1 MB/s eta 0:00:00
Collecting scipy>=1.0
  Downloading scipy-1.9.1-cp310-cp310-macosx_12_0_arm64.whl (29.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 29.9/29.9 MB 7.7 MB/s eta 0:00:00
Collecting python-dateutil>=2.8.0
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 kB 8.5 MB/s eta 0:00:00
Collecting websocket-client>=1.0.1
  Downloading websocket_client-1.4.1-py3-none-any.whl (55 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 55.0/55.0 kB 235.7 MB/s eta 0:00:00
Collecting urllib3>=1.21.1
  Downloading urllib3-1.26.12-py2.py3-none-any.whl (140 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.4/140.4 kB 8.5 MB/s eta 0:00:00
Collecting websockets>=10.0
  Downloading websockets-10.3-cp310-cp310-macosx_11_0_arm64.whl (97 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.3/97.3 kB 5.4 MB/s eta 0:00:00
Collecting requests>=2.19
  Downloading requests-2.28.1-py3-none-any.whl (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 kB 12.9 MB/s eta 0:00:00
Collecting requests-ntlm>=1.1.0
  Downloading requests_ntlm-1.1.0-py2.py3-none-any.whl (5.7 kB)
Collecting symengine>=0.9
  Downloading symengine-0.9.2-cp310-cp310-macosx_11_0_arm64.whl (14.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.9/14.9 MB 7.8 MB/s eta 0:00:00
Collecting retworkx>=0.11.0
  Downloading retworkx-0.11.0-cp310-cp310-macosx_11_0_arm64.whl (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 7.4 MB/s eta 0:00:00
Collecting psutil>=5
  Downloading psutil-5.9.2.tar.gz (479 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 479.8/479.8 kB 9.1 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting ply>=3.10
  Downloading ply-3.11-py2.py3-none-any.whl (49 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 49.6/49.6 kB 23.9 MB/s eta 0:00:00
Collecting stevedore>=3.0.0
  Downloading stevedore-4.0.0-py3-none-any.whl (49 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 49.5/49.5 kB 34.2 MB/s eta 0:00:00
Collecting dill>=0.3
  Downloading dill-0.3.5.1-py2.py3-none-any.whl (95 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 95.8/95.8 kB 11.6 MB/s eta 0:00:00
Collecting sympy>=1.3
  Downloading sympy-1.11.1-py3-none-any.whl (6.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.5/6.5 MB 7.3 MB/s eta 0:00:00
Collecting tweedledum<2.0,>=1.1
  Downloading tweedledum-1.1.1.tar.gz (4.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.8/4.8 MB 8.1 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting six>=1.5
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting certifi>=2017.4.17
  Downloading certifi-2022.9.24-py3-none-any.whl (161 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 161.1/161.1 kB 8.1 MB/s eta 0:00:00
Collecting charset-normalizer<3,>=2
  Downloading charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Collecting idna<4,>=2.5
  Downloading idna-3.4-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 kB 16.0 MB/s eta 0:00:00
Collecting ntlm-auth>=1.0.2
  Downloading ntlm_auth-1.5.0-py2.py3-none-any.whl (29 kB)
Collecting cryptography>=1.3
  Downloading cryptography-38.0.1-cp36-abi3-macosx_10_10_universal2.whl (5.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.3/5.3 MB 7.9 MB/s eta 0:00:00
Collecting pbr!=2.1.0,>=2.0.0
  Downloading pbr-5.10.0-py2.py3-none-any.whl (112 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 112.4/112.4 kB 8.4 MB/s eta 0:00:00
Collecting mpmath>=0.19
  Downloading mpmath-1.2.1-py3-none-any.whl (532 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 532.6/532.6 kB 11.0 MB/s eta 0:00:00
Collecting cffi>=1.12
  Downloading cffi-1.15.1-cp310-cp310-macosx_11_0_arm64.whl (174 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 174.3/174.3 kB 10.3 MB/s eta 0:00:00
Collecting pycparser
  Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 kB 13.0 MB/s eta 0:00:00
Building wheels for collected packages: qiskit, psutil, tweedledum
  Building wheel for qiskit (setup.py) ... done
  Created wheel for qiskit: filename=qiskit-0.38.0-py3-none-any.whl size=12128 sha256=db0fdf505f1a0cee6067402c2679cf3e01ed6efa122bd3f74ecd266bda6bf642
  Stored in directory: /private/var/folders/_1/4k7sz2vd2l909b7tzkgr78_40000gp/T/pip-ephem-wheel-cache-zso7ijky/wheels/9c/b0/59/d6281e20610c76a5f88c9b931c6b338410f70b4ba6561453bc
  Building wheel for psutil (setup.py) ... done
  Created wheel for psutil: filename=psutil-5.9.2-cp310-cp310-macosx_12_0_arm64.whl size=239036 sha256=47f594c85dff23c0dc2860a24818c51ef9cef3c103b92e5552928674e3ee8591
  Stored in directory: /private/var/folders/_1/4k7sz2vd2l909b7tzkgr78_40000gp/T/pip-ephem-wheel-cache-zso7ijky/wheels/07/2e/76/ef443614edb2bc1fd8d89ef3ec9d292b274a5745403f8c66f9
  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
  ╰─> [38 lines of output]
      Error in sitecustomize; set PYTHONVERBOSE for traceback:
      AssertionError:
      /opt/homebrew/Cellar/python@3.10/3.10.7/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      /opt/homebrew/Cellar/python@3.10/3.10.7/Frameworks/Python.framework/Versions/3.10/lib/python3.10/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):
      Error in sitecustomize; set PYTHONVERBOSE for traceback:
      AssertionError:
      Traceback (most recent call last):
        File "/private/var/folders/_1/4k7sz2vd2l909b7tzkgr78_40000gp/T/pip-build-env-6qyr1hkq/overlay/bin/cmake", line 5, in <module>
          from cmake import cmake
      ModuleNotFoundError: No module named 'cmake'
        File "/opt/homebrew/Cellar/python@3.10/3.10.7/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/skbuild/setuptools_wrap.py", line 613, in setup
          cmkr = cmaker.CMaker(cmake_executable)
        File "/opt/homebrew/Cellar/python@3.10/3.10.7/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/skbuild/cmaker.py", line 141, in __init__
          self.cmake_version = get_cmake_version(self.cmake_executable)
        File "/opt/homebrew/Cellar/python@3.10/3.10.7/Frameworks/Python.framework/Versions/3.10/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
Successfully built qiskit psutil
Failed to build tweedledum
 % python3                                                             
Python 3.10.7 (main, Sep 14 2022, 22:38:23) [Clang 14.0.0 (clang-1400.0.29.102)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import qiskit
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'qiskit'
>>> 

I also tried installation using

% python3 -m pip install qiskit tweedledum==1.1.0 --no-cache --upgrade --force-reinstall

but that didn't work either.

I found this thread, but I don't know if the changes are in the current release, hence the options --upgrade and --force-reinstall.

BoltzmannEntropy commented 2 years ago

@croquemadame I was not able to install it with my current python env:

Python 3.8.10 (default, Sep 30 2022, 09:53:07) 
[Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin

Of course, the problem is that tweedledum (c++) fails to compile, and even with the pre-compiled binary it does not install properly. The only option would be to install a fresh Python env with x86 instead of ARM and I am not going to do so.

jakelishman commented 2 years ago

We've modified the install requirements for the upcoming Terra 0.22, which is what triggered the issue to be closed, but that's not actually released yet - it's due on the 11th of October.

I'm not sure what might be happening if the pre-built binary for tweedledum 1.1.0 doesn't work on M1 Mac - I hadn't heard of any problems with that before now (as best as I remember).

BoltzmannEntropy commented 2 years ago

@jakelishman

Main issue with tweedledum: have 'x86_64', need 'arm64e'

Python 3.9.7 (default, Oct  6 2022, 11:51:04)
[Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import qiskit
......
ImportError: dlopen(/Users/.pyenv/versions/3.9.7/lib/python3.9/site-packages/tweedledum/_tweedledum.cpython-39-darwin.so, 0x0002): tried: '/Users/.pyenv/versions/3.9.7/lib/python3.9/site-packages/tweedledum/_tweedledum.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))
>>>
jakelishman commented 2 years ago

Yeah, the "ARM" wheels uploaded by tweedledum actually appear to have x86_64 headers and be named incorrectly. I have no idea how that's happened, but I don't have control of tweedledum to attempt to fix it. We're moving to remove tweedledum as a core requirement in Terra - we are starting the process in 0.22, but it isn't planned to become fully optional until 0.23.

In the near term, you might be best attempting to build tweedledum from source using the instructions on their GitHub, or by using an x86 version of Python through Rosetta. Sorry I can't offer more than that.

From Terra 0.22 the problem will be masked, at the very least, because tweedledum won't be imported by import qiskit (it currently is) - you'd need to try and import the tweedledum-specific parts of Terra before it appeared. Terra 0.22 is due on the 11th of October.

BoltzmannEntropy commented 1 year ago

This works: https://github.com/boschmitt/tweedledum/issues/179#issuecomment-1360285778

installing collected packages: qiskit
Successfully installed qiskit-0.39.4
sol@mprox dev % python
Python 3.9.12 (main, Dec  2 2022, 15:48:07) 
[Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import qiskit 
>>>