These instructions show you how to build FriCAS on MS Windows from the sources
in the subversion repository.  You may want to consider building FriCAS from a
distribution tarball instead, which contains pregenerated algebra Lisp,
HyperDoc pages and graphic examples.  Moreover, using the tarball the build is
much faster - a few minutes instead of a few hours.  You can get a tarball via
http://fricas.sourceforge.net/download.html

First of all, do not be afraid!  The instructions below probably look more
intimidating than they really should be.  In case something goes wrong, do not
hesitate to ask at fricas-devel@googlegroups.com.

Note1: Compilation of current trunk seem to fail at least on
some versions of Windows.  Release 1.1.2 is reported to build
but with not working ')compile' command.  This is under
investigation.

To compile FriCAS on MS Windows, we proceed as follows:

I) If you do not have Cygwin installed, go to

    http://cygwin.org/

    Look for a link called setup.exe and save it to disk.

II) Start Cygwin's setup program.  The first few questions can be answered with
    the default values, until you get to the "Select Packages" dialog.

    Clicking on a little + will expand the list of packages. You should select
    apart from the defaults the following:

    (DISCLAIMER: this list is likely to be overkill.  Also note that selecting
    will also select many packages they depend on, this should happen
    automatically.)

           In Devel: gcc-mingw
                     gcc-mingw-core
                     make
                     patchutils
                     subversion
           In Math:    clisp
           In Publishing: psutils
                          tetex
                          tetex-base
                          tetex-bin
                          tetex-extra
                          tetex-tiny
                          tetex-x11
           In Web: wget
           In X11: xterm
                   libICE-devel
                   libXpm-devel
                   libSM-devel
                   libX11-devel
                   xinit
                   font-adobe-dpi75
           In Editors: emacs
                       emacs-X11

    Complete the Cygwin installation process.

III) start Cygwin - a black console window should appear.  Note that
    it's better *not* to start Cygwin/X, but rather an "ordinary"
    shell.  Furthermore, it seems that it's a good idea to close all
    other applications before building.

    find a place to build FriCAS.

  cd /cygdrive/c
  mkdir scratch
  cd scratch

    (it is essential that the path to scratch does not contain any spaces.
    Otherwise the build won't work...)

IV) follow the instructions in INSTALL (but note that we are going to build
    FriCAS using clisp), that is:

    1) Fetch sources:

  svn co https://fricas.svn.sourceforge.net/svnroot/fricas/trunk fricas

    alternatively, download a release version of the source.  In this
    case step 2) and 6) below should also be omitted.

    2) create the build directory (again: without spaces!)

  mkdir fri-build
  cd fri-build

    3) configure.  Possibly, you will have to restrict the PATH to
    Cygwin programs, because otherwise configure may pick, for
    example, Borland grep which causes failure later.  You can do
    this by typing

  export PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin

  ../fricas/configure --prefix=/usr --with-lisp=clisp

    4) build and install:

  make

    5) make the graphics examples:

    IMPORTANT NOTE: this step failed when I tried.  After the first
    drawing appeared and disappeared, it did not continue.  The
    example graphics are in no way essential though and can be easily
    reproduced in the installed system.

    6a) start a Cygwin/X shell

    6b) run the examples

  cd /cygwin/c/scratch/fri-build/src/paste
  make gphts

       at this point (which will take a while), graphics should appear and
       disappear.

  cd ../..
  make


    7) install

  make install

V) You can now start fricas with a comfortable user interface by
    starting a Cygwin/X shell and typing

  efricas

    or, without emacs, using

  fricas

    efricas may sometimes randomly fail, this is a known
    inconvenience.  A fix is very welcome.
