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.
https://www.youtube.com/watch?v=GfCmiEbGtpE

Here's the gist:

1) make sure you've got Java installed if you use Eclipse (or other Java-based IDEs) http://www.oracle.com/technetwork/java/javase/downloads/index.html

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

3) install cygwin as administrator to the c:\ drive.  The cygwin.mirrors.hoobly.com 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
;C:\Cygwin64\bin;C:\Cygwin64\usr\bin;C:\Cygwin64\usr\local\bin;C:\Cygwin64\lib;C:\Cygwin64\usr\lib
or for 32 bit
;C:\Cygwin\bin;C:\Cygwin\usr\bin;C:\Cygwin\usr\local\bin;C:\Cygwin\lib;C:\Cygwin\usr\lib

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

6) Install Eclipse Parallel tools developer kit (containing Photran) http://www.eclipse.org/ptp/

4 comments:

Unknown 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.

Unknown said...

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

Unknown said...

you are welcome