Install

This describes the installation procedure for the Ciao Prolog system, including libraries and manuals:

  1. Check / install the requirements and dependencies.
  2. Begin the interactive network-based installation typing the following one-liner in an sh-compatible terminal:
    curl https://ciao-lang.org/boot -sSfL | sh
This installs Ciao by default in ~/.ciaoroot/<ciao_version>.

Please report as issues any problems found during the installation process.

You can explore additional components at the bundle catalog (including links to documentation and source code repositories) and install them with the ciao get BUNDLENAME command (see also bundle management).

For customized installations or developer builds, please consult the manual installation from source instructions.

Requirements and dependencies

Ciao supports many operating systems, including:

  • Linux distributions
  • macOS
  • Windows (with WSL)
  • Android (with Termux).
Installing Emacs or Ciao support for VSCode is highly recommended: the Ciao distribution includes a very powerful application development environment which enables, e.g., syntax coloring, source code formatting, embedded top-level, source-level debugging, context-sensitive on-line help, generating documentation, etc., etc.

In any case, it is easy to use Ciao from a terminal and edit code with any editor of your choice. The top level includes some minimal editing facilities when rlwrap is available.

Installing dependencies for your operating system

Depending on the operating system and package management tool, you may need to install the following dependencies (using sudo or as administrator or root user):

  • Debian/Ubuntu:
    $ apt-get install build-essential
    $ apt-get install emacs # optional
    $ apt-get install rlwrap # optional
    $ apt-get install texlive texinfo imagemagick # optional
  • Debian/Ubuntu (additional for x86, 32-bits):
    $ apt-get install gcc-multilib libc6-i386 libc6-dev-i386 g++-multilib
  • Fedora:
    $ dnf install gcc make which kernel-headers kernel-devel
    $ dnf install emacs # optional
    $ dnf install rlwrap # optional
    $ dnf install texlive texinfo texinfo-tex ImageMagick # optional
  • Fedora (additional for x86, 32-bits):
    $ dnf install glibc-devel.i686 glibc-devel libstdc++-devel.i686
  • Arch Linux:
    $ pacman -Syu # optional, upgrade if needed
    $ pacman -S base-devel linux-headers
    $ pacman -S emacs # optional
    $ pacman -S rlwrap # optional
    $ pacman -S texlive-core texinfo imagemagick # optional
  • Arch Linux (additional for x86, 32-bits):
    $ pacman -S lib32-glibc lib32-libstdc++5
    Remember to enable multilib (https://wiki.archlinux.org/index.php/Multilib).
  • macOS:
    • Install command line tools for Xcode (from the App store)
    • Install emacs and ImageMagick (and texinfo if needed, but recent versions of macOS include it). A software management tool like homebrew or macports is recommended, e.g. (as root/sudo):
      $ brew install emacs-mac imagemagick
    • Install TexLive. If using homebrew we recommend installing the MacTeX distribution, available from: https://www.tug.org/mactex.
    • Install the following packages:
      $ brew install rlwrap # optional
  • FreeBSD:
    • Install GCC or clang and the following packages:
      $ pkg install gmake
      $ pkg install emacs ImageMagick expat # optional
      $ pkg install rlwrap # optional
      $ pkg install texinfo texlive-full # optional
  • NetBSD:
    • Install GCC or clang and the following packages:
      $ pkgin install gmake
      $ pkgin install emacs ImageMagick expat # optional
      $ pkgin install rlwrap # optional
      $ pkgin install tex-texinfo texlive-collection-latex # optional
  • Windows (using Windows Subsystem or Linux):
    • Install WSL
    • Install some Linux distribution (e.g., Ubuntu) from the Windows Store.
    • Open a wsl terminal and install the dependencies for the selected distribution (see points above), e.g., Debian/Ubuntu.
  • Windows (native, experimental)
    • Install MSYS2 and the following packages:
      pacman --noconfirm -S mingw-w64-x86_64-gcc
  • Android (using the Termux Linux environment):
    • Install Termux
    • Install the following packages:
      $ pkg install clang make
      $ pkg install emacs # optional
      $ pkg install rlwrap # optional
The dependencies above typically include a relatively modern C compiler (GCC or clang), libraries, and build tools. The optional dependencies are:

  • emacs: required for emacs-based IDE (use emacs-nox if no graphical interface is needed)
  • ImageMagick: used image conversion in lpdoc (use ImageMagick-nox if no graphical interface is needed)
  • TeX: typesetting system used as backed to generate documentation in info and PDF formats.
  • rlwrap: readline wrapper utility that provides line edition from terminals.

Upgrading or uninstalling components

Bundles installed via ciao get must be uninstalled and removed explicitly. Currently, this needs to be done manually per bundle. Upgrading a bundle requires uninstallation followed by (re)installation.

E.g., uninstalling the development environment (if installed) requires:

ciao uninstall ciao_emacs; ciao rm ciao_emacs; ciao rm devenv

Upgrading or uninstalling Ciao

For full cleanup, first remove all installed bundles (see above).

Once all bundles have been removed, the core Ciao system can be uninstalled running ./ciao-boot.sh uninstall from the source directory; then, remove the directory.

If installed using curl, the system is installed in a per-version subdirectory under ~/.ciaoroot, i.e., ~/.ciaoroot/<ciao_version>. The development version is installed at ~/.ciaoroot/master. Proper uninstallation requires first executing ./ciao-boot.sh uninstall inside that directory and then removing the whole ~/.ciaoroot/<ciao_version> directory.

This can be automated with a script such as (e.g., for master):

( cd ~/.ciaoroot/master; ./ciao-boot.sh uninstall )
rm -rf ~/.ciaoroot/master
rmdir ~/.ciaoroot > /dev/null 2>&1 || true