Debian主要通过**GNU Fortran(gfortran)**支持Fortran编程,具体版本随Debian发行版及GCC版本更新而变化,主流支持的版本包括:
安装方式:
通过Debian包管理器安装时,默认获取最新稳定版gfortran,例如:
sudo apt update
sudo apt install gfortran
若需特定版本(如gfortran-9、gfortran-10),可指定包名安装,例如:
sudo apt install gfortran-9 # 安装Fortran 9对应版本
版本切换:
若安装多个版本,可通过update-alternatives
工具切换默认版本,例如:
sudo update-alternatives --config gfortran
其他编译器:
Debian也支持通过源码编译安装Intel Fortran、NAG Fortran等商业编译器,但需自行处理依赖和配置。
注:具体支持的Fortran标准取决于所安装的GCC版本,可通过gfortran --version
查看当前版本支持的详细标准。