如何可视化 Fortran(90 或更高版本)源代码,例如使用Graphviz?

编程入门 行业动态 更新时间:2024-10-24 10:18:12
本文介绍了如何可视化 Fortran(90 或更高版本)源代码,例如使用Graphviz?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我被投入到一个包含大量源文件的大型 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 77,在互联网上搜索 Fortran 帮助是一种真正的痛苦,因为您最终会搜索网络间的蜘蛛网.]

[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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-01 09:49:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/828276.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:源代码   或更高   版本   Fortran   Graphviz

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!