简体   繁体   English

我可以在不重新创建 .mod 文件的情况下编译 f90

[英]Can I compile f90 without recreating .mod files

I am a newbie in fortran and I am trying to understand all I need for the compilation.我是 fortran 的新手,我试图了解编译所需的一切。 Until now everything is good but there is something I don't get.到目前为止,一切都很好,但有些东西我没有得到。 Supposing that I modify the code but my modifications wouldn't change the content of the .mod files, am I able to compile and create the object file without recreating the .mod file, and if yes how should I do it.假设我修改了代码但我的修改不会改变 .mod 文件的内容,我是否能够在重新创建 .mod 文件的情况下编译和创建目标文件,如果是,我应该怎么做。 I tried to search on the internet but I didn't really manage to find the answer.我试图在互联网上搜索,但我并没有真正找到答案。 By the way, I am using gfortran.顺便说一句,我正在使用gfortran。 Thank you in advance and I am sorry if the answer already exists (I couldn't find it).预先感谢您,如果答案已经存在,我很抱歉(我找不到)。

As you're using gfortran, the compiler already does this for you.当您使用 gfortran 时,编译器已经为您完成了这项工作。 When compiling a module, it will create the .mod file under a temporary name, then it will compare checksums between the existing .mod file (if it exists) and the new one, and replace the existing one with the new one only if the checksums differ.编译模块时,它会以临时名称创建.mod文件,然后它会比较现有.mod文件(如果存在)和新文件之间的校验和,并仅在以下情况下将现有文件替换为新文件校验和不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM