User`s guide
Cray XMT™ Programming Environment User’s Guide
7.2 Invoking the Compiler
You can only use the Cray XMT compiler when the Cray XMT Programming
Environment (mta-pe) module is loaded. The commands to use to invoke the
compiler are cc for a C program and c++ for a C++ program.
You can control the operation of the compiler by setting various options when
running the compiler command. The compiler uses driver options, language options,
parallelization options, and debugging options.
The driver options control how the compiler invokes subprograms. The compiler
mode is set using driver options. The driver options that you use most often are the
following:
-c filename
Compiles a specified source file.
-o filename
Links files and creates an executable.
-pl filename
Places object code and other data generated by the compiler into
a program library file. This option is used for whole-program
compilation.
For example, if you specify both the -c and -pl driver options, the compiler
compiles the program in whole program mode, but it does not link the files into an
executable. For more information, see Setting the Compiler Mode on page 80.
The language options control how the front end processes information. For example,
the -E option indicates that the compiler should preprocess source files but not
compile them. The -no_float_opt option prevents floating-point optimization.
The parallelization options control parallelism in the program. For example, the
-par1 option compiles a program so that it runs in parallel on a single processor.
For more information, see Optimizing Parallelization on page 85.
The debugging options control how the debugger works. For more information, see
Setting Debugger Options during Compilation on page 88.
Each compiler uses the same set of command-line options. For a complete list of
command-line options, see the cc(1) or c++(1) man pages.
7.3 Setting the Compiler Mode
To set the compiler mode to whole-program mode, run the cc or c++ command with
the -pl option. This option builds a program library.
80 S–2479–20