Miscellaneous Options
Descriptions of miscellaneous options.
-c
Default: off
The -c option disables the link step and saves the binary object file version of the program in file.o, where file is the name of the source file and .o is the suffix used. If there is more than one input file, a file.o is created for each input file specified.
If only one input file is processed and neither the -b bin_obj_file nor the -c options are specified, the binary version of the program is not saved after the link is completed.
If both the -b bin_obj_file and -c options are specified on the ftn command line, the link step is disabled and the binary object file is written to the name specified as the argument to the -b bin_obj_file option. For more information, see -b bin_obj_file.
If both the -o out_file and the -c option are specified on the ftn command line, the link step is disabled and the binary file is written to the out_file specified as an argument to -o. For more information, see -o out_file.
-o out_file
The -o out_file option overrides the default executable file name, a.out, with the name specified by the out_file argument.
If the -o out_file option is specified on the command line along with the -c option, the link step is disabled and the binary file is written to the out_file specified as an argument to -o.
-h craylibs_arch_override
Forces Craymath to honor the processor architecture specified by the -h cpu option. Processor architecture is typically specified by loading one of the targeting modules, e.g., craype-sandybridge, but can be overriden at link time by using the -h cpu option. If the CRAYLIBS_ARCH_OVERRIDE environment variable is specified, it takes precedence over this option.
-h [no]fp_trap
Default: fp_trap if traps are enabled using the -K trap option, or if -Ofp[0,1] is in effect. Otherwise, the default is nofp_trap.
Controls whether the compiler generates code that is compatible with floating-point traps.
-h keepfiles
Default: off
Prevents the removal of the object (.o) and temporary assembly (.s) files after an executable is created. Normally, the compiler automatically removes these files after linking them to create an executable. Since the original object files are required to instrument a program for performance analysis, if CrayPat is to be used to conduct performance analysis experiments, use this option to preserve the object files.
-h keep_frame_pointeropts
Default: off
Retain call stack information back to main entry point for CrayPat performance sampling. Prevents call stack frame from being optimized out of a function so CrayPat performance sampling is able to trace call stack back to entry point.
-h loop_trips=[tiny | small | medium | large | huge], -O loop_trips=[tiny | small | medium | large | huge]
Specifies runtime loop trip counts for all loops in a compiled source file. This information is used to optimize the runtime characteristics of the application.
-h pic, -h PIC
Generate position independent code (PIC), which allows a virtual address change from one process to another, as is necessary in the case of shared, dynamically linked objects. The virtual addresses of the instructions and data in PIC code are not known until dynamic link time. For the Cray implementation, the pic and PIC options have the same effect and should be used to compile codes using more than 2GB of static memory, or for creating dynamically linked libraries.
-K trap=exceptions
Default: off
Enable traps for the specified exceptions. By default, no exceptions are trapped. Enabling traps by using this option also has the effect of setting -h [no]fp_trap.
If the specified options contradict each other, the last option predominates. For example, -K trap=none,fp is equivalent to -Ktrap=fp.
This option does not affect compile time optimizations; it detects run time exceptions.
This option is processed only at link time and affects the entire program; it is not processed when compiling subprograms. Use this command line option to set traps beginning with execution of the main program. The program may subsequently change these settings by calling intrinsic or library procedures. If this option is used, -hfp_trap may need to be specified when other files of the application are compiled.
- denorm
- Trap on denormalized operands.
- divz
- Trap on divide-by-zero.
- fp
- Trap on divz, inv, or ovf exceptions.
- inexact
- Trap on inexact result (i.e., rounded result). Enabling traps for inexact results is not recommended.
- inv
- Trap on invalid operation.
- none
- Disables all traps (default).
- ovf
- Trap on overflow (i.e., the result of an operation is too large to be represented).
- unf
- Trap on underflow (i.e., the result of an operation is too small to be represented).
-o outfile
Produces an absolute binary file named outfile. A file named a.out is produced by default. When this option is used in conjunction with the -c option and a single source file, a relocatable object file named outfile is produced.
-R runchk
The -R runchk option allows any of a group of run time checks for the program to be specified. To specify more than one type of checking, specify consecutive runchk arguments, such as: -R bs.
Performance is degraded when run time checking is enabled. This capability, though useful for debugging, is not recommended for production runs.
- runchk
- Checking performed
- b
- Enables checking of array bounds. If a problem is detected at run time, a message is issued but execution continues. The NOBOUNDS directive overrides this option. For more information, see NOBOUNDS.
Bounds checking behavior differs with the optimization level. At the default optimization level, -O 2, some run time checking is inhibited. Complete checking is guaranteed only when optimization is turned off by specifying -O 0 on the ftn command line.
- c
- Enables run time conformance checking of array or coarray operands in array expressions. Even without the -Rc option, such checking is performed during compilation when the dimensions of array operands can be determined.
- d
- Enables directive checking at run time. Errors detected at compile time are reported during compilation and so are not reported at run time. The collapse directive is checked, as are the loop_info clauses min_trips and max_trips. Violation of a run time check results in an immediate fatal error diagnostic.
- p
- Generates run time code to check the association or allocation status of referenced POINTER variables, ALLOCATABLE arrays, or assumed-shape arrays. A warning message is issued at run time for references to disassociated pointers, unallocated allocatable arrays, or assumed shape dummy arguments that are associated with a pointer or allocatable actual argument when the actual argument is not associated or allocated.
- s
- Enables checking of character substring bounds. This option behaves similarly to option -R b.
Bounds checking behavior differs with the optimization level. At the default optimization level, -O 2, some run time checking is inhibited. Complete checking is guaranteed only when optimization is turned off by specifying -O 0 on the ftn command line.
-S
Compiles the named source files and leaves their assembly language output in the corresponding files suffixed with a .s. If this option is used with -G or -g, debugging information is not generated. This option takes precedence over -c.
-V
Displays compiler version information. Version information consists of the product name, the version number, and the current date and time.
Unlike all other command-line options, this option can be specified without specifying an input file name. If the command line specifies no source file, no compilation occurs.
-X npes
Specifies the number of Fortran images in the program. The npes value must match the number of images that will be specified through aprun or srun at job launch. Ensure that all object files are compiled using the same npes value. When using mixed npes values or if the number of PEs provided at run time differs from the -X npes value, a run time error will be received.
-W phase, "args"
Passes args directly to a phase of the compiling system. phase indicates a compiling system phase as shown:
| Phase | Compiling System Phase | Command |
|---|---|---|
| 0 (zero) | Compiler | ftn |
| a | Assember | as |
| c | CUDA linker | nvlink |
| l | linker | ld |
| r | Lister | ftnlx |
| x | PTX assember | ptxas |
- args enclosed in double quotes. Spaces appear within args.
- args not enclosed in double quotes. No spaces appear within args. Commas can appear wherever spaces normally appear; an option and its argument can be either separated by a comma or not separated.
For example, any of the following command lines would send -e name to the linker.
Because the preprocessor is built into the compiler, -Wp and -W0 are equivalent.
The -Wa"assembler_opt" option passes assembler_opt directly to the assembler. For example, -Wa"-h" passes the -h option directly to the as command, directing it to enable all pseudos, regardless of location field name. This option is meaningful to the system only when file.s is specified as an input file on the command line. For more information about assembler options, see the as(1) man page.
The -Wl,-rpath ldir option changes the runtime library search algorithm to look for files in directory ldir at link time. To request more than one library directory, specify multiple -rpath options. At link time, all ldir arguments are added to the executable.
A library may be found at link time with a -L option, but may not be found at run time if a corresponding -Wl,-rpath option was not supplied. Also, note that the compiler driver does not pass the -rpath option to the linker. Explicitly specify -Wl,-rpath when using -L.
The dynamic linker will search all ldir paths first for shared dynamic libraries at runtime, with one exception. The Linux environment variable LD_LIBRARY_PATH precedes all other search paths for shared dynamically linked libraries. The use of LD_LIBRARY_PATH is discouraged! Setting LD_LIBRARY_PATH changes the shared dynamically linked library search paths for all executable files in the environment.
The -Wr"lister_opt" option passes lister_opt directly to the ftnlx command. For example, specifying -Wr"-o file.o" passes the argument cfile.o directly to the ftnlx command's -o option; this directs ftnlx to override the default output listing and put the output file in cfile.o. If specifying the -Wr"lister_opt" option, specify the -r list_opt option. For more information about options, see the ftnlx man page.
The -Wx, args option can be used to pass command line arguments to the PTX assembler for OpenACC applications.
The -Wc, args option can be used to pass command line arguments to the CUDA linker for OpenACC applications.
-Y phase, dirname
| Phase | Compiling System Phase | Command |
|---|---|---|
| 0 (zero) | Compiler | ftn |
| a | Assembler | as |
| l | Linker | ld |
Because there is no separate preprocessor, -Yp and -Y0 are equivalent.