gfortran:如何控制.mod文件的输出目录 [英] gfortran: how to control output directory for .mod files

查看:617
本文介绍了gfortran:如何控制.mod文件的输出目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法把gfortran(GCC)生成的.mod文件放到一个单独的输出目录中?我知道如何使用-o标志来放置目标文件或其他输出:

  gfortran -c test.f03 -o /path/to/output/dir/test.o 

但是.mod文件通过上述调用)不受-o标志的影响,并放置在当前目录中。一些商业编译器有一个像-qmoddir这样的标志,但是我找不到类似gfortran的东西。



如果没有这样的标志,是否可以通过额外的步骤生成.mod文件来获取-o标志?

解决方案

GNU gfortran 文档指出 -m dir 或其同义词 -J dir 指定 .mod 文件的输出目录。


Is there is a way to put .mod files, generated by gfortran (GCC), into a separate output directory? I know how to place object files or other output with the -o flag as in:

gfortran -c test.f03 -o /path/to/output/dir/test.o

But the .mod files (which are generated by the above call) are not affected by the -o flag and placed in the current directory. Some commercial compilers have a flag like -qmoddir, but I cannot find something similar for gfortran.

If there's no such flag, is it possible to generate the .mod files in an extra step to get the -o flag to work?

解决方案

The GNU gfortran documentation indicates that -Mdir or its synonym -Jdir specifies the output directory for .mod files.

这篇关于gfortran:如何控制.mod文件的输出目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