Installation

From Church Wiki
Jump to: navigation, search

Contents

Downloading MIT-Church

If you don't have svn, go and install svn.

Then go to the folder where you want Church to be installed and get the church release from the svn repository (all one line):

svn checkout https://svn.csail.mit.edu/mit-church/trunk mit-church

You need a username and password (see MIT-Church alpha test).

Using Ikarus Scheme

Ikarus is a very fast implementation of the Scheme R6RS specification. While you can run MIT-Church from PLT Scheme, Ikarus can be several orders of magnitude faster.

Note The current version of Church requires the latest version of Ikarus scheme (currently version 0.0.4), which can only be retrieved using the version control software (bzr) using the instructions below and NOT by downloading older pre-compiled binary versions on the Ikarus website.

Native Mac OS X

Use MacPorts to install gsl, gmp, libffi

sudo port install gsl 
sudo port install libffi
sudo port install gmp

If port does not work after installing MacPorts, make sure that the paths are set in the right file for your shell. For me this was .bash_profile but MacPorts wrote the paths to .profile.

You need the development version of ikarus. So you first need to install bzr version control to get it. Go to the directory where you want the ikarus source code

sudo port install bzr
bzr checkout --lightweight http://ikarus-scheme.org/ikarus.dev

Assuming that macports has installed everything in the same standard paths as in my installation you go into the directory that you just downloaded (i.e. ikarus.dev) and you do:

./configure --enable-libffi CFLAGS='-I/opt/local/include' CPPFLAGS='-I/opt/local/include' LDFLAGS='-L/opt/local/lib' 

You want to set the flags CFLAGS and CPPFLAGS the paths that have gmp.h and ffi.h -- if the above doesn't work search for the header files and put in the right paths. (The latest MacPorts libffi package appears to put ffi.h in /opt/local/lib/libffi-3.0.9.) You can include several paths by using quotes and several -I flags. The same for the LDFLAGS where you want to specify the locations for libgmp and libffi. (For some non-standard external packages you may need to explicitly link gsl: change the above to have LDFLAGS='-L/opt/local/lib -lgsl -lgslcblas'.) Now compiling should be easy:

make
sudo make install

and ikarus should be located in /usr/local/bin/ikarus. Now tell ikarus where to find church by adding to your .profile or .bash_profile or whatever the right file for your shell is:

export IKARUS_LIBRARY_PATH=.:/path/to/mit-church:$IKARUS_LIBRARY_PATH

now go to your mit-church folder and call

ikarus tests/church-test-suite.ss

Ubuntu 8.04.2, Native or Virtualized (from OS X using VMWare)

If you would prefer not to install MacPorts or development tools on your Mac OS X, you can virtualize a Linux installation, e.g., using VMWare's Fusion 2.0.4. Download an ISO disk image of the Ubunto 8.04.2 LTS installation and create a virtual machine (see, e.g., http://laurentbois.com/2008/04/26/install-ubuntu-804-using-vmware-fusion-on-mac-os-x/. VMWare Tools aren't necessary for the steps below.)

From a fresh installation of Ubuntu, native or virtualized, install the necessary development tools:

sudo apt-get install build-essential autoconf m4 automake perl
sudo apt-get install libgsl0-dev libffi4-dev libgmp3-dev
sudo apt-get install subversion

Download MIT-Church

cd ~
svn checkout https://svn.csail.mit.edu/mit-church/trunk mit-church/

Then download Ikarus:

sudo apt-get install bzr
bzr checkout --lightweight http://www.cs.indiana.edu/~aghuloum/ikarus.dev

and compile it:

cd ikarus.dev/
./configure --enable-libffi
make
sudo make install

You will want to update the library path to point to the church installation in your bash scripts:

echo export IKARUS_LIBRARY_PATH=~/mit-church:$IKARUS_LIBRARY_PATH >> ~/.bashrc

You should then test the install

cd ~/mit-church
ikarus tests/church-test-suite.ss

Fedora

Fedora uses "yum" as its application manager. You will need to have root access to issue the following commands (possibly by using sudo).

yum install gsl gmp libffi

You may need to install the developer versions too.

yum install gsl-devel gmp-devel libffi-devel

