| Cray C/C++ Reference Manual | ||
|---|---|---|
| Prev Section | Next Section | |
This section describes the following commands and the environment variables necessary to execute the compilers associated with the Cray C++ programming environment:
CC command invokes the Cray C++ compiler.
cc command invokes the Cray Standard C compiler.
c89 command invokes the Cray Standard C compiler. This command is a subset of the cc command and conforms with the POSIX standard (P1003.2, Draft 12).
cpp command explicitly invokes the preprocessor component of the Cray Standard C compiler.
The compilation process, if successful, 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, or c89 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 |
The CC command invokes the Cray C++ compiler. The CC command accepts C++ source files that have the .c, .C, .i, .c++, .C++, .cc, .cxx, .Cxx, .CXX, .CC, and .cpp suffixes; object files with the .o suffix; library files with the .a suffix; and assembler source files with the .s suffix.
The CC command format is as follows:
CC [-c] [-C] [-d string] [-D macro[=def]] [-E] [-F] [-g] [-G level] [-h arg] [-I incldir] [-l libfile] [-L libdir] [-M] [-o outfile] [-O [level]] [-P] [-s] [-S] [-U macro] [-V] [-Wphase,["opt..."]] [-Xnpes] [-Yphase,dirname] [-#] [-##] [-###] files... |
| Prev Section | Table of Contents | Title Page | Next Section |
| Standard Template Library (STL) | Up one level | cc Command |