intel Fortran Compiler WARNING: setvars.sh has already been run. Skipping re-execution

将下列命令添加到bashrc中:

source /opt/intel/oneapi/setvars.sh

运行程序,然而,这是我在终端中得到的:

:: WARNING: setvars.sh has already been run. Skipping re-execution.
   To force a re-execution of setvars.sh, use the '--force' option.
   Using '--force' can result in excessive use of your environment variables.
  
usage: source setvars.sh [--force] [--config=file] [--help] [...]
  --force        Force setvars.sh to re-run, doing so may overload environment.
  --config=file  Customize env vars using a setvars.sh configuration file.
  --help         Display this help message and exit.
  ...            Additional args are passed to individual env/vars.sh scripts
                 and should follow this script's arguments.
  
  Some POSIX shells do not accept command-line options. In that case, you can pass
  command-line options via the SETVARS_ARGS environment variable. For example:
  
  $ SETVARS_ARGS="ia32 --config=config.txt" ; export SETVARS_ARGS
  $ . path/to/setvars.sh
  
  The SETVARS_ARGS environment variable is cleared on exiting setvars.sh.
  

进一步查看版本号:

rudi@landau|~>ifort -V
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.5.0 Build 20211109_000000
Copyright (C) 1985-2021 Intel Corporation.  All rights reserved.

rudi@landau|~>icc -V
Intel(R) C Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.5.0 Build 20211109_000000
Copyright (C) 1985-2021 Intel Corporation.  All rights reserved.

可以看到仍在访问旧版本的Fortran和C编译器。
此外,当终端打开时,还会出现额外的警告。自OneAPI套件开始以来,发出了第一个警告(setvars.sh已经运行)。

看到的错误是如果setvars.sh运行了两次会发生什么。检查你的.bashrc、.login、.profile,换句话说,检查你所有的“dot”文件,看看你是否将“source/opt/intel/oneapi/setvars.sh”放入其中一个点文件中,这些点文件会在你登录时被调用。您可以在登录后立即检查您的PATH。如果你看到oneapi工具的路径,你就会知道它的来源是setvars.sh。避免重复调用!

猜你喜欢

转载自blog.csdn.net/m0_46808930/article/details/129830558