The current version of PAKCS runs on Unix-based platforms and has been developed and tested under Linux (Debian/Ubuntu). However, it should also run on similar platforms like macOS. If you want to install and run the complete system on your computer, you need the following software:
- SICStus-Prolog (Version 4.0 or higher) (recommended), or
- SWI-Prolog (if you do not have SICStus-Prolog, but then the execution is less efficient)
If you install PAKCS from the source code distribution,
you need also the Haskell build tool
Stack
(version 2.x or higher) to compile the front end of PAKCS,
i.e., the executable stack must be in your path.
PAKCS assumes that non-ASCII characters in source files are UTF-8 encoded.
Therefore, the locale environment variable LC_ALL must be
set to some UTF-8 encoding which will be used by the interactive
environment, the compiler, and in generated executables.
For instance, this can be achieved by setting
> export LC_ALL=C.UTF-8
before installing PAKCS.
-
Go into the main directory of PAKCS (which contains this file). In the following, we assume that
pakcshomeis the name of this directory. -
If you have the executables
sicstus(for SICStus-Prolog) orswipl(for SWI-Prolog) in your path, executemaketo install PAKCS. -
Otherwise, values defining one of these executables can be passed as environment variables
SICSTUSPROLOGorSWIPROLOGtomake, e.g., bymake SICSTUSPROLOG=/opt/sicstus/bin/sicstusor
make SWIPROLOG=/usr/bin/swiplIf both variables are undefined and the executables
sicstusorswiplcannot be found, the PAKCS compiler system cannot be installed. -
If you install PAKCS from the source code distribution, you need also the Haskell Tool Stack (version 2.x or higher) to compile the front end of PAKCS, i.e., the executable
stackmust be in your path. -
After the installation, add the directory
pakcshome/binto your path, e.g., by the commandexport PATH=pakcshome/bin:$PATHin the
bash.If you do no want to have the specific version number of PAKCS included in your path, you can set a symbolic link like
ln -s pakcs-<version> pakcsand put the directory
pakcs/bininto your path. Now you can start the PAKCS compiler system via the commandpakcs. -
You can configure the behavior of PAKCS by various settings in a
pakcsrcfile. For doing so, copy the filepakcshome/pakcsrc.defaultas.pakcsrc(which will be automatically done when you start PAKCS for the first time) into you home directory and modify the settings in this file. -
If you like to have support for line editing or history functionality in the PAKCS interactive environment (as supported by the readline library), you should have the Unix/Linux command
rlwrapinstalled on your local machine. PAKCS usesrlwrapif it is invoked on a terminal without the parameter--noreadline.
If you want to install the system at a location different from
the build location, you have to specify the intended installation
location at built-time with the parameter PAKCSINSTALLDIR.
Furthermore, the final installation location must not exist
during built time. For instance, to built PAKCS at some local directory
and move it later to /opt/pakcs, you can do it by
make PAKCSINSTALLDIR=/opt/pakcs
...
mv /path/to/pakcs /opt/pakcs
The distribution of PAKCS is configured with a maximal tuple arity of 15, i.e., Curry programs containing larger tuple sizes cannot be compiled. If you want to increase this size (usually, it is preferable to change your program), you have to change (in a source distribution of PAKCS) two system files and install your system as follows:
- Change the definition of the constant
maxTupleArityin the filespakcshome/frontend/src/Generators/GenAnnotatedFlatCurry.hsandpakcshome/src/compiler.placcording to your required maximal arity. - Delete all auxiliary files in the directory
pakcshome/lib/.curry. - Re-install PAKCS by
make.
If you install PAKCS from the binary Linux distribution,
the pre-compiled executable of the front-end might not find
the library libgmp.so.3. This problem can be fixed
by the following commands (executed as root):
cd /usr/lib
ln -s libgmp.so.3.4.1 libgmp.so.3
If you use SWI-Prolog, you should install the packages
swi-prolog as well as swi-prolog-clib
from the Ubuntu distribution.
The latter package is necessary if sockets, ports, and
other system-oriented features should be used in Curry.
(Thanks to Sergio Antoy and Steffen Mazanek for these hints.)
Contact: Michael Hanus