Next: , Previous: , Up: overview install   [Index]


1.5.3 Installation details

We have two choices for downloading the Vicare Scheme source: we can either download a distribution from:

https://bitbucket.org/marcomaggi/vicare-scheme/downloads

or we can checkout a revision from the GitHub repository:

http://github.com/marcomaggi/vicare/

We configure the build system by running the configure script located in the base directory. To do this, type the following commands:

$ cd vicare-n.n.n
$ ./configure
checking build system type... i386-apple-darwin8.10.1
checking host system type... i386-apple-darwin8.10.1
...
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating scheme/Makefile
config.status: creating doc/Makefile
config.status: executing depfiles commands

This configures the system to be built then installed in the system–wide location (binaries are normally installed in /usr/local/bin). To install it in another location (e.g. in your home directory), provide a --prefix location to configure as follows:

$ ./configure --prefix=/opt/sw

this will install the executable in /opt/sw/bin, libraries in /opt/sw/lib/ikarus, and documentation in /opt/sw/share/doc/ikarus.

To install Vicare Scheme for personal use (thus not requiring root permissions to install), specify --prefix=$HOME/local, which installs everything in a local directory of our home directory.

configure allows us to fine–tune where things are installed, though this is rarely necessary or useful. Do ./configure --help for a full list of options.

The most common configure options are as follows.

--prefix

Specify the location in the file system where Vicare Scheme will be installed.

--enable-ffi

Include Vicare Scheme’s Foreign Function Interface, so that Vicare code can invoke C code, and vice versa; requires Libffi.

--disable-arguments-validation

Disable arguments validation for the functions in Vicare’s boot image; use with care: an invalid argument will cause undefined behaviour (most likely a process crash).

This setting can be overridden by setting the environment variable VICARE_ARGUMENTS_VALIDATION; (vicare-libs)Enabling or disabling arguments validation for details.

CFLAGS

Specify options to be used while compiling Vicare’s C code.

CPPFLAGS

Specify options to be used while preprocessing Vicare’s C code.

LDFLAGS

Specify options to be used while linking Vicare.

configure will fail if it cannot find the location where GMP is installed. The script will also fail if we have specified --enable-ffi and it can’t find Libffi. If running configure fails to locate either of these libraries, we will need to provide their locations. Use the CPPFLAGS and LDFLAGS options to specify the locations of the header and library files.

For example, assume that we have installed GMP and Libffi in subdirectories of /opt/sw, and we wish to support foreign functions.1

./configure                                                  \
  --prefix=$HOME/local                                       \
  --enable-ffi                                               \
  CPPFLAGS="-I/opt/sw/gmp/include -I/opt/sw/libffi/include"  \
  LDFLAGS="-L/opt/sw/gmp/lib -L/opt/sw/libffi/lib"

We can use the CFLAGS and LDFLAGS variables to select more specialized compilation and linking options; refer to the compiler documentation for more details.

We can now build the system by running the command make, with no arguments; this performs two tasks:

  1. It builds the vicare executable from the C files located in the src directory.
  2. It uses the vicare executable and the pre–built ikarus.boot.orig boot file to rebuild the Scheme boot image file vicare.boot from the Scheme sources located in the scheme directory.

The final stage is to install Vicare via the command make install. If we’re installing Vicare in a system–wide location, we probably need to have administrator privileges (use the sudo or su commands); if that’s not feasible, then we need to reconfigure to install within a directory tree under our home directory.

Finally, try a small session, to verify that everything installed properly.

$ vicare
Vicare Scheme version 0.1d0+ \
  (revision master/d844c006eb9ada1a047be3893d0dd40f8ae6204a, \
  build 2010-05-02)
Copyright (c) 2006-2010 Abdulaziz Ghuloum and contributors

> (display "hello, world!\n")
hello, world!
> (define twice (lambda (f) (lambda (x) (f (f x)))))
> ((twice add1) 3)
5

If we get the first > prompt, then Vicare was successfully installed on the system. We may need to update the PATH variable in environment to contain the directory in which the vicare executable was installed.

Finally, do make clean to get rid of executables, object files, and other build products in the vicare-n.n.n directory. Do not delete the directory itself: it will be needed if we ever want to uninstall Vicare.

After installation, under the directory $libexecdir/vicare-scheme, scripts with names like compile-all.sps can be executed to precompile the installed libraries; for example:

$ sudo vicare --compile-dependencies \
   /usr/local/libexec/vicare-scheme/compile-all.sps

Footnotes

(1)

The configure command shown here is very imposing, and anyone can easily make mistakes. In general, it’s a good idea to create a shell script that has the sequence of configure and make commands needed to configure, build, and install a package; this not only allows us to re–install easily, but also gives us a concrete indication of what options we used to build the software the last time. Of course, we should put this script somewhere other than in the actual Vicare software directory!


Next: , Previous: , Up: overview install   [Index]