<commit_before>.TH SWI 1 "May 18 1996"
.SH NAME
plld \- Create a SWI-Prolog embedded executable
.SH SYNOPSIS
.BR plld
.BI "options" " " "c-files" " " "o-files" 
.BI "pl-files"
.br
.SH DESCRIPTION
The utility
.BI plld
is a front-end for the C-compiler and linker to create a stand-alone
executable from a series of C/C++ and Prolog input files. It extracts
information from the SWI-Prolog executable
.B pl,
after which it scans the arguments and breaks them into several
categories.  It will then call the C-compiler to create an executable
containing the user's C-code and the SWI-Prolog kernel.  After this,
it will call the development environment to create a Prolog saved
state from the prolog files and finally it will create the target
executable by concatenating the state to the emulator.  See also
.BI qsave_program/2
from the
.BI SWI-Prolog " " manual.

.SS Options
.TP
.BI \-pl " prolog"
Specifies the prolog version to use.  The default is
.BI pl.
This flag may be used to choose between different versions installed
on your system, or to specify a modified version.  A modified version
should understands the flags
.BI \-dump-runtime-variables
.BI \-f " file"
.BI \-F " file"
.BI \-g " goal"
.BI \-t " toplevel".
.TP
.BI \-help
Shows options briefly
.TP
.BI \-nostate
Just relinks the kernel.  The newly linked kernel can only function
in the presence of the development system.  Any supplied prolog sourcefiles
are ignored, and so are the options
.BI \-goal
.BI \-toplevel
.BI \-initfile.
.BI \-class
This is the preferred way to attach external modules to Prolog if
dynamic loading is not supported on your system.
.TP
.BI \-goal " goal"
The goal that is initially executed when the toplevel is started using
.BI "PL_toplevel()" .
E.i. the default.
.BI \-g
flag for the new executable.
.TP
.BI \-toplevel " goal"
The goal that is executed as the main toplevel goal.  E.i. the default.
.BI \-t
flag for the new executable.
.TP
.BI \-initfile " file"
The file that is loaded by the toplevel.  E.i. the default.
.BI \-f
flag for the new executable.
.TP
.BI \-class " {runtime,kernel,development}"
Set the save-class of the Prolog saved-state that is created.  If
.B runtime
(default), the resulting system leave interpretation of all arguments
to the application.  If
.B kernel
all predicates will be locked for the tracer.  Finally, if
.B development
the state is saved `as-is' and the resulting system processes options
just as the basic SWI-Prolog executable does.  See also
.B "qsave_program/2"
in the
.IR "SWI-Prolog reference manual".
.TP
.BI \-v
Verbose operation.  This will echo the commands before executing them.
Note that some commands are printed as shell commands, but actually
executed by plld itself for compatibility with the Win32 platforms.
.TP
.BI \-f
Fake operation.  Together with
.BI \-v
this prints the commands that need to be executed without actually
doing anything.
.TP
.BI \-o " file"
Specifies the name of the final executable.  The default is
.BI a.out.
.TP
.BI \-cc " C-compiler"
Specify the compiler to use for
.BI *.c
files.  Default is the compiler used to compile SWI-Prolog itself,
as read from the feature
.BI c_cc.
.TP
.BI -c++ " C++-compiler"
Specify the compiler to use for C++ input files.  If the C-compiler
is
.BI gcc
this is
.BI g++,
otherwise
.BI c++
is assumed.
.TP
.BI \-ld " linker"
Spefies the linker to use.  Default is the C-compiler.  On Win32
platforms, the default is
.BI link.exe.
.TP
.BI \-l "library"
Specifies a C-library for linking the application.  By default,
.BI -lpl
as well as the libraries required by the SWI-Prolog kernel will be
passed to the C-compiler.
.TP
.BI \-L "library-directory"
Specifies an additional library directory for the C-compiler.  By
default, the runtime directory for the current architecture is passed.
.TP
.BI \-g|-I*|-D*|-U*
Passed to the compiler as c-flags.  By default, the SWI-Prolog include
directory is passed as additional include directory.  The following -D
flags are added by plld: -D__SWI_PROLOG__ and -D__SWI_EMBEDDED__.
.TP
.BI \-pl-options*
Specify additional options for
.BI pl.
The first character following
.BI \-pl-options
determines the option-separator.  The remainder of the argument is
split using this separator and the parts are added to the option list
for Prolog.  See also
.BI \-cc-options " and " \-ld-options
.TP
.BI \-ld-options*
Additional options passed to the linker.  For example:
.BI \-ld-options,-Bstatic
.TP
.BI \-cc-options*
Additional options passed to both C- and C++-compiler.
.TP
.BI *.o
Passed as input files to the linker.
.TP
.BI *.c
Compiled using the C-compiler, after which the object-file is passed
to the linker.  The object file is deleted at cleanup.
.TP
.BI *.cc|*.C|*.cxx|*.cpp
Compiled using the C++-compiler, after which the object-file is passed
to the linker.  The object file is deleted at cleanup.
.TP
.BI *.pl|*.qlf
Passed as Prolog input files
.SH BUGS
Parsing the options and distributing them over the various programs is
probably incomplete. Feel free to modify it and please forward generally
useful modifications to
.BI <EMAIL>.

Some care has to be taken that the state created with
.BI qsave_program/2
is self-contained (i.e. contains no references to the Prolog libraries).
Also, as the state is created using the development environment rather
then the user's emulator, the Prolog code cannot use directives that
rely on the C-code added by the user.
.SH "SEE ALSO"
<NAME>
.I pl(1)
.I SWI-Prolog 3.2 Reference Manual,
University of Amsterdam, Dept. of Social Science and Informatics (SWI).
.SH COPYRIGHT
Copyright (C) 1991-1999, SWI, University of Amsterdam
.SH AUTHOR
<NAME>
<commit_msg>* Documented modified behaviour on behalf of the multi-threaded version<commit_after>.TH SWI 1 "May 18 1996"
.SH NAME
plld \- Create a SWI-Prolog embedded executable
.SH SYNOPSIS
.BR plld
.BI "options" " " "c-files" " " "o-files" 
.BI "pl-files"
.br
.SH DESCRIPTION
The utility
.BI plld
is a front-end for the C-compiler and linker to create a stand-alone
executable from a series of C/C++ and Prolog input files. It extracts
information from the SWI-Prolog executable
.B pl,
after which it scans the arguments and breaks them into several
categories.  It then calls the C-compiler to create an executable
containing the user's C-code and the SWI-Prolog kernel.  After this,
it will call the development environment to create a Prolog saved
state from the prolog files and finally it will create the target
executable by concatenating the state to the emulator.  See also
.BI qsave_program/2
from the
.BI SWI-Prolog " " manual.

.SS Options
.TP
.BI \-pl " prolog"
Specifies the prolog version to use.  The default is
.BI pl.
This flag may be used to choose between different versions installed
on your system, or to specify a modified version.  A modified version
should understands the flags
.BI \-dump-runtime-variables
.BI \-f " file"
.BI \-F " file"
.BI \-g " goal"
.BI \-t " toplevel".
.TP
.BI \-help
Shows options briefly
.TP
.BI \-nostate
Just relinks the kernel.  The newly linked kernel can only function
in the presence of the development system.  Any supplied prolog sourcefiles
are ignored, and so are the options
.BI \-goal
.BI \-toplevel
.BI \-initfile.
.BI \-class
This is the preferred way to attach external modules to Prolog if
dynamic loading is not supported on your system.
.TP
.BI \-goal " goal"
The goal that is initially executed when the toplevel is started using
.BR "PL_toplevel()" .
E.i. the default.
.BI \-g
flag for the new executable.
.TP
.BI \-toplevel " goal"
The goal that is executed as the main toplevel goal.  E.i. the default.
.BI \-t
flag for the new executable.
.TP
.BI \-initfile " file"
The file that is loaded by the toplevel.  E.i. the default.
.BI \-f
flag for the new executable.
.TP
.BI \-class " {runtime,kernel,development}"
Set the save-class of the Prolog saved-state that is created.  If
.B runtime
(default), the resulting system leave interpretation of all arguments
to the application.  If
.B kernel
all predicates will be locked for the tracer.  Finally, if
.B development
the state is saved `as-is' and the resulting system processes options
just as the basic SWI-Prolog executable does.  See also
.B "qsave_program/2"
in the
.IR "SWI-Prolog reference manual".
.TP
.BI \-v
Verbose operation.  This echos the commands before executing them.
Note that some commands are printed as shell commands, but actually
executed by plld itself for compatibility with the Win32 platforms.
.TP
.BI \-f
Fake operation.  Together with
.BI \-v
this prints the commands that need to be executed without actually
doing anything.
.TP
.BI \-o " file"
Specifies the name of the final executable.  The default is
.BI a.out.
.TP
.BI \-cc " C-compiler"
Specify the compiler to use for
.BI *.c
files.  Default is the compiler used to compile SWI-Prolog itself,
as read from the feature
.BI c_cc.
.TP
.BI -c++ " C++-compiler"
Specify the compiler to use for C++ input files.  If the C-compiler
is
.BI gcc
this is
.BI g++,
otherwise
.BI c++
is assumed.
.TP
.BI \-ld " linker"
Specifies the linker to use.  Default is the C-compiler.  On Win32
platforms, the default is
.BI link.exe.
.TP
.BI \-l "library"
Specifies a C-library for linking the application.  By default,
.BR \-lpl " (" \-lplmt " if " pl " supports threading)"
as well as the libraries required by the SWI-Prolog kernel will be
passed to the C-compiler.
.TP
.BI \-L "library-directory"
Specifies an additional library directory for the C-compiler.  By
default, the runtime directory for the current architecture is passed.
.TP
.BI \-g|-I*|-D*|-U*
Passed to the compiler as c-flags.  By default, the SWI-Prolog include
directory is passed as additional include directory.  The following -D
flags are added by plld: -D__SWI_PROLOG__ and -D__SWI_EMBEDDED__.
.TP
.BI \-pl-options*
Specify additional options for
.BI pl.
The first character following
.BI \-pl-options
determines the option-separator.  The remainder of the argument is
split using this separator and the parts are added to the option list
for Prolog.  See also
.BI \-cc-options " and " \-ld-options
.TP
.BI \-ld-options*
Additional options passed to the linker.  For example:
.BI \-ld-options,-Bstatic
.TP
.BI \-cc-options*
Additional options passed to both C- and C++-compiler.
.TP
.BI *.o
Passed as input files to the linker.
.TP
.BI *.c
Compiled using the C-compiler, after which the object-file is passed
to the linker.  The object file is deleted at cleanup.
.TP
.BI *.cc|*.C|*.cxx|*.cpp
Compiled using the C++-compiler, after which the object-file is passed
to the linker.  The object file is deleted at cleanup.
.TP
.BI *.pl|*.qlf
Passed as Prolog input files
.SH BUGS
Parsing the options and distributing them over the various programs is
probably incomplete. Feel free to modify it and please forward generally
useful modifications to
.BI <EMAIL>.

Some care has to be taken that the state created with
.BI qsave_program/2
is self-contained (i.e. contains no references to the Prolog libraries).
Also, as the state is created using the development environment rather
then the user's emulator, the Prolog code cannot use directives that
rely on the C-code added by the user.
.SH "SEE ALSO"
<NAME>
.I pl(1)
.I SWI-Prolog 4.0 Reference Manual,
University of Amsterdam, Dept. of Social Science and Informatics (SWI).
.SH COPYRIGHT
Copyright (C) 1991-2001, SWI, University of Amsterdam
.SH AUTHOR
<NAME>

{'fraction_non_alphanumeric': 0.08236323851203502, 'fraction_numerical': 0.00437636761487965, 'mean_word_length': 3.4948859166011017, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1003952', 'n_tokens_mistral': 3671, 'n_tokens_neox': 3440, 'n_words': 1790}