LinuxSir.cn,穿越时空的Linuxsir!

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

[分享]gfortran的安装

[复制链接]
发表于 2006-12-9 14:14:25 | 显示全部楼层 |阅读模式
(i) Download the linux binary from http://gcc.gnu.org/wiki/GFortranBinaries 32/64bit accroding to requirements.

(ii) cd to the directory where you wish to install gfortran; let us say $mypath, which might conveniently be /home or /home/myname or /etc (or even /).

(iii) tar -zxvf $path_to_download/gfortran-linux.tar.gz This will create a directory irun, under $mypath that contains gfortran-4.2 and gcc-4.2 plus associated libraries. This will not interfere with any other compiler.

(iii) $mypath/irun/bin/gfortran --version will tests that all is well. You should see GNU Fortran 95 (GCC) 4.2.0 20060602 (experimental) Copyright (C) 2006 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of GNU Fortran under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING

(iv) I have to confess that on my solo user system, I use $mypath = "", so that the invocation is /irun/bin/gfortran You might find it cleaner to use /etc

(v) You will need to set LD_LIBRARY_FLAG or compile with -static.

(vi) Assuming that you are using bash, find your .bash_profile and add the line,

export LD_LIBRARY_PATH=$mypath/irun/lib alternatively, invoke bash at the command line and enter this previous line.

You should have an operational gfortran by now. I just went through this process, with $mypath set to /tmp and it worked just fine.

转自http://gcc.gnu.org/wiki/GFortranBinaries32Linux

希望对有需要的人有所帮助
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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