This describes the installation procedure for the Ciao system, including libraries and manuals, from a source distribution. For more specific details, please read also the INSTALLATION file that comes with each component of Ciao. However, in most cases following this summary suffices.
A minimal build requires:
Although Ciao implements its own build system, the GNU implementation of the make Unix command is (still) used internally. If any of the installation steps stop right away with make error messages, you probably need to install gmake.
Installing Emacs is highly recommended: the Ciao distribution includes a very powerful application development environment which is based on emacs and which enables, e.g., syntax coloring, source code formatting, embedded top-level, source-level debugging, context-sensitive on-line help, 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.
Finally, documentation generation in PDF format requires TeX and ImageMagick.
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):
$ apt-get install build-essential # Required for 32 bits compatibility mode (x86) $ apt-get install gcc-multilib libc6-i386 libc6-dev-i386 g++-multilib # Required for emacs-based IDE $ apt-get install emacs # Optionally, for rlwrap $ apt-get install rlwrap # Required for generating documentation in .pdf format $ apt-get install texlive texinfo imagemagick(valid for both x86 and arm architectures)
$ dnf install gcc make which kernel-headers kernel-devel emacs # Required for emacs-based IDE $ dnf install emacs # Required for 32 bits compatibility mode (x86) $ dnf install glibc-devel.i686 glibc-devel libstdc++-devel.i686 # Optionally, for rlwrap $ dnf install rlwrap # Required for generating documentation in .pdf format $ dnf install texlive texinfo texinfo-tex ImageMagick(use yum instead of dnf above in older versions of Fedora)
# Optional, upgrade if needed $ pacman -Syu # Dependencies for build and development environment # (base-devel: includes gcc, make, which) $ pacman -S base-devel linux-headers # Required for 32 bits compatibility mode # NOTE: Remember to enable multilib (https://wiki.archlinux.org/index.php/Multilib) $ pacman -S lib32-glibc lib32-libstdc++5 # Required for emacs-based IDE $ pacman -S emacs # Optionally, for rlwrap $ pacman -S rlwrap # Required for generating documentation in .pdf format $ pacman -S texlive-core texinfo imagemagick
$ brew install emacs-mac imagemagick
$ brew install rlwrap
$ pkg install gmake # Required for emacs-based IDE # (without X11) $ pkg install emacs-nox ImageMagick-nox expat # (with X11) $ pkg install emacs ImageMagick expat # Optionally, for rlwrap $ pkg install rlwrap # Required for generating documentation in .pdf format $ pkg install texinfo texlive-full
$ pkgin install gmake # Required for emacs-based IDE $ pkgin install emacs ImageMagick expat # Optionally, for rlwrap $ pkgin install rlwrap # Required for generating documentation in .pdf format $ pkgin install tex-texinfo texlive-collection-latex
Official relases for the latest emacs versions can be downloaded from https://www.gnu.org/software/emacs/#Obtaining (See the gnu/emacs and gnu/windows/emacs directories in FTP mirrors). You can find answers to frequently asked questions (FAQ) about emacs in general at http://www.gnu.org/software/emacs/manual/efaq.html and about the Windows version at http://www.gnu.org/software/emacs/manual/efaq-w32.html.
Some advanced libraries and components, like the cost analysis, require an additional set of software packages:
# Debian/Ubuntu: $ apt-get install g++ libgsl0-dev libgsl0ldbl $ apt-get install default-jdk ant ant-optional # Fedora: $ yum install gsl gsl-devel ant gcc-c++
To install the Java JDK on Fedora, please visit Sun Java website (http://java.sun.com/javase/downloads/index.jsp) and follow the installation instructions there.
Ciao can be installed from the network using a curl pipe from https://ciao-lang.org/boot to sh in a terminal. This is probably the fastest/easiest way to install Ciao from sources.
The network installater (for Unix) is delivered as an HTTPs redirection to https://raw.githubusercontent.com/ciao-lang/ciao/master/ciao-boot.sh (which contains the latest version of the ciao-boot.sh script). The bootstrap script recognizes that it is being called without sources automatically. Examples:
curl https://ciao-lang.org/boot -sSfL | sh curl https://ciao-lang.org/boot -sSfL | sh -s -- --prebuilt local-install curl https://ciao-lang.org/boot -sSfL | sh -s -- --no-prebuilt get devenv
The source code for the latest stable and development versions of Ciao is available from https://ciao-lang.org.
Installation of Ciao from source is driven by the ciao-boot.sh script (ciao-boot.bat in Windows), which bootstraps and invokes the Ciao build system.
Note: It is recommended that you read the full installation instructions. However, in most cases following this summary suffices:
Options can be configured interactively using ./ciao-boot.sh configure --interactive or passed explicitly as arguments from the command-line (see ./ciao-boot.sh help for more information). In particular, make sure the location of the emacs executable is set correctly.
Alternatively, ciao-boot.sh provides shorthands to perform configure, build, and install in a single command:
The system will include appropriate code at the end of your startup scripts. This will make the documentation and executables accessible, make sure the correct mode is set when opening Ciao source files in emacs, etc.
If you need more advanced control of the configuration please read the following sections.
It will perform a default configuration, where the system will be configured to run from the sources directly, and configured in the user's home directory (recommended for Ciao developers or users without admin rights).
The option --instype=global will prepare Ciao to be installed as the system administrator (root) in a standard directory available for all users in the machine (e.g., /usr/local).
For 32-bit builds in 64-bit architectures use the --core:m32=yes configuration flag.
In case you want to install elsewhere, or change any of the installation options, you can use a customized configuration procedure (see ./ciao-boot.sh help for more information). The meaning of some important options is as follows:
The installation process generates a ciao-env command to update the environments for sh-like and cshlike shells. It also generates a INSTALL_CIAOROOT/ciao-mode-init (for emacs) with appropriate definitions which will take care of all needed environment variable definitions and emacs mode setup.
if ( -x <prefix>/bin/ciao-env ) then eval `<prefix>/bin/ciao-env --csh` endif
if [ -x <prefix>/bin/ciao-env ]; then eval "$(<prefix>/bin/ciao-env --sh)" fi
This will set up things so that the Ciao executables are found and you can access the Ciao system manuals using the info command. Note that, depending on your shell, you may have to log out and back in for the changes to take effect.
(load-file "INSTALL_CIAOROOT/ciao-site-file.el") (if (file-exists-p "INSTALL_CIAOROOT/ciao-site-file.el") (load-file "INSTALL_CIAOROOT/ciao-site-file.el") )
If you are installing Ciao globally in a multi-user machine, make sure that you instruct all users that to do the same. If you are the system administrator, the previous steps can be done once and for all, and globally for all users by including the lines above in the central startup scripts (e.g., in Linux /etc/bashrc, /etc/csh.login, /etc/csh.cshrc, /etc/skel, /usr/share/emacs/.../lisp/site-init.pl, etc.).
If you have any problems you may want to check Troubleshooting.
The system can be uninstalled by typing ./ciao-boot.sh uninstall in the top directory. To ensure that this process works, configuration should have not changed since installation, so that the same directories are cleaned.
If everything has gone well, several applications and tools should be available to a normal user. Try the following while logged in as a normal user (important in order to check that permissions are set up correctly):
Also, the following documentation-related actions should work:
Finally, if emacs is installed, after starting it (typing emacs) the following should work:
Note: when using emacs it is very convenient to swap the locations of the (normally not very useful) Caps Lock key and the (very useful in emacs) Ctrl key on the keyboard. How to do this is explained in the emacs frequently asked questions FAQs (see the emacs download instructions for their location).
After (global) installation, the source directory can be cleaned up using ./ciao-boot.sh realclean, leaves the distribution is its original form, throwing away any intermediate files (as well as any unneeded files left behind by the Ciao developers), while still allowing recompilation.
The executables generated by the Ciao compiler (including the ciao development tools themselves) locate automatically where the Ciao engine and libraries have been installed, since those paths are stored as defaults in the engine and compiler at installation time. Thus, there is no need for setting any environment variables in order to run Ciao executables (on a single architecture -- see Multiarchitecture installation for running on multiple architectures).
However, the default paths can be overridden by using the environment variable CIAOROOT, which tell the Ciao executables where to look for engines and system libraries.
In order to perform a multi-architecture installation, it is possible to repeat successively the build and installation process for several architectures from different machines sharing part of their filesystem.
The Ciao build and installation process maintains separate name spaces for platform- and architecture-dependant binaries (like the engine binary, or .so or .dll gluecode files for the foreign interface). Portable Ciao applications (i.e., except self-contained standalone executables) can run on several machines with different architectures without any need for recompiling, provided the Ciao engine and libraries are correctly installed.
There are two possibilities in order to install Ciao on Windows machines:
In order to compile Ciao for Win32 environments you need to have the (public domain) Cygnus Win32 and development libraries installed in your system. Compilation should be performed preferably under Windows NT-type systems.
A further note regarding the executables generated by the Ciao compiler and top-level: the same considerations given in Installing Ciao from a Win32 binary distribution apply regarding .bat files, etc. However, in a system in which Cygnus Win32 is installed these executables can also be used in a very simple way. In fact, the executables can be run as in Unix by simply typing their name at the bash shell command line without any associated .bat files. This only requires that the bash shell which comes with Cygnus Win32 be installed and accessible: simply, make sure that /bin/sh.exe exists.