\section{Technical Problems}

\subsection{SWI-Prolog}

Using PAKCS with SWI-Prolog as its back end is slower than
SICStus-Prolog and might cause some memory problems,
since SWI-Prolog has stronger restrictions on the memory limits
for the different stack areas when executing Prolog programs.
For instance, if the compiled Curry program terminates
with an error message like
\begin{curry}
ERROR: local
\end{curry}
the Prolog system runs out of the local stack (although there
might be enough memory available on the host machine).

In such a case, one can modify the script
\ccode{\cyshome/scripts/makesavedstate}
in order to change the SWI-Prolog default settings
for memory limits of generated Curry applications.\footnote{%
Note that this script is generated
during the installation of \CYS. Hence, it might be necessary
to redo the changes after a new installation of \CYS.}
This can be done by changing the definition of the variable
\code{SWILIMITS} at the beginning of this script.
For instance, in order to set the maximum limit for
the local stack to 2 GB (on 64bit machines, the default of SWI-Prolog
is 1 GB), one change the definition in this script to
\begin{curry}
SWILIMITS="-L2G -G0 -T0"
\end{curry}
and recompile (with the \CYS command \ccode{:save})
the Curry application.


\subsection{Distributed Programming and Sockets}

Due to the fact that Curry is intended to implement
distributed systems (see Appendix~\ref{sec-ports}),
it might be possible that some technical problems
arise due to the use of sockets for implementing these
features. Therefore, this section gives some information
about the technical requirements of \CYS and how to solve
problems due to these requirements.

There is one fixed port that is used by the implementation of \CYS:
\begin{description}
\item[Port 8769:] This port is used by the
{\bf Curry Port Name Server} (CPNS) to implement symbolic names for
named sockets in Curry.
If some other process uses this port on the machine,
the distribution facilities defined in the module \code{Ports}
(see Appendix~\ref{sec-ports}) cannot be used.
\end{description}
If these features do not work, you can try to find out
whether this port is in use by the shell command
\ccode{netstat -a | grep 8769} (or similar).

The CPNS is implemented as a demon listening on its port 8767
in order to serve requests about registering a new symbolic
name for a Curry port or asking the physical port number
of a Curry port. The demon will be automatically started for
the first time on a machine when a user compiles a program
using Curry ports.
It can also be manually started and terminated by the
command \code{curry-cpnsd} (which is available by installing
the package \code{cpns}, e.g., by the command \ccode{cypm install cpnsd})
If the demon is already running,
the command \ccode{curry-cpnsd start}
does nothing (so it can be always executed
before invoking a Curry program using ports).

\subsection{Contact for Help}

If you detect any further technical problem,
please write to
\begin{center}
\code{pakcs@curry-language.org}
\end{center}

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "manual"
%%% End: 
