【问题标题】:Intel Compiler and Python/ctypes/libffi英特尔编译器和 Python/ctypes/libffi
【发布时间】:2010-08-17 08:35:11
【问题描述】:

我在使用英特尔编译器 (11.1) 构建具有 ctypes 的 Python 工作版本时遇到问题。问题是,ctypes 模块下的 libffi 在与 e.g. 接口时无法正常工作。 OpenGL。

最初,libffi 没有使用英特尔编译器进行编译,因为未定义 __int128_t,我遵循了已在几个地方列出的工作,即通过定义一个新类型:

typedef struct { int64_t m[2]; } __int128_t;

这遵循英特尔给出的响应:http://software.intel.com/en-us/forums/showthread.php?t=56652

补丁然后建议如下:

typedef struct { int64_t m[2]; } __int128_t;
//and then change where the uint64_t is assigned to this to be:
sse[x].m[0] = *(uint64_t*) v;
sse[x].m[1] = 0;
//and where the uint32_t is assigned to:
sse[x].m[0] = *(uint32_t*) v;
sse[x].m[1] = 0;

应用补丁,编译,ctypes 可以导入,但是,当与 OpenGL 接口时,事情不起作用。运行 PyQt 的示例程序 hellogl.py 会导致空白视图。

有没有更好的工作方式?

丹;

【问题讨论】:

  • 它已作为 Python 错误进行了讨论:bugs.python.org/issue4130
  • 也可以说用 GCC 编译 Python(和 libffi)是可行的——但我对完整的 Intel 解决方案很感兴趣。在最坏的情况下,我将只使用 GCC 编译 libffi。

标签: python compiler-construction ctypes libffi


【解决方案1】:

我是 libffi 的作者。我建议向 libffi-discuss@sourceware.org 发送一份包含所有这些详细信息的说明。我还建议在英特尔编译器构建的 libffi 上运行 libffi 测试套件。确保将结果发送到 libffi-discuss@sourceware.org,我们可以帮助找出问题。

【讨论】:

  • 嗨 Anthony - 我刚刚看到你的回复。我们已不再使用英特尔编译器(出于其他原因),但感谢您的提议。如果我们再次启动 Intel 编译器,我们将编译的 Python 版本可能会发生变化(以及许多其他事情)——如果没问题,我们可以从那里接受 if。
猜你喜欢
  • 2021-08-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-01-22
  • 1970-01-01
  • 1970-01-01
  • 2016-04-26
  • 1970-01-01
相关资源
最近更新 更多