compilation - 使用外部库编译 Fortran 时,“无法打开模块文件,没有这样的文件或目录”
问题描述
我目前正在尝试使用应该位于动态库 libfckit.so 中的模块来编译 Fortran 90 代码。到目前为止,我的代码是:
program debug
use fckit_mpi_module
end program debug
对于编译步骤,我使用以下命令:
mpifc -I/path/to/the/lib debug_fckit.f90 -o debug_fckit.exe
我收到以下错误:
use fckit_mpi_module
1
Fatal Error: Can't open module file ‘fckit_mpi_module.mod’ for reading at (1): No such file or directory
我知道这是 Fortran 中的常见错误,我搜索了谷歌,但没有找到任何令人满意的解决方案。
解决方案
感谢 Vladimir 和 Evets 的评论帮助我解决了这个问题。我刚刚添加了模块 fckit_mpi_module.mod 和库 libfckit.so 所在目录的路径。所以现在我编译代码的命令是:
mpifc -I/path/to/the/directory/where/the/module/fckit_mpi_module.mod/is -l/path/to/the/directory/where/the/library/lifckit.so/is debug.fckit.f90 -o debug_fckit
希望这可以帮助像我这样的其他菜鸟。
推荐阅读
- python - 为什么这个函数的 __dict__ 属性是一个空字典?
- linux - 在 Fedora 上调用 GNOME 失败对话框的可执行文件在哪里?
- scheduled-tasks - 如何使用 Quartz 安排作业在一天内多次但固定的时间运行
- z3 - 有人可以帮助在 SMT 求解器 Z3 中对这个函数(多项式函数)进行建模吗?
- flutter - 检查是否连接到 WiFi(即使没有互联网)或移动数据
- git - VS2019:推送到远程存储库时遇到错误:Git 失败并出现致命错误。无法访问
- javascript - 如何获取上一页点击按钮的值
- reactjs - React TypeScript:如何将多个文件设置为状态?
- node.js - 在浏览器中与在 Node 应用程序上使用 JSRender 的“空传播运算符”之间的区别
- javascript - 异步消息还是(消息)?- 不和谐.js