			   Macaulay 2
	    by Daniel R. Grayson <dan@math.uiuc.edu>
	 and Michael E. Stillman <mike@math.cornell.edu>

	available from http://www.math.uiuc.edu/Macaulay2/

We thank the United States National Science Foundation for generous funding
to develop Macaulay 2.

Macaulay 2 is copyright 1993-2001 by Daniel R. Grayson and Michael
E. Stillman.  We permit you to use it under the terms of the GNU General
Public License, version 2, as published by the Free Software Foundation; see
the file Macaulay2/COPYING.  This is free software.  There is no warranty;
not even for merchantability or fitness for a particular purpose.

---------
Libraries
---------

Here are the libraries you have to download and install on your system before
you can compile and link Macaulay 2.  We always compile with gcc.  It's a
good idea to compile them in the order listed here, as some of the later ones
depend on some of the earlier ones.

    library: gc
    release: 6.0 (see file gc/version.h)
     author: Hans Boehm <hboehm@exch.hpl.hp.com>
     get at: http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc6.0.tar.gz
    license: gc/README
    install: -- edit Makefile
		    set CC=gcc
		    value of CFLAGS : remove -DALL_INTERIOR_POINTERS
				      add -DLARGE_CONFIG -DNO_DEBUGGING
	     -- make
	     -- cp gc.a /usr/lib/libgc.a
	     -- cp include/gc.h and include/gc_cpp.h /usr/include

    library: gdbm
    release: gdbm-1.8.0
     author: phil@cs.wwu.edu
    bugs to: downsj@downsj.com
     get at: ftp://ftp.gnu.org/pub/gnu/gdbm/
    license: GNU GENERAL PUBLIC LICENSE
      notes: Makefile.in has "prefix = /usr/local", so when installing, you must
		use "make prefix=/whatever" to install in a nonstandard place.
	        Also, if you aren't root, it will try to change the ownership of
		the installed files, so change BINOWN and BINGRP to suit you.

    library: gmp
    release: gmp-4.0
     author: Torbjorn Granlund <tege@nada.kth.se>
    bugs to: <bug-gmp@prep.ai.mit.edu>
     get at: ftp://ftp.gnu.org/gnu/gmp
    license: gmp/COPYING.LIB
      notes: on Solaris, gmp will use both cc and gcc; don't worry

    library: Singular-factory (libcf libcfmem)
    release: factory-1.3b, tar file date 2001/06/25
     author: G-M. Greuel <greuel@mathematik.uni-kl.de>
	     R. Stobbe <stobbe@mathematik.uni-kl.de>
	     J. Schmidt
	     G. Pfister <pfister@mathematik.uni-kl.de>
	     H. Schoenemann <hannes@mathematik.uni-kl.de>
     get at: ftp://www.mathematik.uni-kl.de/pub/Math/Singular/Factory/
	     or
	     http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/src/
    license: GPL
      notes: ./configure --disable-streamio
	     make
	     make install
		-- don't bother with 'make gftables'

    library: Singular-libfac
    release: libfac-0.3.2, tar file date 2001/06/28
	     (that version number is in 00README; in configure.in it says 0.3.0)
     author: Michael Messollen <mmessollen@web.de>
     get at: ftp://www.mathematik.uni-kl.de/pub/Math/Singular/Libfac
	     or
	     http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/src/
    license: GPL
      notes: Sometimes the configure script doesn't work.  For example, if
		factory.h has been installed under $prefix/include, it won't find it.
		And it can erroneously decide that 'const' and 'inline' keywords don't
		work, and add -Dconst= -Dinline= to DEFS.  This results in a stream of
		error messages about duplicate declarations.
	     Also, ignore the warning message about factory.h being missing, if you think you've put
		it in $prefix/include.
	     Also, make sure you patch the source with the diffs in INSTALL.libfac-0.3.2-diffs,
		or else it gets confused about the NOSTREAMIO option.  Do it this way:
			cd libfac
			patch -p1 < ...../INSTALL.libfac-0.3.2-diffs
			make DEFS=-DHAVE_SINGULAR_ERROR
			make prefix=/usr/local/... install

-----------------------
Compiling
-----------------------

Quick and easy:

	./configure
	make
	make check
	make install

To compile in another directory, for example, in a subdirectory:

	mkdir COMPILE
	cd COMPILE
	../configure
	make
	make check
	make install

To make a distribution tarball:

	../configure --enable-encap --with-encapdir=/tmp
	make
	make check
	make install
	make distribution

-----------------------
Windows 95, 98 and NT notes
-----------------------

