When you partially compile executables and compound DLLs using the hpj command, you minimally generate object modules for a selected subset of classes that comprise an executable or compound DLL. You accomplish this by specifying the -partial command option. For instance, if you need to recompile a DLL or executable because of changes you made to one or more classes, you can issue the hpj command with the -partial option to specify the exact classes that you need to recompile to reconstruct the DLL or executable.
When performing a partial compile, even though you only build a portion of the total executable or DLL, the entire class list and Class Selection options are specified in addition to the list of those classes that are being recompiled. The -partial option specifies the set of classes to be recompiled and you typically specify multiple -partial options. The reason that the entire class list and Class Selection options are specified is that HPCJ will generate more space- and time-efficient code when it is passed the precise class list that will be in the target Java executable or compound DLL. Additionally, the class list and Class Selection options are used to determine the object modules that need to be linked together when the executable or compound DLL is produced. Failure to specify the correct class list and Class Selection options during a partial compilation may result in different object code than is generated in a full build.
HPCJ does not support binary compatibility as defined in Chapter 13 of the Gosling/Joy/Steele language specification. In general, if you only change the body of a method of in a class, the clients of that class do not need to be recompiled. Any other changes, such as those that change the number, types, modifiers, or order of methods and fields in a class, will require all clients of that changed class to be recompiled. For this reason, you should exercise caution when using partial compilation.
Information about using the hpj command options to control your compilation activities is found in the topic Building Executables and DLLs.
To partially compile executables or compound DLLs:
Example:
In this example, you only recompile (without linking) the Animator class, which is contained in an executable containing the Animator and Animator2 classes. Also, you produce an object code listing for the recompiled Animator class.
hpj -c -O -nofollow Animator Animator2 -partial Animator -list
In the example, the -c option instructs the compiler to omit linking. The -O option specifies that optimized code is to be built. The -nofollow option instructs the compiler to ignore referenced classes and indicates that only the specified classes Animator and Animator2 comprise the executable. The -partial specifies that only the Animator class is to be recompiled.
Both the Animator and Animator2 classes and a Class Selection option (-nofollow) are specified so that the same object code is generated for the Animator class as would be generated in a full build. An object code module is produced in this step which can be used in a subsequent link step. The -list option causes an object code listing to be produced in addition to the object code module.
The object code module is called
Animator.o.
The object code module is called Animator.obj.