Skip Navigation Links | |
Exit Print View | |
Oracle Solaris Studio 12.3 Overview Oracle Solaris Studio 12.3 Information Library |
Oracle Solaris Studio 12.3 Overview
Introduction to Oracle Solaris Studio Software
Developer Workflow for Oracle Solaris Studio
OpenMP 3.1 for Parallel Programming
Sun Performance Library for Programs With Intensive Computation
dmake Utility for Building Applications
Tools for Debugging Applications
Tools for Verifying Applications
Discover Tool for Detecting Memory Errors
Uncover Tool for Measuring Code Coverage
Code Analyzer Tool For Integrated Error Checking
Tools for Tuning Application Performance
Collect Performance Data With the Collector
Examine Performance Data With the Performance Analyzer
Examine Performance Data With the er_print Utility
Analyze Multithreaded Application Performance With the Thread Analyzer
Oracle Solaris Studio software includes C, C++, and Fortran compilers, which have the following features:
Comply with modern standards for C, C++, and Fortran programming languages.
Produce code that is targeted for specific operating systems, processors, architectures, memory models (32–bit and 64–bit), floating-point arithmetic, and more, according to command-line options you specify.
Perform automatic parallelization on serial source code to produce binaries that exhibit enhanced performance on multicore systems.
Produce code that is optimized in ways that you can specify through command-line options to suit your application and deployment environment.
Prepare binaries for enhanced debugging or analysis by other Oracle Solaris Studio tools.
Use the same command-line options across all the compilers to specify these features.
Some of the Oracle Solaris Studio compiler options you can use to optimize your compiled code for speed and take the best advantage of processor instruction sets and features are as follows:
Specifies a level of optimization indicated by n, which can be a number from 1 to 5. A higher optimization level creates a binary with better runtime performance.
Selects the optimum combination of compilation options for speed of executable code. -fast can be used effectively as a starting point for tuning an executable for maximum runtime performance.
Produces additional information in the binary for debugging with dbx and analysis with Performance Analyzer. Compiling with the -g option enables you to use the full capabilities of the Performance Analyzer, such as viewing annotated source, function information, and compiler commentary messages that describe the optimizations and transformations that the compiler made while compiling your program.
The Oracle Solaris Studio compilers provide significantly more information to help you understand your code than other compilers. With optimization, the compilers insert commentary describing the transformations performed on the code, any obstacles to parallelization, operation counts for loop iterations, and so forth. The compiler commentary can be displayed in tools such as the Performance Analyzer.
The Oracle Solaris Studio C compiler conforms to the ISO/IEC 9899:1999, Programming Language - C and ISO/IEC 9899:1990, Programming Languages-C standards. The C compiler also supports the OpenMP 3.1 shared-memory parallelism API.
The C compilation system consists of a compiler, an assembler, and a linker. The cc command invokes each of these components automatically unless you use command-line options to perform the steps separately.
The syntax of the cc command is:
cc [compiler-options] source-files [-llibrary]...
The compiler options precede the source file names. You can type cc -flags to see short descriptions of all the possible compiler options.
The source file names can end in .c, .s, .S, or .i. Files whose names do not end in one of these suffixes are passed to the link editor.
Following the source file names, you can optionally specify the -llibrary option to add object libraries to the linker's list of search libraries.
The link editor produces a dynamically linked executable named a.out by default. You can use the -o filename option to specify a different executable name. You can use the -c option to compile a source file and produce an object (.o) file but suppress linking.
To compile a source file named test.c and produce an executable file named a.out:
% cc test.c
To compile source files test1.c and test2.c and link them into an executable file called test:
% cc -o test test1.c test2.c
To compile the two source files separately and then link them into an executable:
% cc -c test1.c % cc -c test2.c % cc test1.o test2.o
For complete information about using the C compiler, and the cc command and its options, see the Oracle Solaris Studio 12.3: C User’s Guide and the cc(1) man page. For information about the new and changed features, software corrections, problems and workarounds, and limitations and incompatibilities of the compiler, see What’s New in the Oracle Solaris Studio 12.3 Release.
The Oracle Solaris Studio C++ compiler (CC) supports the ISO International Standard for C++, ISO IS 14822:2003, Programming Language — C++. The CC compiler also supports the OpenMP 3.1 shared-memory parallelism API. The OpenMP 3.1 API is included with Oracle Solaris Studio 12.3.
The C++ compiler consists of a front end, optimizer, code generator, assembler, template prelinker, and link editor. The CC command invokes each of these components automatically unless you use command-line options to specify otherwise.
The syntax of the CC command is:
CC [compiler-options] source-files [-llibrary]...
The compiler options precede the source file names. You can type CC -flags to see short descriptions of all the possible CC compiler options.
The source file names can end in .c, .C, .cc, .cxx, .c++, .cpp, or .i. Files whose names do not end with one of these suffixes are treated as object files or libraries and are handed over to the link editor.
Following the source file names, you can optionally specify the -llibrary option to add object libraries to the linker's list of search libraries.
By default, the files are compiled and linked in the order given to produce an output file named a.out. You can use the -o filename option to specify a different executable name. You can use the -c option to compile a source file and produce an object (.o) file, but suppress linking.
To compile a source file named test.C and produce an executable file named a.out:
% CC test.c
To compile the two source files test1.c and test2.C separately and then link them into an executable file called test:
% CC -c test1.c % CC -c test2.C % CC -o test test1.o test2.o
For complete information about using the C++ compiler , and the CC command and its options, see the Oracle Solaris Studio 12.3: C++ User’s Guide and the CC(1) man page. For information about the new and changed features, software corrections, problems and workarounds, and limitations and incompatibilities of the compiler, see What’s New in the Oracle Solaris Studio 12.3 Release.
The Fortran compiler in Oracle Solaris Studio is optimized for Oracle Solaris on multiprocessor systems. The compiler can perform both automatic and explicit loop parallelization to enable your programs to run efficiently on multiprocessor systems.
The Fortran compiler offers compatibility with Fortran77, Fortran90, and Fortran95 standards. and support of OpenMP 3.1.
The f95 command invokes the Oracle Solaris Studio Fortran compiler.
The syntax of the f95 command is:
f95 [compiler-options] source-files... [-llibrary]
The compiler options precede the source file names. You can type f95 -flags to see short descriptions of all the possible compiler options.
The source file names must be one or more Fortran source file names ending in .f, .F, .f90, .f95, .F90, .F95, or .for.
Following the source file names, you can optionally specify the -llibrary option to add object libraries to the linker's list of search libraries.
A sample command to compile a Fortran program from two source files:
% f95 -o hello_1 foo.f bar.f
To compile the same program with separate compile and link steps:
% f95 -c -o bar.o bar.f % f95 -c -o foo.o foo.f % f95 -o hello_1 bar.o foo.o
To compile the same program and link in a library called libexample:
% f95 -o hello_1 foo.f bar.f -lexample
For complete information about using the Fortran 95 compiler, and a description of the f95 command and its options, see the Oracle Solaris Studio 12.3: Fortran User’s Guide and the f95(1) man page. For information about the new and changed features, software corrections, problems and workarounds, and limitations and incompatibilities of the compiler, see What’s New in the Oracle Solaris Studio 12.3 Release.