Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio and FORTRAN working together?

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.

like image 781
Alex Hope O'Connor Avatar asked Apr 11 '11 05:04

Alex Hope O'Connor


People also ask

Can you use Fortran in Visual Studio?

Lahey Fortran Visual Studio Fortran Support integrates with Visual Studio to allow these features to be used with Fortran programs. The Visual Studio development environment can seem intimidating at first glance, however it is quite easy to use, once you are aquainted with it.

Can I use VS code for Fortran?

The Fortran extensions for VS Code provides support for syntax highlighting, IntelliSense, and debugging.


1 Answers

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.

like image 71
Wildcat Avatar answered Sep 19 '22 03:09

Wildcat