我如何设置linux来将FORTRAN代码编译为Windows二进制文件? [英] How can I setup linux to compile FORTRAN code into windows binaries?

查看:139
本文介绍了我如何设置linux来将FORTRAN代码编译为Windows二进制文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个FORTRAN项目,我想在一台专门用于自动构建的Linux机器上构建所有我想要维护的二进制文件。我已成功地使用 mingw 在Linux机器上使用以下软件包从C源代码构建32位和64位二进制文​​件。

  apt-get install mingw32 
apt-get install mingw-w64

然后我运行以下命令来实际编译:

  gcc -b amd64-mingw32msvc -V 4.4.4 -o< ...其他选项> 

然而,我通过apt-get获得的 mingw 不包括FORTRAN编译器。



任何人对我能做什么有什么想法? 您可以随时从MinGW(-w64)项目本身下载并安装预构建的编译器:

Windows 64位: http://sourceforge.net/projects/mingw-w64/files /Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/4.6.2-1/
Windows 32位: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/ Personal%20Builds / rubenvb / 4.6.2-1 /

只需在某处解压并添加 cross * / bin 目录转换为PATH。



我包含(obj)c(++)和fortran。

I'm working on a FORTRAN project and I would like to build all of the binaries that I want to maintain on a linux machine that is dedicated for automated builds. I have successfully used mingw to build 32-bit and 64-bit binaries from C source for windows machines on the linux machine with the following packages on Ubuntu.

apt-get install mingw32
apt-get install mingw-w64

Then I run the following commands to actually compile:

gcc -b amd64-mingw32msvc -V 4.4.4 -o <...other options>

However, the mingw packages that I've obtained via apt-get do not include FORTRAN compilers.

Anybody got any ideas on what I can do?

解决方案

You can always download and install a prebuilt compiler from the MinGW(-w64) project itself:

Windows 64-bit: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/4.6.2-1/ Windows 32-bit: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/4.6.2-1/

Just unpack somewhere and add the cross*/bin directory to PATH.

I include (obj)c(++) and fortran.

这篇关于我如何设置linux来将FORTRAN代码编译为Windows二进制文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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