aCC [options] [files]
aCC command (the driver) invokes the HP
aC++ compiling system.
CAUTION: You must use the aCC command to link your HP aC++ programs and libraries. This ensures that all libraries and other files needed by the linker are available.
aCC prog.C
Compiles the source file prog.C and puts the executable code in
the file a.out.
Each file can be:
All other files are passed directly to the linker by the compiler.
Unless you use the -o
option to specify otherwise, all files that the aCC compiling
system generates are put in the working directory, even if the source files came
from other directories.
.c or .C, possibly followed by additional characters.
If you compile only, each C++ source file produces an object file with the same file name prefix as the source file and a .o file name suffix. However, if you compile and link a single source file into an executable program in one step, the .o file is automatically deleted.
CAUTION: It is recommended that your source files have
extensions of .c or .C only, without additional
characters. While file extensions other than .c or .C
are permitted for portability from other systems, other endings may not be
supported by HP tools and environments.
.i are assumed to be preprocessor output files.
Files ending in .i are processed the same as .c or
.C files, except that the preprocessor is not run on the
.i file before the file is compiled.
Use the -P or the -E compiler option to preprocess a C++ source file without compiling it.
.s are assumed to be assembly source files.
The compiler invokes the assembler through cc to produce .o
files from these.
Use the -S option to compile a C++ source file to assembly code
and put the assembly code into a .s file.
.o
extensions are assumed to be relocatable object files that are to be included in
the linking.
The compiler invokes the linker to link the object files and produce an executable file.
Use the -c option to compile a C++ source file into a
.o file.
.a
are assumed to be archive libraries. Files ending with .so are
assumed to be shared libraries.
Use the -c and +z options to create object files of
position-independent code (PIC) and the -b option to
create a shared library.
Use the -c option to create object files and the ar
command to combine the object files into an archive library.
aCC -o prog prog.CCompiles
prog.C and puts the executable code in the file
prog, rather than in the default file a.out.
aCC -g prog.CCompiles
prog.C and includes information allowing you to debug the program
with the HP/WDB Debugger, wdb.
aCC -c prog.CCompiles
prog.C and puts the object code in the file
prog.o. Does not link the object file and does not create an
executable file.
aCC file1.o file2.o file3.o
Links the listed object files and puts the executable code in the file
a.out.
CAUTION: You must use the aCC command to link your HP aC++ programs and libraries. This ensures that all libraries and other files needed by the linker are available.
aCC -O -v prog.CCompiles and optimizes
prog.C, gives verbose progress
reports, and creates an executable file a.out.
aCC +z -c prog.C aCC -b -o mylib.sl prog.o
The first line compiles prog.C, creates the object file
prog.o, and puts the position-independent code (PIC)
into the object file. The second line creates the shared library
mylib.sl, and puts the executable code into the shared library.
CXXOPTS
CCLIBDIR
CCROOTDIR
TMPDIR
export CXXOPTS="options | options" ksh/sh notation setenv CXXOPTS "options | options" csh notationFor Legacy HP C,
export CCOPTS="options | options" ksh/sh notation setenv CCOPTS "options | options" csh notationRefer to the HP C/HP-UX Reference Manual for more information.
If you do not use the vertical bar, all options are placed before the command line parameters.
Just set the environment variable and the options you want are automatically
included each time you execute the aCC command.
export CXXOPTS="-v | -lm" ksh/sh notation setenv CXXOPTS "-v | -lm" csh notation
Causes the -v and -l options to be passed to the aCC command
each time you execute it.
When CXXOPTS is set as above, the following two commands are
equivalent:
aCC -g prog.C aCC -v -g prog.C -lm
export CCLIBDIR=directory ksh/sh notation setenv CCLIBDIR directory csh notation
directory is an HP-UX directory where you want HP aC++ to look for libraries.
aCC command to search for libraries
in an alternate directory before searching in the default directories.
export CCLIBDIR=/mnt/proj/lib
Specifies that HP aC++ search the directory /mnt/proj/lib for
libraries, then search the directory /opt/aCC/lib.
When CCLIBDIR is set as above, the following two commands are
equivalent:
aCC -L/mnt/proj/lib file.o aCC file.o
export CCROOTDIR=directory ksh/sh notation setenv CCROOTDIR directory csh notation
directory is an aCC root directory where you want the HP aC++ driver to look for subprocesses.
aCC to invoke all subprocesses from an
alternate aCC directory, rather than from their default directory. The default
aCC root directory is /opt/aCC.
export CCROOTDIR=/mnt/CXX2.1
Specifies that HP aC++ search the directories under /mnt/CXX2.1
(/mnt/CXX2.1/bin and /mnt/CXX2.1/lbin) for subprocesses rather than their
respective default directories.
export TMPDIR=directory ksh/sh notation setenv TMPDIR directory csh notation
directory is the name of an HP-UX directory where you want HP aC++ to put temporary files during compilation.
/var/tmp.
export TMPDIR=/mnt/temp ksh notation setenv TMPDIR /mnt/temp csh notation
Specifies that HP aC++ should put all temporary files in
/mnt/temp.
By default, HP aC++ is installed under the /opt/aCC directory. In prior releases, the compiler driver (aCC) looked for related files in subdirectories of /opt/aCC. This prevented installation of more than one version of HP aC++ on the same system at the same time.
Note that only the files in /opt/aCC are affected by floating installation. No matter which HP aC++ driver you are using, the compiler still uses the libraries, linker, and other files located in /usr/lib and /usr/ccs.
Floating installation is designed to help facilitate inhouse development. Be aware that you must not ship libraries in non-standard places, since explicit run-time library specifications and linker options are required.
Note: You can use the __HP_aCC
predefined macro to determine which version is being run.
Setting Up Floating Installation |
Assume that your system will have two versions of the compiler, both floating install enabled. In this case, A.03.10 is the prior version, and A.03.13 is the more recent version.
cp -rp /opt/aCC /opt/aCC.03.10
/opt/aCC.03.10/bin/aCC app.CAlternatively, you could change your PATH environment variable or set up an alias for the absolute path.
aCC app.C
If you want to floating install a newer compiler, use swinstall to install the compiler to an alternate root:
Alternatively, you could change your PATH environment variable or set up an alias for the absolute path.