Can I Compile Linux FORTRAN Code on a Windows Compiler?

  • Context: Fortran 
  • Thread starter Thread starter NoobixCube
  • Start date Start date
  • Tags Tags
    Fortran Linux Windows
Click For Summary

Discussion Overview

The discussion revolves around the possibility of compiling Linux FORTRAN code using a Windows compiler, focusing on the portability of FORTRAN code and the tools available for compilation on Windows.

Discussion Character

  • Exploratory
  • Technical explanation

Main Points Raised

  • One participant inquires whether a Linux FORTRAN code that is described as 'portable' can be compiled on a Windows compiler.
  • Another participant suggests that FORTRAN is generally portable, noting that system-level dependencies are minimal, and mentions that compiler-specific extensions are the main portability concern.
  • A participant expresses interest in the ease of setting up FORTRAN on Windows and references GCC as a good compiler option.
  • It is mentioned that the MinGW compiler, which is a version of GCC for Windows, includes g77 and functions similarly to compiling FORTRAN in a Linux environment.

Areas of Agreement / Disagreement

Participants appear to agree on the general portability of FORTRAN code and the suitability of using GCC on Windows, but there is no explicit consensus on the ease of setup or specific compiler recommendations.

Contextual Notes

There may be assumptions regarding the definitions of 'portable' and the specific features of the FORTRAN code in question, as well as the varying experiences with different compilers on Windows.

Who May Find This Useful

Individuals interested in compiling FORTRAN code across different operating systems, particularly those transitioning from Linux to Windows environments.

NoobixCube
Messages
154
Reaction score
0
Hi,
I have a code that was written with a Linux FORTRAN compiler but is 'portable'. does this mean I am able to compile it on a windows compiler?
 
Technology news on Phys.org
Yes, Fortran is pretty portable anyway since you don't normally do much system level stuff.
The main portability issue with Fortran is compiler specific extentions.
If you wrote it on Linux you presumably used the GNU compiler? If you use the same compiler on windows it shoudl work out of the box.
 
I will have to look at that one. Is FORTRAN in window relatively easy to set up. I heard GCC make good compilers..?
 
The MinGW compiler is a GCC for Windows. It has g77 and is basically like compiling FORTRAN in Linux.
 

Similar threads

Replies
6
Views
3K
Replies
64
Views
11K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 29 ·
Replies
29
Views
4K
  • · Replies 1 ·
Replies
1
Views
6K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 37 ·
2
Replies
37
Views
5K
Replies
6
Views
2K