在旧的Linux Svrs(Redhat EL 5.7)上使用最新的GCC(4.8.1) [英] to use latest GCC(4.8.1) on older Linux Svrs (Redhat EL 5.7)

查看:159
本文介绍了在旧的Linux Svrs(Redhat EL 5.7)上使用最新的GCC(4.8.1)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们编码&在一台Linux机器上构建,&使用数百个核心部署到我们的集群。目前,这两种类型的机器都是Redhat EL 5.7,安装了默认的GCC 4.1.2。最近我们意识到最新的GCC(例如4.8.1)得到了广泛的优化用于算术计算,包括MPFR / MPC的使用等。因为我们的程序是非常浮点计算密集型的,所以我们希望在最新的GCC中重建我们的程序以实现提升。

<以下是我们建立的典型程序的当前链接细节:​​

  linux-gate.so.1 => (0x007e0000)
libgcc_s.so.1 => /lib/libgcc_s.so.1(0x009bb000)
libc.so.6 => /lib/libc.so.6(0x00581000)
/lib/ld-linux.so.2(0x0034c000)

因为我们不太可能升级操作系统,或者在群集中安装新的东西。 (严格控制)。所以问题是:

1,为了开发,我们可以在现有机器上安装最新的GCC? (我们尝试过,发现很多需要依赖的东西)。并且可以链接到较旧的库?



2,用于部署,可以在不安装新软件的情况下部署到我们的集群?对于这些MPFR等,我们可以只部署这样的文件,而不是在目标群集节点中安装RPM?



非常感谢您的帮助。

解决方案

您需要安装所需的依赖项(及其必需版本)来构建GCC 4.8;注意MPFR,CLOOG等仅仅是编译器所需要的(编译时需要,而不是在编译的程序的运行时),所以你不需要安装它们来部署你编译的程序。不要将编译器链接到旧版本的所需依赖项。



gcc-4.8 源码tarball有一个 contrib / download_prerequisites 脚本,这可能会有帮助。



如果从源代码tarball构建GCC 4.8,不要忘记在源代码树之外构建,并遵循安装指令。



您可能希望将您的程序与 - static-libgcc 选项,甚至到 .... / configure 编译器用 - disable-shared - program-suffix = -4.8 配置选项



<使用程序后缀
code>选项,你将运行新的GCC作为 gcc-4.8 ,它会被安装,除非你配置在默认情况下,在 / usr / local / bin / 中重新设置一些 - 前缀这不会干扰系统 gcc ;如果您没有[root]写权限 / usr / local ,您应该配置您自己的 - 前缀 )。

顺便说一句,您可能会考虑定制您的GCC 4.8,例如通过插件或更好的方式使用 MELT


We do coding & building in one Linux machine, & deploy to our cluster with hundreds of cores. For now both type of machines are Redhat EL 5.7, with the default GCC 4.1.2 installed.

Recently we realized the latest GCCs (e.g. 4.8.1) got extensive optimizations for arithmetic calculations, including the usage of MPFR/MPC etc. Because our programs are very floating point calculation intensive, we hope to rebuild our programs in latest GCCs to achieve the boost.

Here are the current linking details for a typical program built by us:

    linux-gate.so.1 =>  (0x007e0000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x009bb000)
    libc.so.6 => /lib/libc.so.6 (0x00581000)
    /lib/ld-linux.so.2 (0x0034c000)    

Because it's unlikely for us to upgrade OS, or install new stuffs in cluster. (tightly controlled). So questions are:

1, for developing, possible for us to install the latest GCC on existing machine? (We tried and found lot's of dependencies needed). And possible to link to the older libs?

2, for deployment, possible to deploy to our cluster without installing new softwares? For these MPFR etc, can we just deploy the so files instead of installing RPMs in the target cluster nodes?

Thanks a lot for any help.

解决方案

You need to install the required dependencies (and their required versions) to build GCC 4.8; notice that MPFR, CLOOG etc are only needed to the compiler (so are needed at compilation time, not at run time of your compiled program), so you don't need to install them to deploy your compiled program. Don't link the compiler to older versions of required dependencies.

The gcc-4.8 source tarball has a contrib/download_prerequisites script which could be helpful.

If building GCC 4.8 from source tarball, don't forget to build outside of the source tree, and to follow the install instruction.

You may want to link your program with the -static-libgcc option, or even to ..../configure the compiler with --disable-shared and --program-suffix=-4.8 configure options

(with that program-suffix option, you'll run your new GCC as gcc-4.8 and it will get installed, unless you configure some --prefix, in /usr/local/bin/ by default; this won't interfere with the system gcc; if you don't have [root] write access to /usr/local you should configure your own --prefix).

BTW, you might consider perhaps customizing your GCC 4.8, e.g. thru plugins or better yet using MELT.

这篇关于在旧的Linux Svrs(Redhat EL 5.7)上使用最新的GCC(4.8.1)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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