温馨提示×

ubuntu如何编译fortran代码

小新
1074
2021-02-19 12:02:22
栏目: 智能运维

ubuntu如何编译fortran代码

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



0