简体   繁体   English

在Windows下使用Ifort for Linux编译Fortran

[英]Compiling Fortran using Ifort for Linux under Windows

I develop an run some Fortran Code under Windows (7, 64bit) using Visual Stuido 2010 and ifort. 我使用Visual Stuido 2010和ifort开发了在Windows(7、64位)下运行一些Fortran代码的方法。

The Code, mostly compiled to DLL, is tested in Windows and is deployd approx. 该代码主要编译为DLL,已在Windows中进行了测试,并大约部署了。 25% of the time to Windows (2000 up to 7) and 75% to Suse Linux. 使用Windows的时间的比例为25%(2000年最多为7),使用Suse Linux的时间为75%。 While the Windows solution is completly handeld by me the Linux "branch" is compiled by someone other (it is 100% the same Code). Windows解决方案由我完全使用,而Linux“分支”则由其他人进行编译(这是100%相同的代码)。 The Linux branch is compiled with the g95/NAG Compiler. Linux分支使用g95 / NAG编译器进行编译。

Due to some decissons out of our control we will change from NAG to gfortran. 由于无法控制的决定,我们将从NAG改为gfortran。 After some test we found the Code compiled with gfortran (and some optimisation like -o2) to take about double the time to finish compared to Windows and ifort (no optimisation, full Debug). 经过一些测试,我们发现用gfortran编译的代码(以及诸如-o2之类的一些优化)与Windows和ifort(无优化,完整的调试)相比,花费了大约两倍的时间来完成。 We had a chance to compile the code under linux and ifort and got about the speed of Windows + ifort. 我们有机会在linux和ifort下编译代码,并获得了Windows + ifort的速度。
(NAG compiled code is somewhere in between) (NAG编译的代码介于两者之间)

For obvious reasons we would like to compile the code with ifort for Windows and Linux, so: 出于明显的原因,我们希望使用适用于Windows和Linux的ifort编译代码,因此:

Is it possible to compile for Suse Linux under Windows with ifort (using cmd or VS 2010)? 是否可以使用ifort(使用cmd或VS 2010)在Windows下针对Suse Linux进行编译?

I'll answer for Intel - no, you can't compile for Linux in Windows (except using a VM in which case you are really running Linux, as stated above.) A VM is a reasonable approach, but you'll have to buy a separate license for ifort on Linux. 我会为Intel回答-不,您不能在Windows中为Linux编译(如上所述,除非使用VM,否则您实际上是在运行Linux。)VM是一种合理的方法,但是您必须在Linux上购买ifort的单独许可证。 Or, as I assume you have a Linux box you will test on, build there (you can SSH to it from your Windows box.) True, you won't have the Visual Studio IDE, but some of our customers use Eclipse (with the Photran plugin) or code:blocks with Intel Fortran. 或者,假设您有要测试的Linux机器,请在该机器上进行构建(可以从Windows机器通过SSH SSH到它。)确实,您没有Visual Studio IDE,但是我们的一些客户使用Eclipse( Photran插件)或代码:使用Intel Fortran进行阻止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM