Specifying options on the command line

XL Fortran supports the traditional UNIX method of specifying command-line options, with one or more letters (known as flags) following a minus sign:
  xlf95 -c file.f
You can often concatenate multiple flags or specify them individually:
  xlf95 -cv file.f     # These forms
  xlf95 -c -v file.f   # are equivalent
(There are some exceptions, such as -pg, which is a single option and not the same as -p -g.)
Some of the flags require additional argument strings. Again, XL Fortran is flexible in interpreting them; you can concatenate multiple flags as long as the flag with an argument appears at the end. The following example shows how you can specify flags:
# All of these commands are equivalent.
  xlf95 -g -v -o montecarlo -p montecarlo.f
  xlf95 montecarlo.f -g -v -o montecarlo -p
  xlf95 -g -v montecarlo.f -o montecarlo -p
  xlf95 -g -v -omontecarlo -p montecarlo.f
# Because -o takes a blank-delimited argument,
# the -p cannot be concatenated.
  xlf95 -gvomontecarlo -p montecarlo.f
# Unless we switch the order.
  xlf95 -gvpomontecarlo montecarlo.f

If you are familiar with other compilers, particularly those in the XL family of compilers, you may already be familiar with many of these flags.

You can also specify many command-line options in a form that is intended to be easy to remember and make compilation scripts and makefiles relatively self-explanatory:
Read syntax diagramSkip visual syntax diagram
>>- -q--option_keyword--+---------------------------------------+-><
                        |    .-:------------------------------. |   
                        |    V                                | |   
                        '-=----suboption--+-----------------+-+-'   
                                          |    .-,--------. |       
                                          |    V          | |       
                                          '-=----argument-+-'       

This format is more restrictive about the placement of blanks; you must separate individual -q options by blanks, and there must be no blank between a -q option and a following argument string. Unlike the names of flag options, -q option names are not case-sensitive except that the q must be lowercase. Use an equal sign to separate a -q option from any arguments it requires, and use colons to separate suboptions within the argument string.
For example:
 xlf95 -qddim -qXREF=full -qfloat=nomaf:rsqrt -O3 -qcache=type=c:level=1 file.f


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us