gpt4 book ai didi

fortran - 编译器不识别标志

转载 作者:行者123 更新时间:2023-12-01 14:38:38 28 4
gpt4 key购买 nike

我刚开始使用 FORTRAN,我想编译一个程序。这是我在命令行中编写 make 后从编译器收到的内容。

mpif77 -c                    -mcmodel=medium -i-dynamic -no-ipo -r8 -xW -traceback     -O2                    ../agile/agile_parameter_module.f
gfortran: error: unrecognized command line option ‘-i-dynamic’
gfortran: error: unrecognized command line option ‘-no-ipo’
gfortran: error: unrecognized command line option ‘-r8’
gfortran: error: unrecognized command line option ‘-traceback’

我已经下载并安装了英特尔 Fortran 编译器的试用版,但 make 仍然使用 gfortran,我收到了该消息。

最佳答案

您正在使用的 mpif77 包装器已为 gfortran 配置,它不理解 ifort 的选项。如果您没有适用于 Intel Fortran 的集群工具,您将不会拥有它们的 MPI 包装器 mpiifort,并且必须配置 openmpi 才能使用 ifort。

如果你想避免编译 openmpi 来为 ifort 设置它,你可以尝试使用 ifort 的 gfortran 的 MPI 包装器,如下所示:

ifort <ifort command line arguments> `mpif77 -showme:compile`

编译步骤和

ifort <ifrot command line arguments> `mpif77 -showme:link`

链接步骤。

如果这些不能直接工作,您可以查看 mpif77 发出的选项,并根据需要为 ifort 修改它们。这是一个权宜之计,只是为了构建您的软件,但对于长期解决方案,您应该正确设置 openmpi 以使用 ifort。

关于fortran - 编译器不识别标志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33507835/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com