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 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 # (optional) for 32 bits compatibility mode (x86) $ apt-get install gcc-multilib libc6-i386 libc6-dev-i386 g++-multilib # (optional) for emacs-based IDE $ apt-get install emacs # (optional) for line edition from the terminal $ apt-get install rlwrap # (optional) 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 # (optional) for emacs-based IDE $ dnf install emacs # (optional) for 32 bits compatibility mode (x86) $ dnf install glibc-devel.i686 glibc-devel libstdc++-devel.i686 # (optional) for line edition from the terminal $ dnf install rlwrap # (optional) 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 # (optional) for 32 bits compatibility mode (x86) # NOTE: Remember to enable multilib (https://wiki.archlinux.org/index.php/Multilib) $ pacman -S lib32-glibc lib32-libstdc++5 # (optional) for emacs-based IDE $ pacman -S emacs # (optional) for line edition from the terminal $ pacman -S rlwrap # (optional) for generating documentation in PDF format $ pacman -S texlive-core texinfo imagemagick
$ brew install emacs-mac imagemagick
# (optional) for line edition from the terminal $ brew install rlwrap
$ pkg install gmake # (optional) for emacs-based IDE $ pkg install emacs ImageMagick expat # NOTE: use emacs-nox and ImageMagick-nox if X11 support is not needed # (optional) for line edition from the terminal $ pkg install rlwrap # (optional) for generating documentation in PDF format $ pkg install texinfo texlive-full
$ pkgin install gmake # (optional) for emacs-based IDE $ pkgin install emacs ImageMagick expat # (optional) for line edition from the terminal $ pkgin install rlwrap # (optional) for generating documentation in PDF format $ pkgin install tex-texinfo texlive-collection-latex
$ pkg install clang make # (optional) for emacs-based IDE $ pkg install emacs # (optional) for line edition from the terminal $ pkg install rlwrap
Additional dependencies:
Some advanced libraries and components 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 installer 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:
# Interactive installation curl https://ciao-lang.org/boot -sSfL | sh # Minimal local installation with prebuilt binaries curl https://ciao-lang.org/boot -sSfL | sh -s -- --prebuilt-bin local-install # Full environment curl https://ciao-lang.org/boot -sSfL | sh -s -- get devenv # Show network installer help curl https://ciao-lang.org/boot -sSfL | sh -s -- --help
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.
./ciao-boot.sh configure
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.