Using GEMPACK with different Fortrans

GEMPACK can be used with several different Fortran compilers, but the standard instructions assume that users will choose one Fortran and stick with that choice. In some cases you might wish to use two compilers, if for example:

This page suggests a possible approach for using GEMPACK with multiple compilers.

The source code install process

It's important to clearly understand the usual install process:

1: The install process requires that you first install Fortran, and test a "Hello world" program. You could install several Fortrans. If you are running 64-bit Windows, then installing either GFortran or Intel Fortran actually installs both 32-bit and 64-bit versions.

2: Next you run the GEMPACK source-code install program, installing to a folder you choose (we suggest C:\GP). The GEMPACK installer asks which Fortran you want to use (eg, 64-bit Intel), and, based on your choice, copies compiler-specific files to your GEMPACK folder. Then the BuildGP process uses your selected compiler to build a GEMPACK system.

3: It is required that both your Fortran compiler and your GEMPACK folder be on the system PATH. The environment variable GPDIR must point to your GEMPACK folder (which is assumed to be C:\GP if GPDIR is not set). Usually the install processes take care of these details.

Installing once for each Fortran

It follows from the above details (especially the note about compiler-specific files) that you need to install GEMPACK once for each Fortran that you wish to use. For example, let us suppose that you already had a working source-code GEMPACK, built using 64-bit Intel Fortran, in C:\GP. Now you wish to try out GFortran. You should:

Now you wish to return to your Intel Fortran. You should:

The essence of this approach is that:

Another method, more suited to command-line or BAT use

Using this alternative approach, you need to alter PATH or GPDIR environment variables -- which can be quickly (but temporarily) done using the command prompt. Let us suppose that you already had a working source-code GEMPACK, built using 64-bit GFortran, in C:\GP. Another GEMPACK, built using 64-bit Intel Fortran, is in C:\GPIF64. You wish to temporarily switch to the Intel GEMPACK. You should:

It's important to realize that with this method, your changes to GPDIR and PATH apply only to the current command-line session, and to any programs launched (via the command-line) from within that session. When you close the command prompt, the changes are forgotten. Desktop and Start Menu links always refer to the programs in C:\GP.

Caveat regarding Intel Fortran 10

Both methods described above of switching between Fortrans rely on the possibility of having several different Fortrans installed and ready for use on the PATH. This is quite easy to do using GFortran, or Intel Fortran version 11 or later. With Intel Fortran 10 (10.1 is the first version supported for GEMPACK) you cannot have BOTH 32-bit and 64-bit versions correctly configured on the path at the same time. You need to edit the PATH environment variable to suit the 32-bit or 64-bit version as described in our instructions here. Nevertheless, you could still switch between ONE of the Intel 10 compilers, and the GFortran compiler.


See also:

Fortran Compilers for Use with Source-Code GEMPACK