可以的,Ubuntu 完全可以用来写和编译 Fortran 程序。下面给你一个简单清晰的说明:
文本编辑器(任选)
gedit(自带)vim / nanoFortran 编译器 最常见的是:
gfortran(GNU Fortran,免费、常用)ifort(Intel Fortran,商业,性能强)在终端中执行:
sudo apt update
sudo apt install gfortran
安装完成后检查:
gfortran --version
创建文件 hello.f90:
program hello
print *, "Hello, Fortran on Ubuntu!"
end program hello
gfortran hello.f90 -o hello
./hello
输出:
Hello, Fortran on Ubuntu!
Ubuntu + Fortran 常用于:
make / CMake 管理项目OpenMP 做并行numpy / f2py)调用 Fortran如果你愿意,我可以:
你打算用 Fortran 做什么?