Compiling External Procedures or EES using FORTRAN and MinGW
The following information provides instructions for compiling an external procedure for EES in the FDL format (.FDL64 for 64-bit versions) using the Open Source programming tool set, including the GNU Compiler Collection (GCC).
MinGW
This guide uses MinGW, which is a development environment for Microsoft Windows applications that provides an Open Source programming tool set, including the GNU Compiler Collection (GCC). For more information please visit https://www.mingw-w64.org/.
To install MinGW, download the latest version
It is recommended that you do not change the default path during installation and you select to download the latest repository catalogs. Both the Fortran Compiler and the MSYS Basic System must be installed (these are not selected by default). The installed MinGW Shell (located in the Start menu) uses the sh interpreter, which is slightly different than the DOS interpreter used by Microsoft Windows. The most important commands to know are:
ls list files in the current directory (comparable to dir)
pwd print the current directory
cd change directory (note that sh uses back slashes rather than forward slashes)
The MinGW Shell opens in a fake home directory. To navigate to the directory containing your source code, it is necessary to use /c/ as the root directory. For example, to change to the "FDL Source" folder in the "My Documents" directory of user John:
cd "/c/Documents and Settings/John/My Documents/FDL Source/"
Source Code Modifications
The example MDASF procedure given in the EES manual must be changed slightly when using this guide. Specifically, an additional integer variable must be added to the argument list after the message_string (or S) variable:
subroutine MDASF(message_string,str_len,mode,num_inputs,input_array,num_outputs,output_array)
Click here to view the modified MDASF procedure.
Compiling the Procedure
A simple definition file is required by the linker in order for EES and the compiled FDL
procedure to communicate successfully. The contents of the definition file are:
EXPORTS
mdasf_@32 @ 1
MDASF = mdasf_@32
The procedure name must be changed in all three places when modifying this definition file for use with different procedures, and it should be located in the same directory as the file containing the source code.
To create the FDL file and move it into the EES\Userlib directory, use the following commands from within the directory containing the source code and definition file:
gfortran -ffree-line-length-0 -shared -static -o MDASF.fdl mdasf.f90 mdasf.def
mv MDASF.fdl /c/EES32/Userlib/