use*_*259 2 fortran intel-fortran
我正在尝试在 Ubuntu20 上安装 ifort 编译器。我从以下网站下载了安装文件:intel
这是一个扩展名为 .sh 的文件,我将其设为可执行文件:
Downloads$ chmod +x l_fortran-compiler_p_2021.1.2.62_offline.sh
Downloads$ ./l_fortran-compiler_p_2021.1.2.62_offline.sh
Run Code Online (Sandbox Code Playgroud)
这打开了软件安装程序:
但是,我无法使用 ifort 编译器。例子:
ifort -o name name.for
Run Code Online (Sandbox Code Playgroud)
它给出以下消息:
Command 'ifort' not found, did you mean:
command 'fort' from deb fort-validator (1.2.0-1)
command 'isort' from deb isort (4.3.4+ds1-2)
Try: sudo apt install <deb name>
Run Code Online (Sandbox Code Playgroud)
我需要安装 intel ifort 编译器,因为如果使用 -fast 选项编译,可执行文件会更快。
文档中说了如何设置环境:
For root or sudo installations:
. /opt/intel/oneapi/setvars.sh
For normal user installations:
. ~/intel/oneapi/setvars.sh
Run Code Online (Sandbox Code Playgroud)
您可以将它们放入您的 bash 配置文件或 bashrc 中。