Technical data
Compiler Commands [2]
This section describes the compiler commands and the environment variables
necessary to execute the Cray Standard C and C++ compilers. The commands for
these compilers are as follows:
• CC, which invokes the Cray Standard C++ compiler.
• cc, which invokes the Cray Standard C compiler.
• c89, which invokes the Cray Standard C compiler. This command is a subset
of the cc command. It conforms with POSIX standard (P1003.2, Draft 12).
• cpp, which invokes the C language preprocessor. By default, the CC, cc, and
c89 commands invoke the preprocessor automatically. The cpp command
provides a way for you to invoke only the preprocessor component of the
Cray Standard C compiler.
A successful compilation creates an absolute binary file, named a.out by
default, that reflects the contents of the source code and any referenced library
functions. This binary file, a.out, can then be executed on the target system. For
example, the following sequence compiles file mysource.c and executes the
resulting executable program:
cc mysource.c
./a.out
With the use of appropriate options, compilation can be terminated to
produce one of several intermediate translations, including relocatable object
files (-c option), assembly source expansions (-S option), or the output of
the preprocessor phase of the compiler (-P or -E option). In general, the
intermediate files can be saved and later resubmitted to the CC, cc,orc89
commands, with other files or libraries included as necessary.
By default, the CC, cc, and c89 commands automatically call the loader, which
creates an executable file. If only one source file is specified, the object file is
deleted. If more than one source file is specified, the object files are retained.
The following example creates object files file1.o, file2.o, and file3.o, and the
executable file a.out:
CC file1.c file2.c file3.c
The following command creates the executable file a.out only:
CC file.c
S–2179–36 3










