如何让 cx_Oracle 在 64 位 Itanium Windows 上工作?

发布于 2024-08-17 00:35:53 字数 1956 浏览 11 评论 0原文

我在 64 位 Itanium 服务器上运行 Windows Server 2003,该服务器还运行 64 位 Oracle 10.2,并且我想安装适用于 Python 2.5 的 cx_Oracle。我之前在 Windows 和 Linux 上多次使用过 cx_Oracle,并且之前也在这些平台的 32 位版本上编译过它,但我从未尝试过 IA64 编译。

http://cx-oracle.sourceforge.net/ 上的 cx_Oracle 二进制版本都不是64 位,并且在安装其中任何一个后尝试运行 import cx_Oracle 时出现错误,所以我认为要做的就是从源代码编译它。

当运行 python setup.py build 时,我收到错误,Python 是使用 Visual Studio 2003 构建的,并且我需要一些可以生成兼容二进制文件的东西。我有 Visual Studio 2005,由于链接到不同版本的 C 标准库,并且可能还有其他原因,它显然不符合要求。不幸的是,Visual Studio 2003 不再提供下载,而且我不知道从哪里可以获得它。

所以我从 http://sourceforge.net/projects/mingw/files/ 下载 MinGW但这也仅以 32 位形式提供。无论如何,我继续尝试一下,但在编译过程中,它给了我一个错误,关于我链接的 Oracle DLL 之一具有无效的文件格式。

此时我有很多选择,但我不知道该把精力放在哪里:

  1. 我可以从 http://sourceforge.net/projects/mingw-w64/ 并尝试使用它,除了它似乎只能作为源代码使用,所以我必须编译编译器,可能使用 Visual Studio 2005。

  2. 我可以尝试使用 x86 32 位版本的 Python,然后从 http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html,然后使用它来构建 cx_Oracle。我可能必须将 ORACLE_HOME 设置为客户端,以便它不会尝试链接 64 位服务器 DLL,但这似乎可能有效。

  3. 我可以尝试使用 Visual Studio 2005 从源代码编译 Python 本身,这样我就可以使用 Visual Studio 2005 构建 cx_Oracle,而不必担心二进制兼容性问题。我已经在 Linux 上多次从源代码编译了 Python,从未遇到过任何问题,因此我相信它在 Windows 上也同样简单。

  4. 我可以尝试弄清楚如何使 Visual Studio 2005 链接到正确的 DLL,从而以这种方式生成兼容的二进制文件,而不需要 Visual Studio 2003。直观上,Visual Studio 应该能够生成与旧版本兼容的二进制文件本身,但几乎我所有的编译器经验都是使用 gcc,所以我真的不知道。

我只是真的不知道该把我的努力用在哪里。有人对下一步该去哪里有什么建议吗?如果有帮助的话,我可以复制/粘贴我收到的一些具体错误消息。

我特别希望听到任何曾经让 cx_Oracle 在 64 位 Itanium 版本的 Windows 上工作的人的意见 - 我不能是第一个尝试这个的人。

I'm running Windows Server 2003 on a 64-bit Itanium server which is also running 64-bit Oracle 10.2, and I'd like to install cx_Oracle for Python 2.5. I've used cx_Oracle before many times on both Windows and Linux, and I've also compiled it before on 32 bit versions of those platforms, but I've never tried an IA64 compile.

None of the binary builds of cx_Oracle at http://cx-oracle.sourceforge.net/ are 64 bit, and I get an error after installing any of them when trying to run import cx_Oracle so I figure the thing to do is to compile it from source.

When running python setup.py build then I get the error that Python was built with Visual Studio 2003 and that I need something which can produce compatible binaries. I have Visual Studio 2005, which apparently doesn't fit the bill due to linking against a different version of the C standard library, and probably for other reasons as well. Unfortunately, Visual Studio 2003 is no longer available for download, and I'm not sure where to get it.

So I download MinGW from http://sourceforge.net/projects/mingw/files/ but this is also only available in 32 bit form. I go ahead and give it a try anyway, but it gives me an error during compilation about one of the Oracle DLLs I'm linking against having an invalid file format.

At this point I've got a lot of options, and I'm not sure where to place my efforts:

  1. I could download the 64 bit MinGW from http://sourceforge.net/projects/mingw-w64/ and try using that, except that it only seems to be available as source, so I'd have to compile the compiler, probably using Visual Studio 2005.

  2. I could try using an x86 32 bit build of Python and then download the Oracle Instant Client SDK from http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html and then use that to build cx_Oracle. I'd probably have to set my ORACLE_HOME to the client so that it didn't try linking against the 64 bit server DLLs, but this seems like it might work.

  3. I could try compiling Python itself from source, using Visual Studio 2005, so that I could then use Visual Studio 2005 to build cx_Oracle and not worry about binary compatibility issues. I've compiled Python from source many times on Linux and never had any problems, so I'd like to believe that it's just as simple on Windows.

  4. I could try to figure out how to make Visual Studio 2005 link against the right DLLs and thus produce compatible binaries in that manner without needing Visual Studio 2003. Intuitively it seems like Visual Studio should be able to produce compatible binaries with older versions of itself, but almost all of my compiler experience is with gcc so I don't really know.

I'm just really not sure where to direct my efforts. Does anyone have any suggestions about where to go next? I can copy/paste some of the specific error messages I've gotten if that would be helpful.

I'd especially love to hear from anyone who's ever gotten cx_Oracle to work on a 64 bit Itanium version of Windows - I can't be the first to try this.

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

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

发布评论

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

评论(2

小忆控 2024-08-24 00:35:53

我最终选择了选项#2:我下载了 32 位 Oracle Instant Client,然后使用即时客户端编译了适用于 32 位 Python 的 cx_Oracle。所以涉及的所有内容都是 32 位的,我只是没有使用任何 IA64 位可执行文件,而且这工作得很好。

如果我有 IA64 编译器,我会尝试选项 #3,但事实证明 Visual Studio Pro 不支持 IA64 平台,我们需要花很多钱升级到比 Pro 更高的版本。

I ended up going with Option #2: I downloaded the 32-bit Oracle Instant Client, then compiled cx_Oracle for 32-bit Python with the instant client. So everything involved is 32-bit, and I'm just not using any IA64-bit executables, and this works just fine.

If I had an IA64 compiler, I'd try Option #3, but it turns out that Visual Studio Pro doesn't support the IA64 platform, and we'd need to spend a lot of money to upgrade to whatever's higher than Pro.

无力看清 2024-08-24 00:35:53

我昨天读了这篇文章,看到没有人回答我并不感到惊讶。这是一个非常具体和复杂的问题。虽然我对您正在使用的许多工具没有直接经验,但我已经解决了与不同编译器和二进制文件不兼容的问题。 3. 就其价值而言,听起来是您最好的选择。

I read this yesterday and am not suprised to see that nobody has answered. It is a very specific and complex question. While I do not have direct experience with many of the tools you are dealing with I have delt with the issues surrounding incompatabilities with different compilers and binaries. For what its worth 3. sounds like your best bet.

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