Visual Studio 和 FORTRAN 一起工作吗?

发布于 2024-10-31 12:26:10 字数 288 浏览 2 评论 0原文

我最近开始从事一个项目,该项目基本上是 FORTRAN 控制台应用程序的 GUI,该应用程序在数据集上运行一系列模拟。

我想要做的是能够修改这个 FORTRAN 代码并将其编译为 .dll,这样我就可以通过 DLL 导入之类的东西直接将数据传递给它。

所以我想知道,你能在 Visual Studio 2010 中建立一个 FORTRAN 项目吗?就像能够编译和调试代码一样?

直接调用编译的 FORTRAN .dll 文件有什么负面影响吗?比如限制参数数据类型/返回数据类型?

谢谢, 亚历克斯.

I have recently started working on a project which is basically a GUI for a FORTRAN console application which runs a series of simulations on a data set.

What I want to do is be able to modify this FORTRAN code and compile it as a .dll so I can pass the data to it directly through a DLL import sort of thing.

So I was wondering, can you set up a FORTRAN project in Visual Studio 2010? As in being able to compile and debug the code?

And is there anything negatives associated with making direct calls to compiled FORTRAN .dll file? Such as limited paramater data types/return data types?

Thanks,
Alex.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

春夜浅 2024-11-07 12:26:10

所以我想知道,你能在 Visual Studio 2010 中建立一个 FORTRAN 项目吗?就像能够编译和调试代码一样?

是的,你可以。但我认为你需要购买一个与 VS 集成的商业编译器。

我知道至少有3个选择。 英特尔® Fortran ComposerPGI Visual Fortran® 可以生成本机代码和Silverfrost FTN95< /a> 可以生成.NET 程序集(它支持.NET 4.0)。

直接调用已编译的 FORTRAN .dll 文件有什么负面影响吗?比如限制参数数据类型/返回数据类型?

但如果您已经有控制台应用程序,我实际上建议保持原样。不要创建 DLL,只需将 GUI 应用程序编写为控制台后端的一种前端即可。 GUI 前端应该能够生成输入文件并分析输出文件。

从我的角度来看,这种方式更加灵活。例如,将来您可以轻松地在 *nix 集群上使用控制台后端。或者一些有经验的用户可以在控制台后端使用脚本...

您还可以使用户可以从 GUI 应用程序将此生成的输入文件提交到控制台后端(创建新进程)。 GUI 应用程序将等待进程完成,然后分析输出。但后端和前端如此紧密的集成是没有必要的。

So I was wondering, can you set up a FORTRAN project in Visual Studio 2010? As in being able to compile and debug the code?

Yes, you can. But I think you need to buy a commercial compiler with integration to VS.

I know at least 3 options. Intel® Fortran Composer and PGI Visual Fortran® can produce native code and Silverfrost FTN95 can produce .NET assemblies (it supports .NET 4.0).

And is there anything negatives associated with making direct calls to compiled FORTRAN .dll file? Such as limited paramater data types/return data types?

But if you already have console application than I actually recommend keep it like it is. Don't create DLL, just write you GUI application as a kind of front-end for your console back-end. You GUI front-end should be able to generate input files and analyze output files.

From my point of view this way is much more flexible. In the future you can easily use you console back-end on *nix cluster, for example. Or some experienced users can use scripting around console back-end...

You can also make it possible for user to submit this generated input file to the console back-end (creating a new process) from your GUI app. GUI app will wait for process to finish and then analyze output. But such tight integration of back-end and front-end is not necessary.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文