温馨提示×

ubuntu如何编译fortran代码

小新
1084
2021-02-19 12:02:22
栏目: 智能运维
Ubuntu服务器限时活动,0元免费领,库存有限,领完即止! 点击查看>>

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

亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

推荐阅读:Ubuntu如何安装Fortran编译器

0