C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

The Accelerator and OCA take as input an executable TNS object file and produce as output an
accelerated object file. The accelerated object file contains both the original TNS code and the
logically equivalent optimized native instructions—accelerated object code.
The basic steps to accelerate a C program are:
1. Compile and bind the program.
2. Debug the program, if necessary.
3. Run the Accelerator. On TNS/R systems, you do this with the AXCEL command. On TNS/E
systems, you use the OCA command.
If the Accelerator or OCA issues an error message, correct the error and run the Accelerator
or OCA again to produce an output file.
4. Run the NonStop SQL/MP compiler, if the program contains embedded NonStop SQL/MP
statements.
5. Perform final testing on the accelerated program.
To save time in accelerating your programs, to produce the smallest possible accelerated object
files, and to ensure that the Accelerator or OCA produces the most efficient code, to do these:
Use C function prototypes for all your C routines.
Generate and retain the Binder and Inspect symbols regions for your programs. After
accelerating a program, you can strip the symbols region from it without affecting performance.
For a complete description of accelerating programs for TNS/R systems, see the Accelerator
Manual. For a complete description of accelerating programs for TNS/E systems, see the Object
Code Accelerator (OCA) Manual. Topics covered in these manuals include:
Determining which programs to accelerate
Preparing your program for acceleration
Specifying Accelerator or OCA program command-line syntax
Setting Accelerator or OCA options
Increasing the performance of accelerated programs
Debugging accelerated programs
Working in the OSS Environment
From a G-series Open System Services (OSS) environment, you can compile, bind, and accelerate
TNS C programs for either the OSS or Guardian environment. In the OSS environment, you use
the TNS c89 utility to invoke the C compiler, the Binder (the BIND program), and the Accelerator
(the AXCEL program) to develop your applications. OCA is not available from the TNS c89 utility.
This subsection is only a summary.
Versions of the c89 Utility
The TNS c89 utility is located in the /nonnative/bin directory on D40 and later D-series and
G-series software releases. By default, the native c89 utility is run. You must set /nonnative/bin
at the start of your PATH environment variable to get the TNS c89 utility instead of the native c89
utility.
For more details, see the TNS c89 online reference page (man -M /nonnative/usr/share/man
c89). The c89 reference page in D40 and later versions of the Open System Services Shell and
Utilities Reference Manual describes the native c89 utility.
268 Compiling, Binding, and Accelerating TNS C Programs