The Intel® Fortran Compiler identifies syntax errors and violations of language rules in the source program.
These messages describe diagnostics that are reported during the processing of the source file. Compiler diagnostic messages usually provide enough information for you to determine the cause of an error and correct it. These messages generally have the following format:
filename(linenum:) severity: message
filename |
Indicates the name of the source file currently being processed. |
linenum |
Indicates the source line where the compiler detects the condition. |
severity |
Indicates the severity of the diagnostic message: Warning, Error, or Fatal error. |
message |
Describes the problem. |
The following is an example of an error message showing the format and message text:
echar.for(7): Severe: Unclosed DO loop or IF block DO I=1,5 --------^
The pointer (---^) indicates the exact place on the source program line where the error was found, in this case where an END DO statement was omitted.
To view the passes as they execute on the command line, specify -watch (Linux* OS and Mac OS* X) or /watch (Windows* OS).
You can perform compile-time procedure interface checking between routines with no explicit interfaces present. To do this, generate a module containing the interface for each compiled routine using the -gen-interfaces (Linux OS and Mac OS X) or /gen-interfaces (Windows OS) option and check implicit interfaces using the -warn interfaces (Linux OS and Mac OS X) or /warn:interfaces (Windows OS) option.
You can use a number of compiler options to control the diagnostic messages issued by the compiler. For example, the -WB (Linux OS and Mac OS X) or/WB (Windows OS) compiler option turns compile time bounds errors into warnings. To control compiler diagnostic messages (such as warning messages), use -warn (Linux OS and Mac OS X) or /warn (Windows OS). The -warn [keyword] (Linux OS and Mac OS X) or /warn:keyword (Windows OS) option controls warnings issued by the compiler and supports a wide range of values. Some of these are as follows:
[no]alignments -- Determines whether warnings occur for data that is not naturally aligned.
[no]declarations -- Determines whether warnings occur for any undeclared symbols.
[no]errors -- Determines whether warnings are changed to errors.
[no]general -- Determines whether warning messages and informational messages are issued by the compiler.
[no]interfaces -- Determines whether warnings about the interfaces for all called SUBROUTINEs and invoked FUNCTIONs are issued by the compiler.
[no]stderrors -- Determines whether warnings about Fortran standard violations are changed to errors.
[no]truncated_source -- Determines whether warnings occur when source exceeds the maximum column width in fixed-format files.
For more information, see the -warn compiler option.
You can also control the display of diagnostic information with variations of the -diag (Linux OS and Mac OS X) or /Qdiag (Windows OS) compiler option. This compiler option accepts numerous arguments and values, allowing you wide control over displayed diagnostic messages and reports.
Some of the most common variations include the following:
Linux OS and Mac OS X |
Windows OS |
Description |
---|---|---|
-diag-enable list |
/Qdiag-enable:list |
Enables a diagnostic message or a group of messages |
-diag-disable list |
/Qdiag-disable:list |
Disables a diagnostic message or a group of messages |
-diag-warning list |
/Qdiag-warning:list |
Tells the compiler to change diagnostics to warnings |
-diag-erro list |
/Qdiag-error:list |
Tells the compiler to change diagnostics to errors |
-diag-remark list |
/Qdiag-remark:list |
Tells the compiler to change diagnostics to remarks (comments) |
The list items can be specific diagnostic IDs, one of the keywords warn, remark, or error, or a keyword specifying a certain group (par, vec, driver, cpu-dispatch, sv). For more information, see -diag, /Qdiag.
Additionally, you can use the following related options:
Linux OS and Mac OS X |
Windows OS |
Description |
---|---|---|
-diag-dump |
/Qdiag-dump |
Tells the compiler to print all enabled diagnostic messages and stop compilation |
-diag-file[=file] |
/Qdiag-file[:file] |
Causes the results of diagnostic analysis to be output to a file |
-diag-file-append[=file] |
/Qdiag-file-append[:file] |
Causes the results of diagnostic analysis to be appended to a file |
-diag-error-limit n |
/Qdiag-error-limit:n |
Specifies the maximum number of errors allowed before compilation stops. |
If the linker detects any errors while linking object modules, it displays messages about their cause and severity. If any errors occur, the linker does not produce an executable file. Linker messages are descriptive, and you do not normally need additional information to determine the specific error.
To view the libraries being passed to the linker on the command line, specify -watch or /watch.
These messages indicate valid but inadvisable use of the language being compiled. The compiler displays comments by default. You can suppress comment messages with the -warn nousage (Linux OS and Mac OS X) or /warn:nousage (Windows OS) option.
Comment messages do not terminate translation or linking, they do not interfere with any output files either. Some examples of the comment messages are:
Null CASE construct The use of a non-integer DO loop variable or expression Terminating a DO loop with a statement other than CONTINUE or ENDDO
These messages report valid but questionable use of the language being compiled. The compiler displays warnings by default. You can suppress warning messages by using the -warn or /warn option. Warnings do not stop translation or linking. Warnings do not interfere with any output files. Some representative warning messages are:
constant truncated - precision too great non-blank characters beyond column 72 ignored Hollerith size exceeds that required by the context
These messages report syntactic or semantic misuse of Fortran.
Errors suppress object code for the error containing the error and prevent linking, but they do not stop from parsing to continue to scan for any other errors. Some typical examples of error messages are:
line exceeds 132 characters unbalanced parenthesis incomplete string
Fatal messages indicate environmental problems. Fatal error conditions stop translation, assembly, and linking. If a fatal error ends compilation, the compiler displays a termination message on standard error output. Some representative fatal error messages are:
Disk is full, no space to write object file Incorrect number of intrinsic arguments Too many segments, object format cannot support this many segments
If you are using the command line, messages are written to the standard error output file.
When using the command line:
Make sure that the appropriate environment variables have been set by executing the ifortvars.sh (Linux OS and Mac OS X) orIFORTVARS.BAT (Windows OS) file. For example, this BAT file sets the environment variables for the include and library directory paths. For Windows OS, these environment variables are preset if you use the Fortran Command Prompt window in the Intel® Visual Fortran program folder. For a list of environment variables used by the ifort command during compilation, see Setting Compile-Time Environment Variables.
Specify the libraries to be linked against using compiler options.
You can specify libraries (include the path, if needed) as file names on the command line.