【问题标题】:Error in gfortran make function: invalid option -- Igfortran make 函数中的错误:无效选项——I
【发布时间】:2021-01-25 18:37:38
【问题描述】:

我有以下简单的代码运行与链接到 gcc 和 openmpi 的 brew:

 mpif90 test.f90 ./test 

返回如下错误:

 /opt/local/bin/gfortran: invalid option -- I
 Usage: gcov [OPTION]... SOURCE|OBJ...

 Print code coverage information.

   -h, --help                      Print this help, then exit
   -a, --all-blocks                Show information for every basic block
   -b, --branch-probabilities      Include branch probabilities in output
   -c, --branch-counts             Output counts of branches taken
                                rather than percentages
   -d, --display-progress          Display progress information
   -f, --function-summaries        Output summaries for each function
    -i, --intermediate-format       Output .gcov file in intermediate text format
     -l, --long-file-names           Use long output file names for included
                                source files
     -m, --demangled-names           Output demangled function names
     -n, --no-output                 Do not create an output file
     -o, --object-directory DIR|FILE Search for object files in DIR or called FILE
     -p, --preserve-paths            Preserve all pathname components
     -r, --relative-only             Only show data for relative sources
     -s, --source-prefix DIR         Source prefix to elide
     -u, --unconditional-branches    Show unconditional branch counts too
     -v, --version                   Print version number, then exit

   For bug reporting instructions, please see:
   <https://trac.macports.org/newticket>.

我不确定问题是什么。有什么想法吗?谢谢。

【问题讨论】:

  • 你想用mpif90 test.f90 ./test做什么?您是否缺少-o./test 源/链接对象?
  • @facescalus 带有-o,错误仍然出现。 ./test 是可执行文件。
  • mpif90 test.f90 -o ./test?如果这给出了您在上面给出的输出,那么尝试重新安装可能会很好。您是如何为 Open MPI 安装和配置环境的?
  • @fancescalus 我用brew install open-mpi 重新安装了openmpi,这就是我为配置它所做的全部工作。
  • @facescalus 我已将环境安装并更新为brew install gccbrew install open-mpi。两者都通过正确的符号链接文件路径以brew link gccbrew link open-mpi 链接到brew。然后我运行brew cleanup。最后mpif90 test.f90 -o ./test返回错误/opt/local/bin/gfortran: invalid option -- I Usage: gcov [OPTION]... SOURCE|OBJ...(如上图)。

标签: gcc gfortran openmpi


【解决方案1】:

问题是其他/bin/ 目录有旧版本的gcc 和openmpi。更新时,需要将来自/lib/ 目录的新文件传输到/Cellar/ 目录。当第一次卸载所有旧的 macport 和编译器时,问题已得到解决,其中文件和/或路径不正确,如 sudo port -fp uninstall installedbrew uninstall openmpibrew uninstall gcc。然后重新安装新的自制编译器brew install gccbrew install openmpi。这会在提交 make 文件时提供配置文件的正确路径。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-12
    • 1970-01-01
    • 1970-01-01
    • 2015-09-06
    • 2018-08-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多