Quickfix for Python 库安装在 MacOS 中失败

问题描述 投票:0回答:1

我正在尝试在 MacOS 中安装 quickfix 1.15.1(当前可用的最新版本)。

操作系统版本为 Ventura 15.1。芯片是苹果M2。 Python 版本为 3.9.6。 Clang 版本是 14.0.0.

但是安装失败。

我遵循的步骤如下。

  1. 尝试使用

    pip3 install quickfix
    安装。它没有成功。

  2. pypi下载源码包并尝试使用

    pip3 install .
    pip3 install . --no-binary=:all --user --no-cache-dir
    安装包。它没有成功。

  3. github 克隆了 C++ quickfix 源代码,并尝试使用命令

    ./boostrap
    ./configure --with-python3
    sudo make install
    安装库。它也没有成功。

我在以上三个步骤中尝试安装库时得到的错误如下。

Processing /Users/user/Dependencies/quickfix-1.15.1
Preparing metadata (setup.py) ... done
Building wheels for collected packages: quickfix
Building wheel for quickfix (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─\> \[248 lines of output\]
Testing for std::tr1::shared_ptr...
test_std_tr1_shared_ptr.cpp:1:10: fatal error: 'tr1/memory' file not found
\#include \<tr1/memory\>
^\~\~\~\~\~\~\~\~\~\~\~
1 error generated.
...not found
Testing for std::shared_ptr...
...found
Testing for std::unique_ptr...
...found

C++/AtomicCount.h:163:11: error: unrecognized instruction mnemonic
                "lock\n\t"
                ^
      <inline asm>:1:2: note: instantiated into assembly here
              lock
              ^
      In file included from C++/DataDictionary.cpp:26:
      In file included from C++/DataDictionary.h:30:
      In file included from C++/FieldMap.h:30:
      In file included from C++/MessageSorters.h:30:
      In file included from C++/SharedArray.h:26:
      C++/AtomicCount.h:163:18: error: unrecognized instruction mnemonic, did you mean: add, addp, adds, addv, fadd, madd?
                "lock\n\t"
                       ^
      <inline asm>:2:2: note: instantiated into assembly here
              xadd x9, [x8]
              ^

fatal error: too many errors emitted, stopping now [-ferror-limit=]
      2 warnings and 20 errors generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for quickfix
  Running setup.py clean for quickfix
Failed to build quickfix
Installing collected packages: quickfix
  Running setup.py install for quickfix ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for quickfix did not run successfully.

fatal error: too many errors emitted, stopping now [-ferror-limit=]
      2 warnings and 20 errors generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> quickfix

note: This is an issue with the package mentioned above, not pip.

浏览了不同的问题线程和文档,但还没有找到解决方案。也发现了这个类似的stack overflow post。但是在那里也找不到解决方案。

python macos pypy quickfix fix-protocol
1个回答
0
投票

刚刚在我的基于 ARM 的 MacBook 上安装了

quickfix-1.15.1

  1. https://pypi.org/project/quickfix
    下载quickfix-1.15.1.tar.gz
  2. 解压缩并通过取消注释第 155 行和注释掉下面的第 170 行来编辑
    C++/AtomicCount.h
    文件:
    static int atomic_exchange_and_add(int * pw, int dv)
    {
      int r = *pw;
      *pw += dv;
      return r;

      // int r;

      // __asm__ __volatile__
      //   (
      //     "lock\n\t"
      //     "xadd %1, %0":
      //     "+m"(*pw), "=r"(r) : // outputs (%0, %1)
      //     "1"(dv) : // inputs (%2 == %1)
      //     "memory", "cc" // clobbers
      //   );

      // return r;
    }
  1. 然后在
    pip3 install .
    文件夹中运行
    quickfix-1.15.1
  2. 您还可以找到您的 wheel 文件,例如
    quickfix-1.15.1-cp310-cp310-macosx_12_0_arm64.whl
    也在你的 pip 缓存目录中。

希望这有帮助。

© www.soinside.com 2019 - 2024. All rights reserved.