LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1242|回复: 10

注意本地化对编译的影响(octave和gcc现在编译能过了)

[复制链接]
发表于 2009-7-25 10:38:14 | 显示全部楼层 |阅读模式
发现本地化后编译有印象,就我碰到两个问题都是和本地化有关的。

对于第1个问题,通过google找到解决方法
(参考:lophyxp.blogspot.com/2009/07/localegcc.html),由于这个网页我这里被屏蔽了,只能看到快照,所以我就转一下:

在emerge gcc的时候,前面加LC_ALL="C"。
  1. LC_ALL="C" emerge --oneshot gcc
复制代码

该网页参考的网址
http://bugs.gentoo.org/show_bug.cgi?id=236762

对于第2个问题,仿照第1个问题的解决思路,我切换一下locale。
  1. LANG=en
  2. emerge -av octave
复制代码
就能编译成功了


碰到的问题情况:
(1)gcc编译不过(在执行emerge --update --deep --newuse world)
* Messages for package sys-devel/gcc-4.3.2-r3:

*
* ERROR: sys-devel/gcc-4.3.2-r3 failed.
* Call stack:
* ebuild.sh, line 49: Called src_compile
* environment, line 4879: Called toolchain_src_compile
* environment, line 5405: Called gcc_src_compile
* environment, line 3103: Called gcc_do_make
* environment, line 2893: Called die
* The specific snippet of code:
* emake LDFLAGS="${LDFLAGS}" STAGE1_CFLAGS="${STAGE1_CFLAGS}" LIBPATH="${LIBPATH}" BOOT_CFLAGS="${BOOT_CFLAGS}" ${GCC_MAKE_TARGET} || die "emake failed with ${GCC_MAKE_TARGET}";
* The die message:
* emake failed with bootstrap-lean
*
* If you need support, post the topmost build error, and the call stack if relevant.
* A complete build log is located at '/var/tmp/portage/sys-devel/gcc-4.3.2-r3/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/sys-devel/gcc-4.3.2-r3/temp/environment'.
*

(2)octave编译不通过(当然是emerge -av octave后)
I try to install Octave in my laptop.

I use the command: emerge -v octave
And those are information reported that the install fail:

