Silverfrost Logo About Us | Contact Us

Compiler Options - Quick Reference

Options classified

Gives a list of options when FTN95 is used from a command line in a Command Prompt box.

Prints error messages formatted for 132 column screens.

Allows procedure recursion when the RECURSIVE attribute has not been specified (not recommended).

Prevents certain warnings from being reported only once.

Allows byte size for KIND numbers. e.g. REAL(8) instead of REAL(2); also 1.0_8 instead of 1.0_2 but 1.0_K must use the default KIND values.

Old synonym for /ISO option.

Win32 only. Like /BREAK but enters debugger at assembler level.

/BINARY <filename>
Used to specify the .DBK or .OBJ file name. If this option is omitted, the object file name is created by replacing the source file-name's suffix with .DBK or .OBJ, e.g. with FOO.F95, the object file would be FOO.DBK for .NET (using /CLR) and FOO.OBJ for Win32.

Win32 only. Implies both /CHECK and /LGO and causes a break to the symbolic debugging facility at the first executable statement.

Check array subscripts only (/CHECK includes /BOUNDS_CHECK).

Causes all errors, warnings and comments to be output in a form that is compatible with Borland BRIEF.

/CFPP more...
Invoke the C-style preprocessor on all input files. Use this for #if, #ifdef, #endif statements.

/CHECK more...
Causes code to be planted in order to enable the run-time checking of array bounds, overflow etc., and also to enable the use of the source-level debugging facilities (/CHECK implies /DEBUG).

A synonym for /FULL_UNDEF. /FULL_UNDEF implies /UNDEF which in turn implies /CHECK.

Win32 only. Appends "__C" to C_EXTERNAL aliases that do not start with a double underscore.

only. Supplies a fully qualified class name to hold the Fortran code when using /LINK.

only. Outputs object code for .NET Framework, version 2.0 is targeted by default - use /CLR along with /CLR_VER 4 to target 4.0. (Support for 1.1 has been removed as of version 6.35 of FTN95)

/CLR_VER <version>
only. Target a specific version of the .NET Framework, use /CLR_VER 4 to target version 4.0.

Compiler output in a Comand Prompt box is coloured.

Opens a dialog box to set-up installation compiler defaults. This must be the only option on the command-line. See also Default Compiler Options.
This dialog can be used to change the global compiler defaults. Use /CFG in order to change the local compiler defaults.

Default options are placed in a file FTN95.cfg. The file for global values is written to the same directory as the compiler FTN95.exe. The file for local values is written to the working directory for the current project. FTN95 reads default options first from a global file and then from a local file where they exist.

Converts fixed-format source into free-format, output to the screen. All comments are lost and Hollerith constants replaced with strings. This is useful for converting fixed-format INCLUDE files into files suitable for both fixed and free formats. This option implies the /NO_BINARY option and no error checking, other than for matching brackets and checking the fixed-format column rules, is done. All other options on the command-line are ignored.

Win32 only. Implies /LGO and causes a break to the symbolic de bugging facility at the first executable statement (i.e. like /BREAK, but /CHECK is not implied).

causes FTN95 to generate symbolic information and to activate the symbolic debugger when fatal errors occur. /DEBUG is included in /CHECK, /UNDEF and /CHECKMATE which are normally preferred. /DEBUG can be used on its own in order to allow the debugger to be used on "dirty" code, which intentionally violates some of the rules of Fortran.

Adds a call to DEBUG_SOURCE@ after every executable line (currently not available for x64).

Sets the default INTEGER kind. Use kind=2 or 3. kind=3 is the default.

Sets the default LOGICAL kind. Use kind=1 or 2 or 3. kind=3 is the default.

Sets the default REAL kind. Use kind=2 or 3. kind=3 is for Win32 only.
/DEFREAL_KIND 2 also promotes all variables declared as REAL*4 or REAL(1) to double precision. In this respect it is the same as the option /DREAL and is unlike the behaviour of /DEFINT_KIND. Similarly (for Win32) DEFREAL_KIND 3 is the same as /XREAL.

If /LINK or /LGO is used no permanent object file is created. Otherwise, by default an object file will be generated except when errors are present. /DELETE_OBJ_ON_ERROR represents the default and must be negated to prevent the object file from being deleted.

Causes DO loops to be executed at least once to allow certain Fortran 66 programs to execute correctly.

/DREAL more...
Set the default KIND for REAL types to be 2 (DOUBLE PRECISION).

Output a variable dump in listing file.

Error messages are accompanied by their error number.

Creates a file called <filename>.ERR containing a copy of all error and warning messages.

/EXPLIST [<filename>]
Generate a listing file containing a symbolic assembler listing. <filename> is the optional name of the .LIS file. /EXPLIST is equivalent to /LIST but causes each source statement to be followed by the assembler statements corresponding to the instructions into which it was compiled.

