JMU JMU - Department of Computer Science
Help Tools
Installing a FORTRAN Development Environment


1 Introduction

There are a variety of development environments for FORTRAN programmers, some of which are freely available and some of which are commercial products.

This document describes the installation and use of one freely available environment that consists of:

running under MS-Windows.

The "Basic Installation" process described below will give you everything you need to edit (using SciTE) and compile (using the cmd shell) FORTRAN 9x programs. The "Advanced Installation" process also gives you a Unix-like Bourne Shell, and the GNU Compiler Collection (which includes FORTRAN 77, C/C++, and some other languages).

2 Basic Installation

The CD contains a directory named basic that can be copied, as is, to your hard disk. Here we assume that you want to install to the directory c:\fortran. (Note: This process looks longer than the "Advanced Installation" because the instructions are more detailed. The entire process takes only a few minutes.)
  1. Create the directory c:\fortran on your hard disk either from the cmd shell or using the Windows Explorer.
  2. Copy the three directories from the basic directory on the CD to c:\fortran. When you are done you shold have the following three directories: c:\fortran\bin, c:\fortran\doc, and c:\fortran\lib.
  3. Open the c:\fortran\bin directory in the Windows Explorer.
  4. Right click on the file named SciTE.exe and pull down to Create Shortcut.
  5. Move the file named Shortcut to SciTE.exe to your desktop.
  6. Click on Start on the toolbar and select Control Panel. (Note: You might have to choose Settings before you can choose Control Panel.)
  7. Double-click on System in the Control Panel window.
  8. Click on the Advanced tab.
  9. Click on the Environment Variables button.
  10. In the System Variables window, click on Path and click on the Edit button.
  11. Click on the Variable value: field and press the End key to go to the end of the field.
  12. Type the following: ;c:\fortran\bin (note the semicolon).

    In some cases, for example on some HP computers, you may need to type the following:
    ;c:\fortran\bin;c:\fortran\lib;c:\fortran\lib\gcc-lib\i686-pc-mingw32\4.0.3\

  13. Click on the Edit button under the System Variables window.
  14. Click on the Variable name: field and type LIBRARY_PATH
  15. Click on the Variable value: field and type c:\fortran\lib

    In some cases, for example on some HP computers, you may need to type the following:
    ;c:\fortran\lib;c:\fortran\lib\gcc-lib\i686-pc-mingw32\4.0.3\

  16. Click on the OK button.
  17. Click on the OK button in the System Properties window.
  18. Click on the x button in the Control Panel window.

3 Advanced Installation

The CD also contains a directory named advanced that contains several installers.
  1. Run the MinGW-4.1.1.exe installation executable (e.g., double-click on the icon)and accept all of the defaults. (This executable will download additional files so you must remain connected to the Internet.)
  2. Run the MSYS-1.0.10.exe installation executable and accept all of the defaults. (This executable will open a command shell window. Make sure to run the normalization when asked.)
  3. Run the g95-MinGW.exe installation executable and install to the MinGW directory (which will probably be c:\MinGW). Do not install the MinGW Utilities when prompted. Do allow the installer to set the PATH and LIBRARY_PATH.
  4. Add c:\msys\1.0\bin to the PATH. Specifically:
    1. Click on Start on the toolbar and select Control Panel. (Note: You might have to choose Settings before you can choose Control Panel.)
    2. Double-click on System in the Control Panel window.
    3. Click on the Advanced tab.
    4. Click on the Environment Variables button.
    5. In the System Variables window, click on Path and click on the Edit button.
    6. Click on the Variable value: field and press the End key to go to the end of the field.
    7. Type the following: ;c:\msys\1.0\bin (note the semicolon).
  5. Copy the contents of the scite directory (not the directory itself) to the MinGW binaries directory (which will probably be c:\MinGW\bin).
  6. Open the MinGW binaries directory (which will probably be c:\MinGW\bin) in the Windows Explorer, right click on the file name SciTE.exe and pull down to Create Shortcut. Then, move the file named Shortcut to SciTE.exe to your desktop.

4 Working with SciTE

SciTE is a fairly powerful editor that has a variety of features. What follows are some hints that you might find useful.

5 Working from the MS-Windows Shell

The MS-Windows shell (i.e., cmd.exe can be accessed from the Start menu by choosing run and entering cmd.exe in the dialog box.

You can compile and link FORTRAN programs using the g95 command.

6 Working from the MSYS Shell - Advanced Installation Only

MSYS is a Unix-like command shell (an alternative to the cmd.exe and command.com provided with MS-Windows) that allows you to develop programs as you would using a UNIX/Linux command shell. You can start this command shell either by clicking on the MSYS/MinGW icon on your desktop or using the MinGW folder under the "Start" button (you may need to look inside of the "All Programs" entry).

You can compile and link FORTRAN programs using the g95 command.

7 Issues

You should be aware of the following issues:
  1. Many applications (including many development tools) use the space character as a delimiter. This means that, in general, it is a bad idea to use spaces in file names and/or directory names.
  2. See 1.

Copyright 2019