Next: , Previous: , Up: Installation   [Index]


1.3 Simple Installation

There are scripts included in the distribution to automate the process of installing, in various ways. The simplest method of installing on most operating systems (on DOS, see Installation on DOS) is to use the following routine:

  1. Configure C-INTERCAL, by running configure. Although building in the distribution directory works, it is recommended that you build elsewhere; create a directory to build in (using mkdir on most operating systems), then run configure from inside that directory (for instance, you could do this from inside the main installation directory:
    mkdir build
    cd build
    ../configure
    

    to build in a subdirectory of the distribution called “build”). You also specify where you want the files to be installed at this stage; the default of ‘/usr/local’ is good for many people, but you may want to install elsewhere (in particular, if you want to test out C-INTERCAL without installing it, create a new directory somewhere you own and specify that as the place to install it, so the install will actually just copy the files into the right structure for use instead of installing them). To specify a location, give the option --prefix=location to configure; for instance, configure --prefix=/usr would install in /usr.

  2. Compile the source code, with the command make. The Makefile will be set up for your version of make, and to automatically recompile only what needs compiling (it will even recompile the build system if you change that).
  3. Optionally, create libraries from third-party interpreters to add support for more languages to the C-INTERCAL external calls system; see Creating the Funge-98 Library. (This step can be skipped; you can also do it later, but if you do so you need to run the next step again.)
  4. Install the executables, help files, include files, and libraries, using make install. (This is the only step that needs root/administrator permissions; so on a system that uses sudo to elevate permissions, for instance, write it as sudo make install if you’re installing into a directory that you can’t write to as a non-administrative user.) This step is optional; if you do not install C-INTERCAL, you can still run it by directly referencing the exact location of the ick command.

On all systems, it’s worth just trying this to see if it works. This requires a lot of software on your computer to work, but all of it is standard on Linux and UNIX systems. The first command is a shell-script which will analyse your system and set settings accordingly; it will explain what it’s doing and what settings it detected, and create several files in the installation directory to record its results. (This is a configure script produced by the GNU autoconf (configure); its autoconf source code is available in the file configure.ac.) The second command actually compiles the source code to produce binaries; this takes the longest of any of the steps. You will see all the commands that it’s running as it runs them. The third command will copy the files it’s compiled to appropriate shared locations on your system so that anyone on the system can just use ick.

There may be various factors that prevent this simple installation method working. On a system not based on UNIX or Linux, you may find that you don’t have some of the software required to run this (for instance, you may be missing the shell sh, and don’t have the shell bash which can emulate it, and so can’t run configure that depends on one of those shells being available) and so this method won’t work for you. In such cases, one solution may be to install all the software required; the GNU project has a version of all the commands required, for instance, and there may be ports available for your operating system. However, the only software absolutely required is a C compiler (C-INTERCAL was designed to work with gcc and is tested mostly with that compiler, but in theory it should work with other C compilers too, and this is tested on occasion) and the associated software needed to compile C files to object files and executables, combine object files into libraries, etc.; but this requires trying to do the build by hand, so it’s generally easier just to install a UNIX-like shell and associated tools.

Another possibility that might stop this process working is if your version of the relevant software is incompatible with the GNU versions that were used for testing. For instance, I have come across proprietary versions of lex that need directives in the source file to say in advance how much memory the lexer-generator needs to allocate. In such cases, pay attention to the error messages you’re getting; normally they will suggest trivial modifications to the source files that will cause the compilation to work again.

Some Linux and UNIX systems (notably Debian and Ubuntu) don’t have the required files for compilation installed by default. To install them, just download and install the required packages: for Ubuntu at the time of writing, they are ‘binutils’, ‘cpp’, ‘gcc’, ‘libc6-dev’, ‘make’ to compile C-INTERCAL, and if you want to modify it, you may also need ‘autoconf’, ‘automake’, ‘bison’, and ‘flex’. For debugging help, you may also want ‘gdb’, and to recompile the documentation, you may need ‘groff’, ‘texlive’, ‘texinfo’, and ‘tidy’.

If you’re trying to do something unusual, you probably want to set some of the settings yourself rather than letting the compilation process guess everything. In this case, use configure --help to view the options that you can set on configure; there’s a wide range of settings that you can set available there, and one of them may be what you want.


Next: , Previous: , Up: Installation   [Index]