在Windows 7上编译Fortran .dll(免费)? [英] Compiling a Fortran .dll on Windows 7 (for free)?

查看:209
本文介绍了在Windows 7上编译Fortran .dll(免费)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的老板只是要求我将老的老Fortran代码集成到我正在开发的项目(Java)中。代码是在90年代写的,所以我想它仍然会编译,所以,而不是重写它,我希望我可以从一个.dll调用函数。我已经调用了一些C .dlls,所以我想我已经覆盖了这一部分。

My boss just asked me to integrate his bosses old Fortran code into a project (Java) I'm working on. The code was written in the 90s, so I imagine it'll still compile, so rather than re-write it, I'm hoping I can just call the functions from a .dll. I'm already calling some C .dlls, so I think I've got that part covered.

我一直在做一些阅读,大多数文章关于将英特尔Visual Fortran编译器集成到Microsoft Visual Studio中。我们有一个Visual Studio的大学网站许可证,但它看起来像英特尔Visual Fortran编译器是在大约700美元的范围。我不认为我的老板会去的,所以我正在寻找另一个选择。我知道微软通过Project Dreamspark向学生免费提供了很多产品,但我没有看到任何Fortran相关。

I've been doing some reading, and most of the articles talk about integrating the Intel Visual Fortran Compiler into Microsoft Visual Studio. We've got a university site license for Visual Studio, but it looks like the Intel Visual Fortran Compiler is in around the $700 range. I don't think my boss will go for that, so I'm looking for another option. I know Microsoft makes a lot of products freely available to students via Project Dreamspark, but I didn't see anything Fortran related.

我正在看一些基于cygwin的选项现在(g95,我想),但我正在寻找其他的想法/选项。任何想法?

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

推荐答案

我使用gfortran(g95)编译器与-shared标志创建DLL。首先使用以下命令编译.for / .f90文件:

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

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

然后:

gfortran -shared -o mydll.dll myfile1.o myfile2.o

这篇关于在Windows 7上编译Fortran .dll(免费)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