微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

gfortran make 函数出错:选项无效——我

如何解决gfortran make 函数出错:选项无效——我

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

 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>.

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

解决方法

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。