Sunday, February 15, 2015

Installing Fortran on Windows with Cygwin

This post is more for me to aggregate the hard work of others so I have a single place to look when installing Fortran on Windows.

This set of instructions is where I got most of my help.  There are a couple tweaks that were necessary to keep everything up and running on 64bit with newer packages.  After all, the video is a couple years old.

Here's the gist:

1) make sure you've got Java installed if you use Eclipse (or other Java-based IDEs)

2) download cygwin from .  Download the setup.exe file for either 32 or 64 bit systems

3) install cygwin as administrator to the c:\ drive.  The mirror definitely works.

4) Install these packages in cygwin:
gcc-fortran: GNU Compiler Collection
gdb: The GNU Debugger
make: The GNU version of the 'make' utility

these will get you started.  The g++ compiler is also available and eventually, I (you) might need either OpenMP or OpenMPI.

5) Add path variables:
for 64 bit
or for 32 bit

5) Check that gfortran is installed by typing gfortran --version into command prompt

6) Install Eclipse Parallel tools developer kit (containing Photran)


Eric Pade said...

If you do this it tells you

gfortran: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found

How to fix that ?

Thank you :)

Unknown said...

you should also install mingw-w64-gcc-fortran in the devel package.

Bo Leng said...

you should also install Mingw-w64-gcc-fortran.

Bo Leng said...

you are welcome