手机版
你好,游客 登录 注册
背景:
阅读新闻

SUSE 11 sp2 安装 gcc-gfortran for

[日期:2012-07-22] 来源:Linux社区  作者:muzirui [字体:大 中 小]

1. 下载gfortran  (Download the GFortran binary)

   gcc-4.3.tar.xz

2. 解压缩到 /(Go into directory under which you want to put GFortran)

  #/opt/gcc-4.3
  # xz -d gcc-4.3.tar.xz
  # tar xvf gcc-4.3.tar

  (Unpack the package using tar xvfz gcc-trunk-x86_64.tar.gz, which unpacks it into the directory gcc-trunk. )

3. 设置环境变量

  # vim .profile
  (在文件的最后添加两行!)
  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/gcc-4.3/lib64
  export PATH=$PATH:/opt/gcc-4.3/bin

  # source .profile 

  *  fortran 编译器位于         /opt/gcc-4.3/bin/gfortran
      执行过程需要的库文件位于     /opt/gcc-4.3/lib64

4. 检验
  # vim exma.f90

program ABC
A=9.0
B=45
write(*,*) A*B
stop
end

  # gfortran exma.f90 -o l123
  # ./l123

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款