This page describes the hpj command and provides a complete description of the command syntax, options, and arguments. The hpj command is similar to the JDK javac command. Specifically, this page discusses the following topics:
Syntax
hpj [[options]...input-files]...
Options
The following table lists the options and associated arguments
that you can specify with the hpj command.
Option | Description | Default |
-- arg | Treat any argument specified with the double-dash (--) option as a filename, even if the argument begins with a dash (-). | |
-architecture arch | Generate code for the specified architecture.
|
![]()
|
-B option | Pass the specified option to the linker. The valid options are linker- and operating system-specific. | |
-c | Compile to an object file without linking. | |
-classpath path | Set the classpath to the specified path. HPCJ-specific entries are not added to the classpath if this option is used. (The default classpath is the value specified for the environment variable CLASSPATH, with the HPJ classes prepended and '.' appended.) Additional information about setting the classpath is found in the topic Changing Environment Settings. | |
-[no]collapse | [Do not] Put object files in one directory. The default is the current directory unless the -d option is specified. | -nocollapse |
-[no]compact | [Do not] Reduce code size at the expense of execution speed. | -[no]compact |
-d dir | Deposit class and object files in the specified directory and its subdirectories, rather than in the directory in which the source or class files are found. | |
-exclude prefix | Exclude all classes beginning with the specified
prefix. In this case, prefix can be one of the
following: foo If you specify foo as the prefix, the compiler searches for a specific class named foo. If you specify foo* as the prefix, the compiler searches for all classes that begin with the string foo. If you specify foo\* as the prefix, it is the same as specifying foo*. Additional information about this option is discussed in the section below entitled Understanding the -include and -exclude Options. |
|
-exe | Produce an executable. This is the default action unless the -c, -jll, or -jlc option is specified. | -exe |
-[no]follow | [Do not] Recursively compile classes referenced from classes specified on the command line. | -follow (unless -c is specified) |
-[no]g | [Do not] Emit debugging information. | -nog |
-help or -? | If no other arguments are specified on the command line, the -help or -? options cause HPCJ to display usage information. | |
-include prefix | Include all classes beginning with the specified
prefix. In this case, prefix can be one of the
following: foo If you specify foo as the prefix, the compiler searches for a specific class named foo. If you specify foo* as the prefix, the compiler searches for all classes that begin with the string foo. If you specify foo\* as the prefix, it is the same as specifying foo*. Additional information about this option is discussed in the section below entitled Understanding the -include and -exclude Options. |
|
-jlc | Compile each class into a simple DLL with a .jlc extension. | |
-jll | Compile classes into a compound DLL with a .jll extension. | |
-[no]list | [Do not] Produce object code listing files. | -nolist |
-main classname | Set the name of the class that contains the main() method. | First class found during processing that contains main() |
-maxmem size | ![]() |
|
-nomaxmem | Use as much storage as available for optimizations. | |
-o file | Name the executable file, compound DLL (.jll), or simple DLL (.jll). | If the -o option is not specified, then the default
name of the executable is:
If the -o option is not specified, then the default name of any simple DLL is the class name. (Note that there is no default name for compound DLLs, so you must use the -o option.) |
-[no]O | [Do not] Optimize. | -noO |
-partial prefix | Compile only those classes that begin with the
specified prefix. In this case, prefix can be
one of the following: foo If you specify foo as the prefix, the compiler searches for a specific class named foo. If you specify foo* as the prefix, the compiler searches for all classes that begin with the string foo. If you specify foo\* as the prefix, it is the same as specifying foo*. Additional information about this option is discussed in the section below entitled Understanding the -include and -exclude Options. |
|
-spill size | ![]() |
|
-tune arch | Optimize code generation for a particular
architecture.
|
![]()
|
Understanding the -include and -exclude Options
HPCJ produces an executable or DLL by taking a list of
classes specified on the command line and compiling the classes
to object code. In turn, the generated object files contain
references to other classes. The nature of each reference is
dependent on whether the referenced class is contained within the
same binary file, either an executable or compound DLL (.jll), or
in another binary file. When an executable or compound DLL is
compiled, all of the classes within that binary file must be
added to a list of classes that can be read by the compiler.
There are several hpj command options that play
a role in building the list of classes.
When you specify a Java source file, class file, or a classname as an argument on the hpj command, it adds a class to the list of classes that are accumulated for the specified binary file. Similarly, when a .zip or .jar file is specified, all of the classes contained within the file are added to the list. The -include option and accompanying prefix argument is used to add all of the specified classes found in the classpath to the list of classes. Unless the -nofollow option is specified, once all of the command line options have been processed, a dependancy analysis is performed, which means that any new classes that are found by recursively following references from classes in the list of classes are added to the class list. When a class list has been built using the -include option, any classes identified using the -exclude option and accompany prefix argument are processed in order from left to right and removed from the class list. A final list of classes is then produced that is used to build the executable or compound DLL. Any known JDK classes that are already supplied by the HPCJ compound DLLs (java and sun packages, excluding sun.tools) are ignored. At this point, HPCJ begins to compile the object code.
It is recommended that you compile and link in one step. Because the hpj command needs a complete list of classes within the compound DLL or executable being compiled, it is possible to produce incompatible objects in different invocations of HPCJ. You can then produce a compound DLL or executable that appears to link without any errors, but that actually consists of incompatible object files.
Input Files
The following table lists the input files that you can
specify using the hpj command.
Input Files | Description |
file.java | The name of a Java source file that is added to the list of source files. When the compiler is run against this file, all classes generated from the source file are added to the list of classes. The class and object files compiled from the source files are placed into the same directory as the source files. |
classname | The name of a Java class file (specified without a .class extension) that is added to the list of classes. The class must appear in the classpath. Class files are compiled to object files. The default behavior is to compile the object files into the same directory as the class files. |
file.class | The name of a Java class file (specified with a .class extension) that is added to the list of classes. The class must appear in the classpath. Class files are compiled to object files. The default behavior is to compile the object files into the same directory as the class files. |
file.jar file.zip |
The name of a JAR or ZIP file that contains classes that are added to the list of classes. Specifing a JAR or ZIP file is equivalent to specifying all of the classes contained within the JAR or ZIP file. Classes contained in JAR or ZIP files are compiled to the current directory in much the same way that classes are compiled to the current directory if the -collapse option is specified. |
![]() file.o
|
The name of an object file that is added to the list of linker files. Object files are simply passed to the linker. |
![]() file.a
|
The name of an object library that is added to the list of linker files. Library files are simply passed to the linker. |
@file | The name of a response file. Response files are simple text files that contain multiple command-line arguments. The argument @file is replaced on the command line by the contents of the specified file. Any wildcards within a response file are not expanded. |