ubuntu如何编译fortran代码

lewis 2019-11-13 24次阅读

ubuntu编译fortran代码的方法:

1.将编译器intel fortran安装好。

2.写一个fortran测试程序,例如:“hello.f90”,代码如下。


program main


write(*,*) "hello"


stop


end


3.使用以下命令进行编译。


ifort -c hello hello.f90


注:编译后生成可执行文件hello 如果直接用ifort hello.f90,则默认生成文件是a.out

4.执行可执行文件,在当前目录下输入以下命令查看结果。


./hello

#或者

./a.out





发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。