Using the -qtemplateregistry compiler option

The template registry uses a "first-come first-served" algorithm:

The instantiation information is stored in a template registry file. You must use the same template registry file for the entire program. Two programs cannot share a template registry file.

The default file name for the template registry file is templateregistry, but you can specify any other valid file name to override this default. When cleaning your program build environment before starting a fresh or scratch build, you must delete the registry file along with the old object files.

If you want to use either -qtemplateregistry or -qtempinc to compile your programs, you must organize your source code with -qtempinc. See the examples described in the Example of -qtempinc section for more information.

You can perform multiple compilations in parallel using the same template registry file with minimal impact on compile time.

When you recompile your program, the information in the template registry file is also used to determine whether a recompilation of a source file might introduce link errors because of missing template instantiations. If the following conditions are true, the compiler will schedule the recompilation of one or more source files when you recompile a source file: When the preceding conditions are all true, the compiler chooses another source file to instantiate the template in. That file is scheduled for recompilation during the link step. If you happen to recompile a source file that is scheduled to be recompiled during the link step, the scheduled recompilation is cancelled.

You can use -qnotemplaterecompile to disable the scheduled recompilation during the link step. For details, see -qtemplaterecompile (C++ only) in the XL C/C++ Compiler Reference.

If you also want to compile your program with -qtempinc, you must organize your source code so that it can be compiled with and without -qtempinc.