Chapter 2. Compiler Commands

Table of Contents
2.1. CC Command
2.2. cc Command
2.3. Command-line Options
2.4. Language (Standard Conformance)
2.5. Language (Templates)
2.6. Language (Virtual Functions)
2.7. Language (General)
2.8. Optimization (General)
2.9. Optimization (Multi-Streaming Processor) (Deferred Implementation)
2.10. Optimization (Vector)
2.11. Optimization (Task)
2.12. Optimization (Inline)
2.13. Optimization (Scalar)
2.14. Optimization (UNICOS/mk Specific)
2.15. Math
2.16. Analysis Tools
2.17. Debugging
2.18. Messages
2.19. Compilation Phases
2.20. Preprocessing
2.21. Loader
2.22. General
2.23. Command-line Examples
2.24. Environment Variables

This section describes the following commands and the environment variables necessary to execute the compilers associated with the Cray C++ programming environment:

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

2.1. CC Command

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...