Go to main content

Oracle® Developer Studio 12.6: Overview

Exit Print View

Updated: February 2018
 
 

Oracle Developer Studio Compilers

Oracle Developer 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 Developer Studio tools.

  • Use the same command-line options across all the compilers to specify these features.

Some of the Oracle Developer 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.

Oracle Developer Studio compilers provide significantly more information than other compilers to help you understand your code. 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 Performance Analyzer.

C Compiler

The Oracle Developer Studio C compiler conforms to the ISO/IEC 9899:2011, ISO/IEC 9899:1999, and ISO/IEC 9899:1990, Programming Languages-C standards. The C compiler also supports the OpenMP 4.0 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 [-Ldir] [-llibrary]...

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.

You can also specify the –Ldir option to add directories to the list so that the linker searches for libraries, and the –llibrary option to add object libraries to the linker's list of search libraries. The directories specified by the –L option are searched in the order listed.

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 Developer Studio 12.6: C User’s Guide and the cc(1) man page. For information about the new and changed features, see What’s New in the Oracle Developer Studio 12.6 Release. For information about problems and workarounds, and limitations and incompatibilities of the compiler, see Oracle Developer Studio 12.6: Release Notes.

C++ Compiler

The Oracle Developer Studio C++ compiler (CC) supports the ISO International Standard for C++, ISO/IEC 14882:2014, Programming Language — C++, ISO International Standard for C++, ISO IS 14822:2003, Programming Language — C++, and ISO International Standard for C++, ISO/IEC 14882:2011. The CC compiler also supports the OpenMP 4.0 shared-memory parallelism API. The OpenMP 4.0 API is included with Oracle Developer Studio 12.6.

The C++ compiler (CC) produces 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. The compiler automatically parallelizes serial source code to produce binaries with better performance on multicore systems and can also prepare binaries for enhanced debugging or analysis by other Oracle Developer Studio tools. The compiler also supports GNU C/C++ compatibility features.

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 [-Ldir] [-l library]...

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 –Ldir option to add directories to the list that the linker searches for libraries, and the–llibrary option to add object libraries to the linker's list of search libraries. The –L option must precede the associated library on the command line.

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 Developer Studio 12.6: C++ User’s Guide and the CC(1) man page. For information about the new and changed features, see What’s New in the Oracle Developer Studio 12.6 Release. For information about problems and workarounds, and limitations and incompatibilities of the compiler, see Oracle Developer Studio 12.6: Release Notes.

Fortran 95 Compiler

The Fortran compiler in Oracle Developer 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 4.0.

The f95 command invokes the Oracle Developer 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 Developer Studio 12.6: Fortran User’s Guide and the f95(1) man page. For information about the new and changed features, see What’s New in the Oracle Developer Studio 12.6 Release. For information about problems and workarounds, and limitations and incompatibilities of the compiler, see Oracle Developer Studio 12.6: Release Notes.