linux下安装fortran90教程,linux

linux下安装fortran90教程,linux 安装fortran 90 --zz 安装fortran 90
1 安装前需要的⽀持
1.1 环境Ubuntu10.04系统,(如果是其他系统可以跳过第2步)
铁锰结核
1.2 安装库⽀持和alien等
sudo apt-get install build-essential
sudo apt-get install libstdc++5
sudo apt-get install alien
sudo apt-get install g++-multilib
若某步出现安装不了软件包的现象,注意了,可能是中科⼤的源没有相应的更新包,这个时候需要
更换更好的源,具体⽅法为:打开 系统——软件源,把复选框都选上,然后点击主服务器,然后点击
选择最佳服务器,会出现⼀个测试,然后会帮你选择到测试到的最好的服务器。选择好后,再终端再输⼊
上述命令继续进⾏安装。
注意:执⾏sudo apt-get install
libstdc++5时,可能出现“⽆法到软件包libstdc++5”,⾃⼰在⽹上搜索下载这个⽂件,
得到⼀个compat- libstdc++-33_3.2.3-48.3_i386.deb安装包,然后cd
到deb包所在的位置,
执⾏sudo dpkg -i compat-libstdc++-33_3.2.3-48.3_i386.deb即可
选择英特尔® Fortran 编译器 Linux* 专业版 ,然后注册,Intel会给⽤户发⼀封电⼦
邮件,其中包含⼀个协议附件。剩下的⼯作是收取邮件,然后根据邮件中提供的地址下载软件
l_cprof_p_11.1. 。
1.4 创建 /opt/intel/licenses
⽬录
sudo mkdir -p /opt/intel/licenses
1.5 把邮件附件中的.lic⽂件拷贝到
/opt/intel/licenses⽬录下
///如果能上⽹的话.lic⽂件可以不处理///
2 开始安装 fortran 90
2.1 cd
到l_cprof_p_11.1. ⽂件所在的⽬录,
然后⽤命令tar -zxvf l_cprof_p_11.1. 解压。
2.2 cd
进⼊解压后的⽂件夹,./install.sh
2.3 选择 1,typical安装
2.4 ⼀路enter下去,有yes or
no就输⼊yes,有accept or rejecet就输⼊accept。 Serial Number is
the
filename that Intel sends to your mailbox.
2.5 选择默认的安装路径即可,⼀路enter下去
2.6 若安装正常,应会提⽰安装成功;
2.7 ⽤vi编辑hello.f90
约束机制
program hello
print *,"hello fortran!"
end program hello
保存退出
抑制血亲
2.8 ⽤ifort -o
hello hello.f90编译⽂件
///注意修改
3 问题解决
但是在编译的时候 ifort -o hello
hello.f90 会提⽰:
ifort: command not
阪神地震found 按下⾯的步骤do
source /opt/intel/Compiler/11.1/069/bin/ifortvars.sh ia32
069是你⾃⼰⽂件名,因各⾃的机器不同⽽定
加⼊到 ~/.bashrc(其他Linux是~/.bash_profile⽂件) ⽂件末尾,保存退出。瓢虫科
2.9 注销,或者执⾏.
.bash_profle,使配置⽂件⽣效
测试,which ifort,会显⽰安装路径。。。。。。
3 编译执⾏
ifort -o hello hello.f90
出现⼀个hello的⽂件
运⾏./hello 结果出来了!
>上苇甸村

本文发布于:2024-09-21 22:49:51,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/444436.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:安装   选择   出现   邮件   软件   服务器   系统   下载
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议