Saturday, October 31, 2009

如何在Fedora 11上安装Intel C++ Compiler 11.0 和 Intel Fortran Compiler 11.0

1. 要在Fedora系统上安装 Intel C++ Compiler 11.0 或 Intel Fortran Compiler 11.0, 需要libstdc++.so.5,而Fedora 11自带的是libstdc++.so.6.0.10,所以我们要做的第一步是下载并安装 libstdc++.so.5。需要注意的是有两个不同版本的libstdc++.so.5(libstdc++.so.5 (libc6,x86-64) ,libstdc++.so.5 (libc6) )。读者应当根据自己机器内核选择不同的版本。对于32位的版本,读者可以登入root帐号,利用如下命令安装:
yum install libstdc++.so.5
对于64位的版本,可从下面的地址下载相应的库文件并安装:ftp://ftp.muug.mb.ca/mirror/fedora/linux/releases/10/Everything/x86_64/os/Packages/compat-libstdc++-33-3.2.3-64.x86_64.rpm。安装时候,系统可能会提示已经存在更新的版本,在此情况下,可使用 如下命令进行强制安装:
rmp --force compat-libstdc++-33-3.2.3-64.x86_64.rmp

2. Fedora默认的SELINUX的安全模式会阻止Complier的安装,我们可以通过以下的命令解决:
#su
password:
#vim /etc/sysconfig/selinux
将“SELINUX=enforcing”改为“SELINUX=permissive”后保存退出。
#reboot

3. 从intel的官方网站下载l_cproc_p_11.1.059.tgz或l_cprof_p_11.1.059.tgz, 并用以下命令解压:
#tar -xzvf l_cproc_p_11.1.059.tgz
然后cd到该目录底下,执行安装的脚本文件:
#./install.sh
接着一路回车就行了。

4.设置环境变量:网友提供的方法是在非安装目录运行如下命令:
#source /bin/iccvars.sh [ia32|intel64|ia64]
or
#source /bin/iccvars.csh [ia32|intel64|ia64]
最后面的参数视OS的具体情况而定。

不过我实验的结果并不成功,我们可以采用直接添加路径的方法解决这个问题,如果你用的是bash的话,方法是在.bashrc文件中添加如下语句:
PATH=$PATH:$HOME/bin:/opt/intel/Complier/11.1/059/bin/intel64
这里/opt/intel/Complier/11.1/059/bin/intel64是icc和ifort所在的目录,请根据具体情况进行相应的修改。

5. 如果一切顺利的话,你现在应该可以利用icc和ifort进行编译了。Enjoy it~

参考资料: http://blog.sina.com.cn/s/blog_5a074c340100dqro.html
http://www.mdbbs.org/thread-19027-1-1.html

Friday, October 2, 2009

How to change the default term of Octave from Aquaterm to X11

Octave is a great sci software, which is very similar to Matlab. What makes it better than Matlab is the price 0. However, when the Octave is installed on Mac, the default term for figure output is Aquaterm. Although Aquaterm looks pretty good, one big disadvantage is that you can not close the windows by just typing ‘close’ in the terminal and you have to close them manually. Different from Aquaterm, X11 can work with Octave better. You can just use the normal Matlab way (type ‘close’ or ‘close all’) to shut windows down. How to make it? Quit simple, put the following words in ~/.profile, which you can find in your home directory.

export GNUTERM='x11'