x86_64-pc-linux-gnu-gfortran -c -fPIC -O lennob.f -o pic/lennob.o
f951: 编译器内部错误:在 error_print 中,于 fortran/error.c:492
请提交一份完整的错误报告,
如有可能请附上经预处理后的源文件。
具体步骤请参见 <http://bugs.gentoo.org/>。
make[3]: *** [pic/lennob.o] 错误 1
make[3]: *** 正在等待未完成的任务....
make[3]: Leaving directory
`/var/tmp/portage/sci-mathematics/octave-3.0.3/work/octave-3.0.3/libcruft/ranlib'
make[2]: *** [ranlib] 错误 2
make[2]: Leaving directory
`/var/tmp/portage/sci-mathematics/octave-3.0.3/work/octave-3.0.3/libcruft'
make[1]: *** [libcruft] 错误 2
make[1]: Leaving directory
`/var/tmp/portage/sci-mathematics/octave-3.0.3/work/octave-3.0.3'
make: *** [all] 错误 2
^[[31;01m*^[[0m
^[[31;01m*^[[0m ERROR: sci-mathematics/octave-3.0.3 failed.
^[[31;01m*^[[0m Call stack:
^[[31;01m*^[[0m               ebuild.sh, line   49:  Called src_compile
^[[31;01m*^[[0m             environment, line 3234:  Called die
^[[31;01m*^[[0m The specific snippet of code:
^[[31;01m*^[[0m       emake || die "emake failed";
^[[31;01m*^[[0m  The die message:
^[[31;01m*^[[0m   emake failed
^[[31;01m*^[[0m
^[[31;01m*^[[0m If you need support, post the topmost build error, and the
call stack if relevant.
^[[31;01m*^[[0m A complete build log is located at
'/var/tmp/portage/sci-mathematics/octave-3.0.3/temp/build.log'.
^[[31;01m*^[[0m The ebuild environment file is located at
'/var/tmp/portage/sci-mathematics/octave-3.0.3/temp/environment'.
^[[31;01m*^[[0m
发表于 2009-7-25 11:02:54 | 显示全部楼层
一直,我都是在/etc/make.conf里面设好就行。

  1. ~ $ cat /etc/make.conf |grep LC_ALL
  2. export LC_ALL=C
复制代码


系统的locale:

  1. ~ $ locale -a
  2. C
  3. en_US
  4. en_US.iso88591
  5. en_US.utf8
  6. es_ES.utf8
  7. POSIX
  8. zh_CN.gb18030
  9. zh_CN.gb2312
  10. zh_CN.gbk
  11. zh_CN.utf8
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-7-25 11:04:56 | 显示全部楼层
Post by cliffordli;2009417
一直,我都是在/etc/make.conf里面设好就行。

  1. ~ $ cat /etc/make.conf |grep LC_ALL
  2. export LC_ALL=C
复制代码


系统的locale:

  1. ~ $ locale -a
  2. C
  3. en_US
  4. en_US.iso88591
  5. en_US.utf8
  6. es_ES.utf8
  7. POSIX
  8. zh_CN.gb18030
  9. zh_CN.gb2312
  10. zh_CN.gbk
  11. zh_CN.utf8
复制代码


哈哈,我是新手,所以,有些就不明白,见笑了
回复 支持 反对

使用道具 举报

发表于 2009-7-25 12:16:20 | 显示全部楼层
注意到一個有意思的問題,就是好像這兩個程序出錯都和 Fortran 有關。我在相關的 Bug 上已經反映了你重現 Bug 的情況,看看官方有沒有什麽回答。

還有就是樓主如果有時間,應該按他說的,附上一份源文件提交一個 Bug,這個算 Fortran 的一個大 Bug 了。
回复 支持 反对

使用道具 举报

发表于 2009-7-25 13:38:47 | 显示全部楼层
去oftc上的#gfortran频道,

有开发者在上面,直接沟通。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-7-25 17:19:41 | 显示全部楼层
Post by 亞利艾爾;2009445
注意到一個有意思的問題,就是好像這兩個程序出錯都和 Fortran 有關。我在相關的 Bug 上已經反映了你重現 Bug 的情況,看看官方有沒有什麽回答。

還有就是樓主如果有時間,應該按他說的,附上一份源文件提交一個 Bug,這個算 Fortran 的一個大 Bug 了。


哈哈,新手,提交过。不过我好像英文好像太差了。也不知道我是否属于提交成功的
回复 支持 反对

使用道具 举报

发表于 2009-7-25 18:46:38 | 显示全部楼层
哈哈,我都是吧fortran的USE给去掉的,这个一般没特殊需求的话不太用的到。
回复 支持 反对

使用道具 举报

发表于 2009-7-25 20:28:00 | 显示全部楼层
看来基础设施的故障引起的轰动可是不小。Handbook曾经说过的,不宜在命令行上定义影响emerge的参数。在解决这篇文章的问题是我在这里搜到一个办法,把这个参数定义在portage的配置文件中,可是我没有测试,贴出来大家试试。
  1. cd /etc/portage
  2. sudo mkdir -p env/sys-devel
  3. cd env/sys-devl
  4. sudo -l `echo LC_ALL="C" > gcc`
复制代码


然后在重新编译gcc即可
  1. sudo emerge --oneshot gcc
复制代码
回复 支持 反对

使用道具 举报

发表于 2009-7-25 22:41:10 | 显示全部楼层
我以为只有我遇到这个问题。
以前去掉USE="-fortran " emerge gcc (4.3.2-r)是可以通过的,现在不行了;LC_ALL=C没试过~
回复 支持 反对

使用道具 举报

发表于 2009-7-26 08:00:04 | 显示全部楼层
我的在/etc/make.conf里加export LC_ALL=C就行,而且早在gcc-4.1.2我就加了。gcc-4.3.2 顺利过, 与fortran关系不大。

~ $ emerge -pv gcc

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] sys-devel/gcc-4.3.2-r3  USE="fortran gtk mudflap nls nptl openmp (-altivec) -bootstrap -build -doc (-fixed-point) -gcj (-hardened) -ip28 -ip32r10k -libffi (-multilib) -multislot (-n32) (-n64) -nocxx -nopie -objc -objc++ -objc-gc -test -vanilla" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表