JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Studio 12.3 Overview     Oracle Solaris Studio 12.3 Information Library
search filter icon
search icon

Document Information

Preface

Oracle Solaris Studio 12.3 Overview

Introduction to Oracle Solaris Studio Software

Developer Workflow for Oracle Solaris Studio

Oracle Solaris Studio IDE

Oracle Solaris Studio Compilers

C Compiler

cc Command Syntax

C Documentation

C++ Compiler

CC Command Syntax

C++ Documentation

Fortran 95 Compiler

f95 Command Syntax

Fortran Documentation

C/C++/Fortran Libraries

OpenMP 3.1 for Parallel Programming

Sun Performance Library for Programs With Intensive Computation

dmake Utility for Building Applications

Tools for Debugging Applications

dbx on the Command Line

dbx in the IDE

dbx in dbxtool

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

Performance Analyzer Tools

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

Simple Performance Optimization Tool (SPOT)

Profiling Tools in DLight

Profiling Tools in the IDE

For More Information

Oracle Solaris Studio Compilers

Oracle Solaris Studio software includes C, C++, and Fortran compilers, which have the following 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:

-On

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.

-fast

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.

-g

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.

C Compiler

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.

cc Command Syntax

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

C Documentation

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.

C++ Compiler

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.

CC Command Syntax

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

C++ Documentation

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.

Fortran 95 Compiler

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.

f95 Command Syntax

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

Fortran Documentation

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.