qpc -- Quintus Prolog compiler

Synopsis

     qpc [-cvhDHMN] [-o output] [-i initialization-file]
          [ -L library-directory ] [ -a quintus-product ]
          [ -f path-name:path-spec ]
          [ -F path-name:path-spec ]
          [ -p path-name ]
          filename ...  [ -QLD qld-options ]
     

Description

qpc compiles the specified Prolog files into QOF (Quintus Object Format) files. It then invokes qld(1) to link them together and produce an executable image (unless the -c option is given). The QOF files are not deleted after processing terminates.

Each filename must be the name of a valid Prolog source file or a QOF file. Either absolute or relative filenames may be specified. If filename does not name an existing file, and if it does not already have an extension, then .pl and .qof extensions are sought in that order.

File names may be specified as simple paths (e.g. file.pl, ~/library/file) or as file search paths of the form library(file), mylib(language(file)), etc. In the latter case, the path specification must be quoted to escape the shell's interpretation of the parentheses.

Unless the -o option is given, the name of the output file is the name of the input file with the trailing .pl, if any, replaced by .qof. If the input filename does not have a .pl extension, then a .qof extension is appended. The argument to -o may also be specified the file search path form (see above).

Source files specified on the qpc command line are always recompiled even if the corresponding QOF files are up to date (unless the -M switch is specified). QOF files, on the other hand, are only recompiled if they are out of date compared to the corresponding source files.

All the "dependencies" of a file, that is all the files named in embedded load commands in that file (or in its source if it is a QOF file), are checked to ensure that they are up-to-date, and they are recompiled if necessary. This checking and recompiling of dependencies can be disabled using the -N option.

A filename of - can be used to specify that Prolog source code is to be read from the standard input. The corresponding QOF file will be called a.qof.

Command line options may alter the above behavior as indicated below. Unrecognized options and their arguments, if any, are passed to qld(1). Furthermore, the arguments following a -QLD option are not processed by qpc but are passed to qld(1). Note also that the command line is parsed from left to right. This will affect how the file search path or library directory definitions are added if -f, -F, -L, or -a options are used.

Options


-a quintus-product
Specifies that the libraries for a particular Quintus product that is sold separately are to be used. These Quintus products are normally installed in the quintus-directory. List this directory to find the valid directory names for these products. This option is equivalent to one or more -L switches. Note that the libraries shipped with Quintus Prolog (qui, proxt, and proxl) are automatically available in the system, and, therefore, require no -a flag.
-c
The input files are simply compiled into QOF format, and no further processing takes place.
-f path-name:path-spec
Similar to the -L option, but path-name:path-spec defines a general file search, which instructs qpc to look for a file in directory path-spec whenever a file specification of the form path-name(file-spec) is encountered (in embedded load commands, in QOF file dependencies, or on the command line). The path-name and the directory, path-spec, are separated by :, and, therefore, path-name cannot contain a colon. If path-spec is given in the file search path form (as in library:mylib(library)), then the argument must be quoted to escape the shell's interpretation of the parentheses. path-spec may be . or null, in which case . is assumed.

There may be a list of path definitions (i.e. -f or -F options) for the same path-name. qpc searches the list, just like Prolog, whenever it needs to expand a file search path specification. The -f options appends (like assertz in Prolog) the new path to the end of the list of paths for path-name, while -F prepends (like asserta in Prolog).

File search paths may also be defined using asserts in the Prolog source being compiled or in initializaiton files (see -i). The -f, -F, -L, and -a options given on the qpc command line, and file_search_path and library_directory definitions asserted in source files or initialization files, are passed on to qld(1).

-h
Hides or "locks" the predicates in the file so that they are not visible to the debugger. Such predicates will have predicate_property "locked" when they are linked or loaded into a Prolog system.
-i initialization-file
Specifies an initialization file. The initialization file may be a source (.pl) or QOF (.qof) file. Currently, source files cannot load foreign code; in other words, they cannot contain calls to load_foreign_files/2 or load_foreign_executable/1. The definitions in the initialization file apply during the compilation of all files specified to the right of the -i switch on the command line. The definitions in the initialization file apply only during compile time. Therefore, no QOF file is generated from an initialization file and its content is not included in any of the generated QOF files. The initialization file may be specified in the file search path form (eg. -i "library(basics)").
-o output
Specifies a name for the output file. If used with the -c option, the qof file will be produced into the given file. In this case, there may be several -o options for each qof file. If the -o names a directory, all qof files will be placed in the given directory. If the -c option is not used, the -o is passed onto qld(1).
-p path-name
This option is just passed to qld(1) along with its argument, asking qld(1) to print out the file search definition for path-name.
-v
When this option is specified, qpc echoes its activities, including the call to qld(1), to the standard output. This flag is also passed on to qld(1).
-D
This option is just passed to the linker qld(1) indicating that the Quintus Development System should be linked in.
-F path-name:path-spec
Similar to -f, but the path is added at the front of the list of paths for path-name. Note that -F library:library-directory is identical to -L library-directory.
-H
Like -h but in this case the hiding (locking) is done also to any files that are compiled because of embedded load commands in the file.
-L library-directory
File specifications of the form library(Filespec) encountered in embedded load commands are searched for in the library search paths. The initial search paths are the same as in the Development System (see prolog(1)). Additional directories may be prepended to the list of library search paths with this option. Note that the command line is parsed from left to right. Also note that the -L must be followed by a space; otherwise, qpc assumes that the option specifies a library directory for qld.

Library directories may also be specified with the -f and -F options. library-directory may be a path to a directory (e.g. dir, ~/dir) or a file search path specification of the form mylib(library). In the latter case, the path-name mylib must be defined either in the Prolog source code being compiled or by -f or -F options.

-M
Specifies that files on the command line are not to be compiled if their corresponding QOF files are more recent than they are.
-N
Specifies that files specified in embedded load commands are not to be compiled. (By default they would be compiled unless their QOF files are already up-to-date.)
-QLD
All remaining options are simply passed to qld(1).

Environment


TMPDIR
Directory for creating temporary files. The default is /usr/tmp

Files


a.out
Executable output file
a.qof
Output QOF file if filename is -
file.pl
Prolog source file
file.qof
Quintus QOF file
$TMPDIR/qp*
Compiler temporary files
runtime-directory/qld
QOF link editor
runtime-directory/qcon
QOF consolidator

See Also

prolog(1), qcon(1), qgetpath(1), qld(1), qnm(1)