Compiling the Fortran.dll file system in Windows 7 (free)?

My boss just asked me to integrate the old boss of the old Fortran code into the project (Java) I'm working on. The code was written in the 90s, so I assume that it will compile anyway, so instead of rewriting it, I hope that I can just call functions from .dll. I am already invoking some C.dll, so I think I have this part.

I'm reading, and most articles talk about integrating Intel Visual Fortran Compiler with Microsoft Visual Studio. We have a university site license for Visual Studio, but it looks like the Intel Visual Fortran compiler is around $ 700. I don’t think my boss will do this, so I’m looking for another option. I know that Microsoft provides many products that are freely available to students through Project Dreamspark, but I have not seen anything related to Fortran.

I'm looking at some cygwin based options right now (g95, I think), but I'm looking for other ideas / options. Any ideas?

+4
source share
4 answers

I used the gfortran compiler (g95) with the -shared flag to create the DLL. first compile .for / .f90 files with:

gfortran -c myfile1.f90 gfortran -c myfile2.f90 

then

 gfortran -shared -o mydll.dll myfile1.o myfile2.o 
+9
source

MinGW allows you to create a DLL that will work with your MS materials.

+3
source

Look at the GCC port for Windows, such as Mingw or GCW . Both of them will create .obj files that can be associated with Visual Studio. Or you can futz around and configure VS to call one of these command line compilers into the project. But since the code is relatively static, it can be a nice compilation once and hopefully forget about it.

+2
source

Don't expect much help from Microsoft at Fortran. They spent years trying to kill him in favor of Visual Basic / C.

You can try the Silverfrost compiler.

http://www.silverfrost.com/11/ftn95/ftn95_fortran_95_for_windows.aspx

It is available for free (personal edition) and works with Visual Studio. This is basically an F90 / F95 compiler with a bunch of extra features. You did not say whether the code of the old boss was written in F77 or F90. But I think Silverfrost will handle the old code with minimal changes.

If this helps you, there will also be an academic version and a corporate version available for promotion as desired.

+1
source

Source: https://habr.com/ru/post/1397690/


All Articles