如何配置ruby在AIX上以64位模式进行编译 [英] How do I configure ruby to compile in 64 bit mode on AIX

查看:122
本文介绍了如何配置ruby在AIX上以64位模式进行编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了ruby 2.0.0并运行

I downloaded ruby 2.0.0 and ran

./configure
make
make install

在64位linux机器上,此版本为64位版本。
在AIX上,它构建了一个32位版本。

On a 64 bit linux machine this build a 64 bit version. On AIX, this built a 32 bit version. How do I configure it to compile in 64 bit mode?

我尝试过

export OBJECT_MODE=64
./configure 

但由于$ b $而失败b检查gcc ... gcc
检查C编译器是否工作...否

but it failed with checking for gcc... gcc checking whether the C compiler works... no

更新:
我设法用以下代码进行编译:

Update: I managed to get this to compile with the following:

export OBJECT_MODE=64  ## not sure if I needed this or not
./configure --disable-install-doc CC="gcc" CFLAGS="-maix64 -mminimal-toc" CXX="g++" CXXFLAGS="-maix64 -mminimal-toc" NM="nm -X64" AR="ar -X64" LDFLAGS="-maix64" EXTLDFLAGS="-maix64"
make
make test
make install 

测试通过了,似乎运行正常
不幸的是,我的swig生成的扩展名(在Linux上运行良好)有问题。它可以干净地编译和链接,但是我在require上遇到错误:

the tests passed and it seems to be running fine unfortunately my swig generated extension (which runs fine on linux) has problems. It compiles and links cleanly but I get an error on the require:

.....ruby/aix/lib/ruby/site_ruby/2.0.0/powerpc-aix6.1.0.0/wv.so. Not enough space[loadquery failed]
.....ruby/aix/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in `require'

也许我会针对这个问题开始一个新问题

maybe I will start a new question on that problem

推荐答案

这将是一场艰苦的斗争。

This is going to be an uphill struggle.

首先,看看是否可以通过将-mpowerpc64 -maix64添加到gcc来构建一个简单的hello世界命令行。例如

First, see if you can build a simple hello world with -mpowerpc64 -maix64 added to the gcc command line. e.g.

gcc -mpowerpc64 -maix64 -o foo foo.c

我建议这样做的原因是我必须做更多的工作来构建我的gcc,以获取它在64位模式下使用的所有库。即使这样做确实可行,您仍然可能没有获得ruby及其所有扩展才能正常工作所需的所有可用库。

The reason I suggest that is I have to do extra work to build my gcc to get all the libraries it uses in 64 bit mode. Even if that does work, you still might not have all the libraries available that you need to get ruby and all its extensions to work.

我的基本知识是:

CFLAGS='-mpowerpc64 -maix64' configure ...

但由于toc太大而死,我通过添加-Wl,-bbigtoc来克服了。但是ar失败了,因为没有人通过-X 64标志。您可以通过编辑Makefile并更改将AR设置为ar -X64的方式来解决此问题。

but it died with the toc too big which I got past by adding -Wl,-bbigtoc. But then ar fails because no one passed it a -X 64 flag. You can get past that by editing the Makefile and change what AR is set to to be ar -X64. etc.

这里的要点是使用configure进行关闭,然后手动编辑Makefile和其他文件以添加所需的标志。我敢肯定有一个解决方案,但这可以避免您每次重新启动。

The gist here is to use configure to get close and then edit the Makefile and other files by hand to add in the flags you need. I'm sure there are one step solutions but this will save you from starting back over each time.

这篇关于如何配置ruby在AIX上以64位模式进行编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