Linux 安装 Fortran 环境的简明步骤
一 安装编译器
| 发行版/系列 | 包管理器与命令 |
|---|---|
| Debian/Ubuntu | sudo apt-get update && sudo apt-get install gfortran |
| Fedora | sudo dnf install gcc-gfortran |
| CentOS/RHEL | sudo yum install gcc-gfortran |
二 编写与运行第一个程序
program hello
print *, "Hello, World!"
end program hello
gfortran hello.f90 -o hello
./hello
三 可选组件与进阶
四 常见问题与排查