There are two ways to compile Macaulay 2 under Windows 95 and NT.

	-------------------------------
	Microsoft Visual C/C++ compiler
	-------------------------------

	We use Microsoft Visual C/C++ compiler version 5.0 with service pack
	2.  First install the "gnuish" utilities in C:\WINNT\SYSTEM32:
	awk.exe, cp.exe, gawk.exe, grep.exe, ls.exe, make.exe, mv.exe,
	pwd.exe, rm.exe, sed.exe, and uname.exe.  Then open up the workspace,
	M2.dsw, set it to build the Release version, and start it compiling.

	To set the PATH environment variable used by the Developer Studio
	for custom build steps, edit the registry entry:
		My Computer\HKEY_CURRENT_USER\Software\Microsoft\DevStudio
			\5.0\Build System\Components\Platforms\Win32 (x86)
			\Directories\Path Dirs

	----------------------
	The Cygnus port of GCC
	----------------------

	Download cdk.exe from http://www.cygnus.com/misc/gnu-win32/ and
	type make.  It should all work!  (oops, does this require
	distribution of a .dll file, too?)

	You will also want to pick up emacs for Windows from
	http://www.cs.washington.edu/homes/voelker/ntemacs.html .

	Configure with the option
		--without-dumpdata

	Problems:
	   general:
		environment variables are all upper case!
		read() isn't interruptable
	   make:
		'export' does not work in makefiles.
		some targets in makefiles get run in parallel (?)
	   c library:
		abort() seems to be equivalent to exit(0)
	   bash:
		'cd ..' doesn't work from the initial directory
		when bash is started by emacs
	   ps:
		reports WIN32-PID in octal instead of decimal
	   kill:
		doesn't ever kill any processes

----------------------
Linux notes
----------------------


----------------------
MacOS X notes
----------------------
This port was done with the help of Dave Morrison, Dennis Keeler and John Dalbec.
The source is most conveniently compiled using the fink system at
http://fink.sourceforge.net.  Soon there will be a macaulay2 fink package: this
will automatically download, unpack, configure, compile and install all of the above
libraries and macaulay2 itself.  The resulting compiled version can be used without
fink, suitably modified.

There are (1/10/02) several small issues still to be smoothed over, but M2 compiles
fine on my titanium G4, running mac os 10.1, dev tools 10.1, and all of the tests
pass.

Issues remaining:
  the fink ".info" file needs to be improved
  gc: redefines _read, so that the linker complains about multiply defined symbols.
      For now, I ignore the message, and it seems to work.  Boehm said that this 
      wrapper is gone in the latest version, so I am not going to worry about this.
  post install:
      the M2, M2-help, and emacs/M2-init.el files need to be patched

Each user needs to do the following after installation:
  add to .emacs file
    (load "/sw/lib/Macaulay2-0.9.2/emacs/M2-init.el")

These are done by the fink macaulay2 package, but if you compile on your own,
you may need to do the following:

        ar x /sw/lib/libfac.a tmpl_inst.o
        mv tmpl_inst.o libfac_tmpl_inst.o

Dumpdata doesn't work, I haven't tried removing --disable-strip yet.
Here is the configure line I have used that works:

./configure --disable-strip --disable-dumpdata -prefix=/sw

----------------------
HPUX notes
----------------------

On hppa-2.0w systems, gmp will not compile with gcc, so the configure script
for gmp prefers to use /usr/ccs/bin/cc.  So it is best to install gmp
separately, making sure /usr/ccs/bin is before /usr/local/bin on the path
(just in case gnu nm is in /usr/local/bin).  To use the previously installed
version of gmp when compiling M2, specify the option --with-gmp to configure,
or in configure.options.

Why don't we simply unset CC when automatically configuring gmp?  Because
under other operating systems, it is desirable for the same compiler to be
used for the whole package.  For example, under Windows, gcc and cl aren't
library compatible.

Another strange problem: the . command in /bin/sh seems to look along the
path instead in the current directory to find the file.  This causes a
problem for 'configure'.  Just edit its first line to use 'bash' instead.

----------------------
Solaris notes
----------------------

Configure with the option
	--without-dumpdata

----------------------
FreeBSD notes
----------------------

The gmp package didn't compile, but luckily I was able to use
the installed libgmp.a instead.  I did this:

	cd lib
	ln -s /usr/lib/libgmp.a libgmp.a

and commented out the Makefile line

	all:: GMP

Dumpdata doesn't work, so configure with the option --disable-dumpdata.

----------------------
DEC Alpha notes
----------------------

Use gcc 3.0 for best results.  If the compiler crashes on one of the files in
Macaulay2/e, compile that one file without --fexpensive-optimizations -O3 .