Win32 only. Applies the F_STDCALL keyword to all user-defined and imported subprograms. Standard intrinsics, and FTN95 intrinsics and library routines are automatically excluded. FTN95 routines such as CISSUE must be renamed CISSUE@. Certain Fortran language restrictions apply and, in particular, INTERFACE statements may not be used with this option. When used with /CHECK, certain checking processes are not implemented. In particular, what are called "write-ability" checks are not applied. This means that it is advisable to test your code using /CHECK (or /CHECKMATE say) without using /F_STDCALL.

Permits the use of some Fortran 200x statements as an extension. This option is now switched on by default.

Accept source code in ISO fixed source format. This is assumed for files with .FOR or .F suffixes. If the name of the source file on the command line has no suffix and this option is supplied then .FOR is assumed to be the suffix.

/FPP more...
Invoke the preprocessor on all input files (this is required in order to use CIF/CELSE/CENDIF when /SPARAM and /VPARAM are not used). This option is implied by /CLR.

Accept source code in ISO free source format. If the name of the source file on the command line has a suffix which is not .FOR and not .F, this option is assumed. If the name of the source file on the command line has no suffix, .F90 is assumed.

Outputs full debugging information including PARAMETERs.

Like /UNDEF but also INTENT(OUT) arguments are initialised as undefined on entry to a procedure (/INHIBIT_CHECK 14 switches this off) and by default character variables are initialised as undefined. The reading of an undefined value precipitates an error condition.

/HARDFAIL more...
Win32 only. Used with /LGO to suppress entry into the debugger in the event of a run time error.

Invokes the Windows based help system.

/IGNORE <error number>
Suppresses all errors and warnings with the given number. Error numbers are generated using /ERROR_NUMBERS. Suppressing error numbers is unsafe but may be useful during debugging.

Fault on IMPLICIT type definitions.

/INCLUDE <pathname>
Allows specification of list of include paths. This is appended to the list of include-paths optionally specified in the environment variable F95INCLUDE.

/INHIBIT_CHECK <integer> more...
Prevent the specified check being added with /CHECK and /FULL_UNDEF.

/IMPORT_LIB <pathname>
Win32 only. Scans a CVF generated library, automatically creating F_STDCALL interfaces.

/INTL more...
Set default KIND for type INTEGER to be 3 (this is the default). This is equivalent to /DEFINT_KIND 3.

/INTS more...
Set default KIND for type INTEGER to be 2. This is equivalent to /DEFINT_KIND 2.

Ensures that all constructs used in a program conform to the Fortran 95 ISO Standard. The /ISO option also informs the FTN95 run-time system that ISO-conformity is required. This means that, for example, non-standard use of format descriptors (such as business editing in a run-time format) causes a run-time fail ure.

/LGO more...
Compile, load and execute.

Specification of relocatable binary library and input files when using /LGO or /LINK.

/LINK [<filename>] more...
Generates an executable file, DLL or relocatable library (in the case of .NET, a .NET assembly file or module). If <filename> is not provided, the name is created by using the source file name. For example, FOO.F95 would generate a Win32 executable called FOO.EXE.

/LIST [<filename>] more...
Produces a source listing file. If <filename> is not provided, the name is created by replacing the source-suffix with .LIS, e.g. with FOO.F90, the map file would be FOO.LIS.

Used with /LIST to include INCLUDE files in listing.

/LOGL more...
Use LOGICAL (KIND=3) as default LOGICAL type (this is the default). This is equivalent to /DEFLOG_KIND 3.

/LOGS more...
Use LOGICAL (KIND=2) as default LOGICAL type. This is equivalent to /DEFLOG_KIND 2.

Specifies that the source code uses Apple Macintosh end-of-line characters.

/MAP [<filename>]
Produces a linker map. If <filename> is not provided, the name is created by replacing the source-suffix with .MAP, e.g. with FOO.F90, the map file would be FOO.MAP.

Sets all compiler diagnostic messages to comment severity.

Sets all compiler diagnostic messages to error severity.

Sets all compiler diagnostic messages to fatal severity.

Applies /IGNORE to all error numbers.

Win32 only. Generates a static library containing a separate object for each function or subroutine.
/MKLIB causes FTN95 to call the Silverfrost library manager called SLIM. Objects in the resulting static library may work correctly with the debugger SDBG. The use of SLIM objects with SDBG is not supported.

/MOD_PATH <pathname>
Sets alternative path for module files. More than one /MOD_PATH is permitted. This is appended on to the path contained in the optional environment variable MOD_PATH.

Suppress compilation logos.

Suppresses the creation of an object file.

Suppress compiler comments, but not warnings and errors.

Synonym for /PERSIST.

Use standard Win32 I/O for .MOD files (only required when creating .MOD files on a network drive where the server is a Windows 9x machine).

Suppress reports of obsolete and extension warning messages after the first has been displayed.

Suppresses the output of address offsets in the source listing.

