Using gFortran or iFort

If an x64 gFortran or iFort compiler is installed on your computer, it can be used for the x64 platform instead of the Silverfrost Fortran compiler FTN95.

The alternative compiler is activated by selecting "Fortran compiler for x64" from the main Build menu (Alt+X). This opens a dialog that provides a choice between FTN95, gFortran amd iFort. This dialog can be kept open. It displays a Settings button and a Properties button that open other dialogs. The Settings dialog provides the paths that Plato requires in order to run the alternative compilers. When gFortran is installed via mysys64 and iFort is installed via Intel OneAPi, these typically take the following forms (details will vary as new versions of the compilers are released)...

gFortran path C:\msys64\usr\bin
gFortran compiler gfortran.exe
Path to bin\intel64\iFort.exe C:\Program Files (x86)\Intel\oneAPI\compiler\2021.2.0\windows\
iFort Community path C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\
iFort Bin Kit path C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\

The gFortran path is optional and should be left blank when the gFortran compiler can be accessed via the PATH environment variable. The gFortran compiler defaults to the name shown above.

In order to use an alternative compiler, the x64 platform must be selected from the platform options on the main toolbar. With the x64 platform selected, any of the configurations Debug, Release and Checkmate can be selected. Checkmate is a trademark of FTN95. For the alternative compilers, Plato will use relevant checking options as follows.

Single file mode

Plato uses a fixed set of command line options depending on the configuration selected. These can be viewed from a BuildLog file after compiling and linking.

Project mode

The command line options used by Plato can be viewed and potentially changed by clicking on the Properties button in the x64 dialog. These options act independently of the corresponding FTN95 options which will remain in place, except for the name of the executable or DLL, its extension (.exe or .dll) and the type of the subsystem (console or Windows). These are inherited from the FTN95 properties.

Note that default linker options are provided for Intel Fortran in the form of a list of .lib files that are typically required for an Intel Windows application. These are not needed for an Intel console application. Note also that iFort.exe is used for linking (as well as compilation) and linker options are passed on to a Microsoft linker. This usually means that iFort linker options must be prefixed by "/Qoption,link,/". For example, the option supplied by Plato for a Windows application for Intel Fortran is "/Qoption,link,/subsystem:windows".

Plato uses subfolders for the object files etc., one for each platform. As a result a rebuild is generally not required when changing from one platform to another. The name of the x64 subfolder is normally "x64" but for gFortran this becomes "x64g", whilst for iFort this becomes "x64i". The .mod files are compiler dependent so Plato directs them (together with .obj files) to the relevant subfolder  The exception to this rule is the FTN95 compiler because in this case the mod files are given the extension .mod64 rather than .mod.

ClearWin+

See Using ClearWin+ with third party Fortran compilers.

ClearWin+ interface source files (located in FTN95\Source64) can be imported into a project by selecting Import Items from the main Project menu or by right clicking on Source Files in the Project Explorer window. This will copy the selected files and the modules can then be USEd in the program code. Copying the ClearWin+ interface files will ensure that the resulting .mod and .obj files relate to the selected compiler and its version number.

Note that, by default, FTN95 does not allow the compilation of modules with names ending with $. The command line option /DOLLAR_MOD over-rides this default and is required when compiling modules such as clrwin$ which appears in files that are copied from FTN95\Source64\clrwin.95.

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited