Executive Summary
=================

Maxima can now be built under Windows without recourse to any
Unix-like utilities. To do so, follow the purely lisp-based build
procedure in INSTALL.lisp.

Maxima can be simply compiled and installed under MSYS or Cygwin by
following the GNU Autotools instructions in INSTALL. With a few more
steps, Maxima will create a windows installer executable.  The
instructions for doing so are contained in this file. Note, however,
that this process is not as polished as the Unix-like install process.

In order to create the Maxima Windows installer from the maxima tarball 
distribution, I do the following in a MSYS window:
----------------------------------------------------
./configure --prefix=c:/maxima \
    --enable-chm \
    --enable-xmaxima-exe \
    --with-hhc=<path-to-hhc> \
    --enable-lang-es --enable-lang-pt --enable-lang-pt_BR \
    --with-ccl=<path-to-ccl>
make
make install
make iss
----------------------------------------------------
Then run Inno Setup on the generated maxima.iss file. That is all it
takes.

To compile with sbcl replace --with-ccl=<path-to-ccl> with
--with-sbcl=<path-to-sbcl>.

A script for building an installer is available at
<https://github.com/andrejv/max_build.sh>.

External Requirements
=====================

1) MinGW and MSYS
2) ccl/sbcl
3) Tcl/Tk (8.5 or later recommended)
4) Starkit, TclKit and img.kit
5) Vtk
6) InnoSetup
7) gnuplot
8) wxMaxima
9) Microsoft HTML Help Workshop
10) Python

Detailed Instructions
=====================

The instructions below apply to the maxima release tarball. In order
to build from the git repository, git, autoconf and automake are also
required. Follow the directions in INSTALL.git before proceeding.

1) Install MinGW and MSYS
a) Download mingw installer mingw-get-inst from http://www.mingw.org/
b) Run the installer to install mingw and msys
c) Use the installed mingw-get to add the build dependencies, including
   - mingw-gcc
   - mingw-binutils
   - mingw-make
   - mingw32-autotools

2) Install a lisp. Clozure Common Lisp (http://ccl.clozure.com) and
Steel Bank Common Lisp (http://sbcl.org) are supported. For Clozure
Common List use at least version 1.7 (version 1.10 does not work). For
Steel Bank CL use at least version 1.2.

3) Download tclkitsh-8.6.3-win32-ix86.exe and
tclkit-8.6.3-win32-ix86.exe from
<http://tclkits.rkeene.org/fossil/wiki?name=Downloads> and put them in
c:/programs/star.

Download sdx.kit and img.kit from <http://www.tcl.tk/starkits/> and
put them in c:/programs/star.

4) Get and install Inno Setup from <http://www.jrsoftware.org/isinfo.php>.

5) Download the gnuplot windows binary from
<http://gnuplot.sourceforge.net> and put it in
c:/programs/gnuplot. Use at least version 4.4.

6) Put the wxMaxima windows binary into c:/programs/wxMaxima.

7) Get Microsoft HTML Help Workshop from
<http://www.microsoft.com/en-us/download/details.aspx?id=21138>

8) Install Python from www.python.org. Add the path to python to your
windows PATH environment variable.


You should now be ready to compile and install maxima.  Configure
maxima so that it will install in some sort of temporary
directory. The directory does not need to exist ahead of time.

./configure --prefix=c:/maxima \
    --enable-chm \
    --enable-xmaxima-exe \
    --with-hhc=<path-to-hhc> \
    --enable-lang-es --enable-lang-pt --enable-lang-pt_BR \
    --with-ccl=<path-to-ccl>
make
make check
make install
make iss

The "check" should pass all tests except those listed as known
failures.

Once "make iss" is complete, run Inno Setup on the maxima.iss file. It
is recommended to remove the temporary maxima install directory
(c:/maxima above) before testing the installation.

9) Test the installed package (see the following part:)



Testing the installation package:
=================================

After building it, you can (and should) test the new Maxima installation package.
Install it on Windows and check that the installation (and later the deinstallation)
works properly. To test Maxima, try the following:

 o Run the maxima testsuite: run_testsuite();
 o Try compiling a function.  This has been a problem in the past
    f(x):=x+2;
    compile(f);
    f(2);
 o Test the graphics systems in both xmaxima and wxmaxima
    plot2d(sin(x),[x,0,10]);
    plot2d(sin(x),[x,0,10],[plot_format,xmaxima]);
    plot3d(x*y,[x,-1,1],[y,-1,1]);
    scene(cone);
    plotdf([-y,x],[trajectory_at,5,0]);
    load(draw)$
    draw3d(xu_grid = 30, yv_grid = 60, surface_hide = true,
          parametric_surface(cos(phi) * sin(theta),
                       sin(phi) * sin(theta),
                       cos(theta),
                       theta, 0, %pi, phi, 0, 2 * %pi))$
 o Check that plotting to Postscript works
    plot2d(sin(x),[x,0,10],[ps_file,"ps_test.ps"]);
 o Try out the on-line help: describe(sin);
 o Try out, if external packages (e.g. lapack) work:
   load(lapack);
   fpprintprec : 6;
   M : matrix ([9.5, 1.75], [3.25, 10.45]);
   dgeev (M);

   should return the eigenvalues of M (and false, false since we did
   not compute eigenvectors: [[7.54331, 12.4067], false, false]

 o Check that the windows help files work from the Start menu 
   and from within xmaxima and wxmaxima
 o Try if double-clicking on a .wxmx file opens it
 o The wxMaxima source comes with a file (test/testbench_simple.wxmx)
   that tries to trigger everything that has gone wrong in previous
   wxMaxima builds.  They include the commands that will test the
   graphics system in the next step.
   Open that file and then select "Cells/Evaluate all cells" in this
   file and check if the file is processed correctly.
