http://www.champslab.com/wiki/index.php?title=Install_FORTRAN_Compiler_for_Cygwin
Install FORTRAN Compiler for Cygwin
The following document provides instruction on how to install a FORTRAN compiler with use in Cygwin (gfortran).
To begin with, go ahead and update Cygwin to the latest version. Go to the Cygwin Home Page and click on the "Install or update now!" icon.
Save the executable file to your computer.
Click on setup.exe and click Next.
Click Install from Internet.
Leave defaults and click Next.
- Note: You may change the "Install For" options if need be.
Click Next. Click Next.
Pick a download site and click Next.
Maximize the "Select Packages" screen. Expand the "Devel" option and enable all packages that begin with "gcc." Click Next and finish the installation.
Go to the Binaries available for gfortran website and download the latest Cygwin build (Fourth bullet down in the Windows section).
Save the file.
- Note: The file name extension may change from .tar.bz2 to .tar.tar. If this is the case rename the extension back to .tar.bz2.
Open Cygwin and go to the location in which you saved the file (ex: cd C:/gfortran/).
Install using the following command:
- tar -xjvf gfortran-4.4-Cygwin-i686.tar.bz2 -C /
Migrate to the Unix emulator route drive (/) (One level higher than the Cygwin drive) and input the following command:
- ln -s /usr/local/gfortran/bin/gfortran.exe ~/bin/gfc
If no errors occur type the command:
- gfc --version
- This command will invoke gfortran and display its version information. If this is successful the FORTRAN compiler has been installed correctly.
If problems arise installing gfortran the following websites may be useful:
FORTRAN Compiler for Windows
This method explains how to install a Windows based FORTRAN compiler.
- Download gfortran for Windows and install.
- To compile open the command prompt (Start > Run > cmd) and migrate to the FORTRAN file you wish to compile. Type gfortran code.f95 -o code.exe. This creates an executable named code.exe from code.f95.