如何可视化Fortran(90或更高版本)的源代码,例如使用Graphviz? [英] How can I visualize Fortran (90 or later) source code, e.g. using Graphviz?
问题描述
我需要为这个项目做出贡献,我认为我应该谨慎行事首先了解源代码。
作为第一步,我想要显示各种源文件之间的相互依赖关系,即哪些源文件需要哪些模块。据我所知,自动化方法存在于其他语言,并产生一个图形,可以使用Graphviz构建。
但是有谁知道那里的软件可以为Fortran 90代码做这件事?
[由于无处不在的FORTRAN 77,搜索interwebs的Fortran帮助是一个真正的痛苦,因为你最终搜索到了inter-cobwebs。 ]
如果你有钱,那么了解Fortran 值得一看。如果你没有钱,但打算快速工作,那么你可以通过试用软件下载。
对于静态调用图,我从来没有发现一个免费的工具和Understanding一样有用;很难找到任何免费工具,更不用说有用的工具了。我会自己写一个,但市场会很小: - (
)对于动态调用图调查编译器选项,我使用英特尔Fortran编译器,它可以生成有关正在执行的程序的有用信息。TotalView调试器还可以显示正在执行的程序的调用图。您还应该查看 gprof2dot 这使得一个DOT文件脱离了GPROF调用'graph'。这是免费的,OK。
我应该还补充说,虽然这不是我曾经使用过的,但可以使用 Callgrind 。
I've been thrown into a large Fortran project with a large number of source files.
I need to contribute to this project and it would seem prudent that I first understand the source.
As a first step, I'd like to visualize the interdependences between the various source files, i.e. which source files need which modules. As far as I can tell, automated methods exist for other languages and result in a graph that can be built using Graphviz.
But is anyone aware of software out there that can do this for Fortran 90 code?
[Searching the interwebs for Fortran help is a real pain as you end up searching the inter-cobwebs thanks to the painfully ubiquitous FORTRAN 77.]
If you have money then Understand for Fortran is worth looking at. If you don't have money but intend to work quickly then you might get by with a trial download of the software.
For a static call graph, I've never found a free tool as useful as Understand; it's hard to find any free tools let alone a useful one. I'd write one myself but the market would be tiny :-(
For a dynamic call graph investigate your compiler options. I use the Intel Fortran Compiler which can generate a mound of useful information about an executing program. The TotalView debugger can also visualise the call graph of an executing program. You should also look at gprof2dot which makes a DOT file out of a GPROF call 'graph'. This is free and OK.
And I should also add, though it's not something I've ever used, that Callgrind may be of use.
这篇关于如何可视化Fortran(90或更高版本)的源代码,例如使用Graphviz?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!