Following the official guid:

http://help.autodesk.com/cloudhelp/2015/ENU/Maya-SDK/files/Setting_up_your_build_environment_Linux_environments_32bit_and_64bit.htm

I still encountered several errors, and here is the way how I came out.

Here is the steps in the offical guid, and I add my annotation.

Download the gcc 4.1.2 source tar file from http://gcc.gnu.org/install/ // I download the package in this page: https://gcc.gnu.org/releases.html

Setup directories:
% mkdir gcc412    // My directory is /home/user0/tools/gcc412
% cd gcc412
% mkdir gcc-build // My directory is /home/user0/tools/gcc412/build Extract the source files:
% tar zxvf gcc-4.1.2.tar.gz  // I unzip the package in /home/user0/tools/gcc412/src
% cd gcc-build               // for me, it is /home/user0/tools/gcc412/build Configure the compiler. Run the following all on 1 line:
../src/configure --prefix=/opt/gcc412 --program-suffix=412 --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --disable-libunwind-exceptions --enable-__cxa_atexit Build the compiler:
% make -j 2 bootstrap
Note:
0. you need to install glibc-devel.i686, you can run this command:
#yum install glibc-devel.i686 1. It may fail if your display driver is nvidia-x11-drv-340.32-1. You have to update your display driver to nvidia-x11-drv-340.32-2. If you installed nvidia-x11-drv-340.32-1 with Nvidia installer, you can read this post for updating your driver: nvidia-xhttps://www.centos.org/forums/viewtopic.php?t=24137,
And if you installed 1nvidia-x11-drv-340.32-1 with yum, you can use the following commands to update your driver:
#yum clean all
#yum --disablerepo=\* --enablerepo=elrepo install kmod-nvidia nvidia-x11-drv
#yum --disablerepo=\* --enablerepo=elrepo install nvidia-x11-drv-32bit
(See this post for more details: https://www.centos.org/forums/viewtopic.php?f=48&t=48236) 2. It has a compiling error when you build gcc4.1.2:
../gcc/config/i386/linux-unwind.h:138:17: error: field 'info' has incomplete type "
And here is the solution: http://forge.ispras.ru/issues/4295
It means that you need to change the code on line 136 in linux-unwind.h:
struct rt_sigframe {
    int sig;
    struct siginfo *pinfo;
    void *puc;
    struct siginfo info;
} *rt_ = context->cfa;
to
struct rt_sigframe {
    int sig;
    siginfo_t *pinfo;
    void *puc;
    siginfo_t info;
    struct ucontext uc;
} *rt_ = context->cfa;
You can download the modified file in http://files.cnblogs.com/yaoyansi/gcc412_build.zip. 3. It has a link error: .libs/libgcj.so: undefined reference to `__cxa_call_unexpected'.
And here is the solution: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50888, it shows you how to modify libjava/prims.cc.
You can download the modified file in http://files.cnblogs.com/yaoyansi/gcc412_build.zip,
After you modify /home/user0/tools/gcc412/src/libjava/prims.cc, remove /home/user0/tools/gcc412/build/gcc/gcc.o and build it again. 4. It complains:
creating gij
GC Warning: Repeated allocation of very large block (appr. size 1048576000):
May lead to memory leak and poor performance.
GC Warning: Out of Memory! Returning NIL!
GC Warning: Repeated allocation of very large block (appr. size 1048576000):
May lead to memory leak and poor performance.
GC Warning: Out of Memory! Returning NIL!
Exception during runtime initialization
java.lang.OutOfMemoryError
<<No stacktrace available>> In /home/user0/tools/gcc412, I searched all gij.o and gcc.o, and removed them, then built it again.

Install compiler as root:
% su root
% make install    // gcc412 is installed in /opt/gcc412/ Note: you can make a symlink in /usr/bin to make the call to gcc easier for the
user:
% cd /usr/bin
% ln -s /opt/gcc412/bin/gcc412 .
% ln -s /opt/gcc412/bin/g++412 .

Building GCC 4.1.2 in CentOS 7 for Maya API development的更多相关文章

  1. gcc configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0

    从svn checkout svn://gcc.gnu.org/svn/gcc/trunk拿了GCC的最新代码,打算编译了学东西习学习C++ 11的东西,结果在configure的时候出现例如以下问题 ...

  2. GCC升级问题解决:configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.,mpfr2.4.0

    如果遇到类似问题: configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.,mpfr2.4.0 解决 ...

  3. configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.

    configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+. 一.错误发生情景: 在安装gcc时,执行.c ...

  4. win10 UWP 等级控件Building a UWP Rating Control using XAML and the Composition API | XAML Brewer, by Diederik Krols

    原文:Building a UWP Rating Control using XAML and the Composition API | XAML Brewer, by Diederik Krols ...

  5. gcc 4.8.3 install centos

    http://blog.csdn.net/xlx921027/article/details/17382643

  6. Centos 7 安装 Xilinx SDSoC Development Environment

    1.CentOS版本信息 $ cat /etc/redhat-releaseCentOS Linux release 7.6.1810 (Core) 2.SDSoC下载地址: https://www. ...

  7. 在CentOS 7.2下升级gcc编译器的版本

    默认情况下,CentOS 7.2预装的gcc版本是4.8.x,通过执行命令 gcc -v 可以看到,一般情况下这个版本的编译器已经满足需要了,但是某些特殊的时候为了支持C++更高的特性,需要对gcc编 ...

  8. 转载:Centos升级gcc

    一.检查centos 里面是否安装了gcc g++ 输入命令:rpm -qa|grep gcc*有看到就出来gcc的东西就是装了没有的话就yum install gcc* -y 二.升级gcc 对于C ...

  9. centos 7升级gcc到10.2.0

    安装gcc 由于 Linux 操作系统的自由.开源,在其基础上衍生出了很多不同的 Linux 操作系统,如 CentOS.Ubuntu.Debian 等.这些 Linux 发行版中,大多数都默认装有 ...

随机推荐

  1. ThinkPHP_SQL(1)查询语言

    推荐使用索引数组或者对象来作为查询条件,因为会更加安全. 一.使用字符串作为查询条件 这是最传统的方式,但是安全性不高,例如: $User = M("User"); // 实例化U ...

  2. 如何开发H5项目 -- 入门篇

    前言 H5即HTML5,H5开发具有低成本.高效率.跨平台.研发周期短,用户接触成本低等特性. 一.开发环境 在开发一个H5项目之前,需要先搞好环境.主要有node.npm.gulp.bower.下面 ...

  3. G - 小希的迷宫

    Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Pract ...

  4. RealProxy实现AOP编程(1)

    Program.cs class Program { static void Main(string[] args) { User user = " }; var processor = T ...

  5. 新浪微博AppKey大集合(share)

    本文转自:http://blog.sina.com.cn/s/blog_9e1ea13a01017y3n.html ------------------------------------------ ...

  6. Matlab中fread函数的高级使用方法及其帮助文档中容易引起歧义的地方

    参考资料:http://cn.mathworks.com/help/matlab/ref/fread.html 注意:参考资料针对的Matlab版本号R2015a,我使用的是R2013b. Matla ...

  7. python 使用virtualenvrapper虚拟环境管理工具

    centos 默认安装的python是2.6版本的 使用virtualenv 环境管理工具建立python虚拟环境的时候会遇到一些错误,DEPRECATION: Python 2.6 is no lo ...

  8. selenium 常见问题整理。

    一:日期控件 selenium不能直接对日期控件操作,可以通过js对日期控件做赋值操作 WebElement inputTimeBox=driver.findElement(by.name(" ...

  9. JavaScript,DOM经典基础面试题

    JavaScript的数据类型 JavaScript的数据类型可以分为原始类型和对象类型 原始类型包括string,number和Boolean三种,其中字符串是使用一对单引号或者一堆双引号括起来的任 ...

  10. java程序链接到sql server数据库

    package jianhua; import java.sql.*; public class ConDatabase { public static void main(String[] args ...