更改 distutils 使用的 gcc 版本

发布于 2024-09-09 00:43:49 字数 122 浏览 1 评论 0原文

我在 Snow Leopard 上,希望 distutils 使用 gcc 4.0 而不是 4.2,谁能告诉我如何让它做到这一点?我尝试更改 /usr/bin/g* 符号链接,并设置 C* 环境变量 - 但无济于事。有什么想法吗?

I'm on Snow Leopard, and want distutils to use gcc 4.0 and not 4.2, can anyone tell me how to make it do that? I've tried changing the /usr/bin/g* symlinks, and setting the C* environment vars -- but to no avail. Any thoughts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

尴尬癌患者 2024-09-16 00:43:49

您尝试过 python setup.py build --compiler=gcc 吗?它在文档中进行了描述。

编辑:
另外,这个讨论 看起来与现在的非常相似。 distutils.core 似乎具有以下功能指定编译器和平台。 distutils.ccompiler.get_compiler(osname, platform) 或 distutils.ccompiler.new_compiler(platform, compiler, verbose, dry_run, force) 应该可以工作。

Did you try python setup.py build --compiler=gcc? it is described in the docs.

EDIT:
Also, this discussion looks very similar the present one. distutils.core appears to have the functions to specify the compiler and platform. distutils.ccompiler.get_compiler(osname, platform) or distutils.ccompiler.new_compiler(platform, compiler, verbose, dry_run, force) should work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文