In order to get the latest version of Ikarus you will need to get the Bazaar CVS system.

yum install bzr

In order to download Ikarus, use the standard commands

cd /usr/local
bzr checkout --lightweight http://ikarus-scheme.org/ikarus.dev
cd ikarus.dev
./configure --enable-libffi CFLAGS=-I/usr/lib/libffi-3.0.5/include
make
make install

Note that the CFLAGS command is pointing to the directory where ffi.h resides. Make sure to set this directory to the appropriate location.

As a user account, you can then access the MIT-Church repository:

svn checkout --username anonymous --password anonymous https://svn.csail.mit.edu/mit-church/trunk mit-church

This last command will download MIT-Church and place it in the subdirectory mit-church (this last argument can be changed as necessary). The "trunk" is the latest version of the system.

Finally you will need to set up your library path for Ikarus so that it finds MIT-Church.

echo export IKARUS_LIBRARY_PATH=~/mit-church:$IKARUS_LIBRARY_PATH >> ~/.bashrc

You will need to restart your shell to see the effects of the previous line (or you can issue the export command directly). Finally, you can verify that everything has worked by running:

ikarus mit-church/tests/church-test-suite.ss

Enjoy.

Microsoft Windows using Cygwin

These instructions assume you have the following installed from within your Cygwin environment: make, bison, gcc3 . 'libffi' was the only necessary library that could not be successfully installed using Cygwin's package download system. 'libgmp' sometimes causes problems using Cygwin's package install.

0) Using Cygwin setup (view "full" list) install: bzr, gsl, libgmp . (if you have problems with 'libgmp', download the tar from http://gmplib.org/#DOWNLOAD and manually install. Untar it, navigate to the new directory, and, as root:)

make install
make check

Skip this step if you have already installed them.

1) Install 'libffi': download from http://sourceware.org/libffi/ Untar it, navigate to the new directory:

./configure
make install


2) Get the development snapshot of Ikarus:

bzr checkout --lightweight http://www.cs.indiana.edu/~aghuloum/ikarus.dev

Untar it, navigate to the new directory, and, as root:

./configure --enable-libffi CFLAGS=-I/path/to/libffi-3.0.8/include    (make the path to 'libffi' absolute)
make
make install

You may receive error messages regarding "multiple target patterns" when reading some ffi.po file. In this case, you can manually edit the ffi.po file so that it points at your libffi library - mine somehow got pointed elsewhere which caused the errors. And remember, Cygwin imposes a modified file structure, so C:\... may have to be replaced by /cygdrive/c/...


3) Get the church release from the svn repository (all one line):

svn checkout --username anonymous --password anonymous https://svn.csail.mit.edu/mit-church/tags/0.1.1 mit-church

NOTE: you must use 'svn' from within cygwin so that the symbolic links are acquired properly. TortoiseSVN is known to fail at properly retrieving them.


4) Point ikarus to mit-church using a global variable:

export IKARUS_LIBRARY_PATH=/path/to/mit-church:$IKARUS_LIBRARY_PATH


5) Make sure that it works:

ikarus --r6rs-script tests/church-test-suite.ss

The README contains info about custom Church script paths among other issues!

Using PLT Scheme

MIT Athena (MIT-only)

I added the following lines to my ~/.cshrc.mine file:

add drscheme
add gnusl 
setenv PLTCOLLECTS /afs/athena.mit.edu/user/f/j/fjaekel/mit-church:/afs/athena.mit.edu/user/f/j/fjaekel/.plt-scheme/4.1/collects:/mit/drscheme_v41/lib/plt/collects

In addition you have to modify mit-church/church/external/gsl-paths.ss to include /mit/gnusl/lib in the paths that are searched for the gnu scientific libraries:

/mit/gnusl/lib/libgslcblas.so.0
/mit/gnusl/lib/libgslcblas.so
/mit/gnusl/lib/libgsl.so.0
/mit/gnusl/lib/libgsl.so 

at the appropriate places.


Notes

If your installation of GSL is in a non-standard location, edit "church/external/gsl-paths.ss" to point to your installation.

If you want to run Church from an arbitrary location (i.e. not the base directory), then the path to your church directory must be in the library search path of your scheme implementation. (Church can then find libraries in the include directory.)

Personal tools