如何可视化 Fortran(90 或更高版本)源代码,例如使用 Graphviz? [英] How can I visualize Fortran (90 or later) source code, e.g. using Graphviz?

查看:25
本文介绍了如何可视化 Fortran(90 或更高版本)源代码,例如使用 Graphviz?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我被投入到一个包含大量源文件的大型 Fortran 项目中.

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.

作为第一步,我想可视化各种源文件之间的相互依赖关系,即哪些源文件需要哪些模块.据我所知,其他语言也存在自动化方法,并生成可以使用 Graphviz 构建的图形.

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.

但是有人知道可以为 Fortran 90 代码执行此操作的软件吗?

But is anyone aware of software out there that can do this for Fortran 90 code?

[在互联网上搜索 Fortran 帮助真的很痛苦,因为由于痛苦无处不在的 FORTRAN 77,您最终要搜索互联网上的蜘蛛网.]

[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.]

推荐答案

如果你有钱那么 了解 Fortran 值得一看.如果您没有钱但打算快速工作,那么您可以通过试用下载该软件来解决问题.

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 :-(

对于动态调用图,请调查您的编译器选项.我使用英特尔 Fortran 编译器,它可以生成大量有关正在执行的程序的有用信息.TotalView 调试器还可以可视化执行程序的调用图.您还应该查看 gprof2dot 它从 GPROF 调用中生成 DOT 文件图形'.这是免费的,没问题.

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.

我还应该补充一点,虽然它不是我曾经使用过的东西,但 Callgrind可能有用.

And I should also add, though it's not something I've ever used, that Callgrind may be of use.

这篇关于如何可视化 Fortran(90 或更高版本)源代码,例如使用 Graphviz?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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