Visual Studio 和 FORTRAN 一起工作吗?
我最近开始从事一个项目,该项目基本上是 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,你可以。但我认为你需要购买一个与 VS 集成的商业编译器。
我知道至少有3个选择。 英特尔® Fortran Composer 和 PGI Visual Fortran® 可以生成本机代码和Silverfrost FTN95< /a> 可以生成.NET 程序集(它支持.NET 4.0)。
但如果您已经有控制台应用程序,我实际上建议保持原样。不要创建 DLL,只需将 GUI 应用程序编写为控制台后端的一种前端即可。 GUI 前端应该能够生成输入文件并分析输出文件。
从我的角度来看,这种方式更加灵活。例如,将来您可以轻松地在 *nix 集群上使用控制台后端。或者一些有经验的用户可以在控制台后端使用脚本...
您还可以使用户可以从 GUI 应用程序将此生成的输入文件提交到控制台后端(创建新进程)。 GUI 应用程序将等待进程完成,然后分析输出。但后端和前端如此紧密的集成是没有必要的。
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).
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.