Suppresses the simulated quit after a bad compilation. This normally simulates a ^C to halt a batch-file compilation. With this option set


must be use to test for compilation failure in a batch file if this option is set, or alternatively


if the /DELETE_OBJ_ON_ERROR option is also used.

Suppresses warnings for characters appearing in columns 133 (free format) or 73 (fixed format) and beyond in the source file.

Treats the assignment of a whole array to a scalar value as an error.

Suppresses messages when using /LIST.

Suppresses compiler messages that warn of syntax that is permitted by the FTN95 compiler but does not conform to the Fortran 95 standard. Such warnings will be converted to errors if /IOS is used. /NON_STANDARD is switched on by default.

INTEGER A(1) implies INTEGER A(*) when declaring procedure arguments.

/OPTIMISE more...
Invoke the peephole and tree optimisers. /CHECK, /UNDEF, /DEBUG and their variants are incompatible with this option.
Note that 64 bit optimised code will not load on a machine that does not support the AVX instruction set.

/OPTIONS <filename>
Specifies a file containing additional compiler options.

only. Implied by /CHECKMATE. Can be used in release mode to call CHECK_FINITE@ after every floating point calculation.

Win32 only. Uses some instructions which are only available on a Pentium Pro (P6) (or better) processor.

/PARAMS <param-list> more...
Used with /LGO or /BREAK to pass options to the program rather than the compiler. This must be the last FTN95 option on the command line.

Outputs error/warning/comment messages one at a time and waits for a key press after each message.

By default compilations with errors will terminate as if control break had been pressed. When the command appears in a batch file, the batch process will then be interrupted. If /PERSIST is used, the control break is suppressed and processing of the batch file will continue even when compilation errors have occurred.

x64 only. Inserts code to record how many times each line is executed.

/REF <.NET assembly>
only (but see additional note below). Used with /LINK and /LGO to pass a reference to the linker. It can also be used during compilation to access information about methods and objects that are defined in the assembly and used in the program.
Note that /REF must not reference a DLL via the global assembly cache (GAC). DLLs in the GAC should have alternative copies in a corresponding "redist" folder. Use the "redist" version and not the GAC version with /REF.
Additional note: /REF is designed for but is not limited to .NET. It can also be used as an alternative to a LIBRARY statement under Win32.

Increases compiler strictness to reject dubious code.

Adds a call to RUN_TRACE@ after every executable line (currently not avaiable for x64).

/SAVE more...
Do not use the stack for storage of local variables and arrays. Otherwise dynamic storage is used for all local variables and arrays. This has the effect of a blank Fortran SAVE statement in each subprogram. Its use should normally be avoided.

Searches through INCLUDE files for CONTAINS. Switch this on only if an INCLUDE file contains executable statements. This option is set by /ISO. When compiling typical Fortran 77 programs containing many INCLUDE statements, this will speed compilation.

/SET_ERROR_LEVEL <code> <number>
Changes the severity of a compiler diagnostic. <code> is Suppress, Comment, Warning, Restricted, Error, or Fatal. <number> is the error number reported by using /ERROR_NUMBERS.

Suppress warning and comment messages. Also when /SILENT is used, the message that is output on the screen at the end of the compilation of a program unit does not include the numbers of warning and comment messages.

Only prints the first line of an error message, ignoring any continuations. This is ignored if /BRIEF is specified. Without this option, when an error is reported, the offending line is output together with any continued lines.

/SPARAM <integer> more...
Sets the value of all SPECIAL PARAMATERs.

/STACK <size>
only. Sets stack size per thread when using /LINK or /LGO.

Suppress windowed diagnostic information.

Print the number of lines compiled and the compilation speed on the screen.

Suppresses /CHECK mode checking for argument constistency across routines.

Plants code to do per-routine timing (see /TIMING).

/UNDEF more...
Implies /CHECK and also causes code to be planted in order to do run-time checking for any undefined variables or array elements.

/UNDERFLOW more...
Win32 and x64 only. Used to trap underflow.

Carry on compiling even after 12 error messages.

Display version information.

/VPARAM <name> <integer> more...
Like /SPARAM but allows the user to define a SPECIAL PARAMETER by name, instead of having all the same value (over-rides SPARAM).

All warnings and comments become errors.

Source lines are wrapped rather than truncated when an error or warning is output.

Line-truncation for fixed format files at the 72nd column is suppressed.

Win32 and x64 only. Program is compiled for use with ClearWin+.

Win32 only. Sets the default KIND for REAL types to be 3.

/XREF [<filename>]
Generates a cross-reference .XRF file. If <filename> is specified, the file name is created by replacing the source file-name's suffix with .XRF, e.g. with FOO.F90, the resulting name would be FOO.XRF.

/ZEROISE more...
All static variables and arrays set to zero at start of execution.



Copyright © 1999-2019 Silverfrost Limited