Wave Watch 3 Fortran 编译问题
我刚刚设置了新的 WW3,并编译并运行了测试用例 ctest
,效果很好。
然后,当我尝试编译并链接其中一个主程序时,我收到以下错误消息:
-----------------------------------------------
----compiling WAVEWATCH III----
-----------------------------------------
Scratch Directory : /home/ww3/scratch
Save source codes : yes
Save listings : yes
Processing ww3_grid
---------------------
ad3 : processing w3servmd
w3servmd.mod
ad3 : processing w3gdatmd
*** compile error ***
file w3gdatmd.o not found
mv: cannot stat `w3gdatmd.o': No such file or directory
make: *** [/home/ww3/obj/w3gdatmod.o] Error 5
**********************
*** end of compilation ***
**********************
因此它将 w3servmd.ftn
正确转换为 w3servmd.f90
然后成功编译并生成 w3servmd.mod
并将其放置在 /mod
目录中。
下一步是编译 w3gdatmd.f90,但在该文件的错误脚本中显示:
“无法打开 w3servmd.mod 进行读取,没有这样的文件或目录”
但是w3servmd.mod
存在!
所以我认为 comp
代码中可能存在错误,它没有指向 /mod
文件夹中的 .mod
文件。
事情在 comp
文件中,它指出:
“确保编译器指向存储模块的正确目录 ($m_path),请参阅下面的示例。”
但我根本看不到它在下面的代码中的位置。 有什么提示吗?
I'm just setting up the new WW3 and have compiled and run the test case ctest
and that works fine.
Then when I try and compile and link one of the main programs I get the following error message:
-----------------------------------------------
----compiling WAVEWATCH III----
-----------------------------------------
Scratch Directory : /home/ww3/scratch
Save source codes : yes
Save listings : yes
Processing ww3_grid
---------------------
ad3 : processing w3servmd
w3servmd.mod
ad3 : processing w3gdatmd
*** compile error ***
file w3gdatmd.o not found
mv: cannot stat `w3gdatmd.o': No such file or directory
make: *** [/home/ww3/obj/w3gdatmod.o] Error 5
**********************
*** end of compilation ***
**********************
So it converts w3servmd.ftn
correctly to w3servmd.f90
and then succesfully compiles and produces w3servmd.mod
and places this in a /mod
directory.
The next step is to compile w3gdatmd.f90
, but in the error script for this file is says:
"can't open w3servmd.mod for reading, no such file or directory"
But w3servmd.mod
exists!
So I'm thinking there maybe an error in the comp
code with it not directing to the /mod
folder for .mod
files.
The thing is in the comp
file it states:
"make sure the compiler point to the proper directory where the modules are stored ($m_path), see examples below."
But I can't see where this is in the code below this at all.
Any hints?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我熟悉的大多数 Fortran >=90 编译器都会在当前目录中创建输出文件:对象、模块和可执行文件。然后在该目录中的源文件的附加编译步骤很容易找到以前制作的模块文件。是将模块文件移动到目录 /mod 的脚本吗?那么这是一个关于脚本或特定编译器的问题——如何告诉编译器它也应该在 /mod 中查找模块。由于脚本正在将文件移动到那里, $m_path 是否已设置?也许他们建议您应该使用编译器选项来使编译器查看此目录。 gfortran 提供选项 -M 和 -J (等效):“此选项指定将已编译模块的 '.mod' 文件放置在何处。它还会添加到 USE 语句要搜索的目录列表中。默认为当前目录”。您使用哪个编译器?
Most Fortran >=90 compilers that I am familiar with create their output files in the current directory: object, module and executable. Then additional compilation steps of source files in the directory easily find previously made module files. Is the script that you have moving the module files to the directory /mod? Then this is a question about the script or the specific compiler -- how to tell the compiler that it should also look in /mod for the modules. Is $m_path already set since the script is moving the files there? Maybe they are suggesting that you should use a compiler option to cause the compiler to look into this directory. gfortran provides options -M and -J (equivalent): "This option specifies where to put ‘.mod’ files for compiled modules. It is also added to the list of directories to searched by an USE statement. The default is the current directory." Which compiler are you using?