【发布时间】: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 gcc和brew install open-mpi。两者都通过正确的符号链接文件路径以brew link gcc和brew link open-mpi链接到brew。然后我运行brew cleanup。最后mpif90 test.f90 -o ./test返回错误/opt/local/bin/gfortran: invalid option -- I Usage: gcov [OPTION]... SOURCE|OBJ...(如上图)。