我正在尝试在 MacOS 中安装 quickfix 1.15.1(当前可用的最新版本)。
操作系统版本为 Ventura 15.1。芯片是苹果M2。 Python 版本为 3.9.6。 Clang 版本是 14.0.0.
但是安装失败。
我遵循的步骤如下。
尝试使用
pip3 install quickfix
安装。它没有成功。
从pypi下载源码包并尝试使用
pip3 install .
和pip3 install . --no-binary=:all --user --no-cache-dir
安装包。它没有成功。
从 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。但是在那里也找不到解决方案。
刚刚在我的基于 ARM 的 MacBook 上安装了
quickfix-1.15.1
:
https://pypi.org/project/quickfix下载
quickfix-1.15.1.tar.gz
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;
}
pip3 install .
文件夹中运行quickfix-1.15.1
。quickfix-1.15.1-cp310-cp310-macosx_12_0_arm64.whl
也在你的 pip 缓存目录中。希望这有帮助。