Cygwin
Macaulay 2 for Microsoft Windows has been compiled under Cygwin, a system that provides Microsoft Windows with a high degree of compatibility with the GNU operating system (upon which GNU/Linux is based), which you will need in order to run Macaulay 2. Visit http://cygwin.com/ and install it, if you haven't done so already. Administrator privileges are not required, but up to 1GB of free disk space will be required.
After you have installed Cygwin, you should learn how to run programs in a Cygwin shell. Run the Cygwin shell from the start menu or from the icon on the desktop. A window will appear with a prompt in it. In that window you can enter many of the standard unix commands, such as ls, and they will work. One thing that's different about the environment in a cygwin shell is that the directory C:/ is visible only as /cygdrive/c/. Correspondingly, the root directory / of cygwin is visible to Windows programs only as something like C:/cygwin/ (depending on where you installed cygwin); the cygwin command for determining that path is cygpath -w / .
Installation of Cygwin is done with a program called setup.exe. It is possible to use it also to download and install Macaulay 2 from our repository as described in setup.html. That should work, but if not, an alternative is to install it as described in download.html, and then continue with the rest of the instructions on this page.
After downloading and installing Macaulay 2, you may be tempted to run M2.exe immediately, without running it in a cygwin shell. If you try that, you will get an error message about the sharable library cygwin1.dll not being found.
The best way to run Macaulay 2 is in emacs, and the best way to run emacs is under X11. So use cygwin's setup.exe to install emacs-X11. Then, in a cygwin shell, type "startx&" to start X Windows. If an Xterm window pops up, type "emacs&" in it to start emacs running (in a new window of its own). If an Xterm window doesn't pop up, then type "DISPLAY=:0 xterm&" to start one, or type "DISPLAY=:0 emacs&" to start emacs running directly. (Warning: the next time you run the cygwin setup program, it may try to replace emacs by an older version, for some mysterious reason. Watch out for that, and prevent it, if you prefer the recent version.)
Users new to emacs should spend some time becoming accustomed to it. A good place to start learning how to use emacs is with the Emacs Tutorial, which can be accessed after starting emacs.
Note: If you previously installed an older version of Macaulay 2 "manually" by unzipping a tar file, then it is important to move its files out of the way, unless you installed them under "/" or "/usr", where the new files will simply replace them. (In the future, the "setup" program will take care of deleting files from older versions.) Alternatively, if you don't want to (or you can't) move them out of the way, start the new M2 with the command "/usr/bin/M2", and after you get the first input prompt ("i1 = ") evaluate the expression "setup()". That action will modify your various init files so that the new M2 and its files will be found the next time you start a new cygwin shell, within that shell and its descendants.
Here are some current problems with Macaulay 2 running under Cygwin.
- The only browser the Macaulay 2 functions "show" and "viewHelp" know about is firefox, and the only place it looks for it is at C:/Program Files/Mozilla Firefox/firefox/.
Here are some solutions for some common problems that occur when running Cygwin.
- After typing emacs& nothing happens, and after typing emacs, emacs starts in the same window. Cause: emacs was installed after emacs-X11, and the X11-capable version of emacs is not available. Verify this by looking at the files with ls -l /usr/bin/emacs*. The files emacs.exe and emacs-nox.exe should have different lengths. Solution: reinstall (just) emacs-X11.
- emacs can't start M2 for want of resources: Cause: unclear; solution: shut down cygwin, run rebaseall in an ash shell and reinstall libncurses7
- emacs goes into infinite loop when starting: Cause: running rebaseall; solution: shut down cygwin, run setup.exe, and reinstall libncurses7
- WFSO timed out after longjmp. Cause: things are slow; solution: none (rebaseall?, turn off virus scans?)
- It's hard to locate files from within Macaulay 2 or emacs. Cause: cygwin and windows have different roots for their file systems. Solution: within a cygwin program, such as M2 or emacs, the root of drive C (for example) can be accessed as "/cygdrive/c". Within a windows program, such as the explorer or firefox, the root of cygwin's file system is visible as "C:/cygwin", if cygwin was installed in the usual location.
- Only 384MB of RAM is available for use by M2. Cause: cygwin has a built-in memory limit for programs that is small. For changing that limit in cygwin 1.5 (the current default version as of February, 2008) see maxmem 1.5, and for cygwin 1.7 (the forthcoming version) see maxmem 1.7.
- The links to the documentation of the packages users have installed themselves cannot be followed by the browser. The problem is that cygwin emulates the unix notion of "symbolic link" to a file, but programs such as firefox that are not part of cygwin don't understand such links. Nevertheless, the documentation for such packages can be viewed directly by navigating through ~/.Macaulay2/encap. This problem is solved in Macaulay 2 version 1.1.99, which, by default, does not use symbolic links when installing packages.
- I ask setup.exe to install something, and it doesn't install it. A good way to see what setup will install in the final step, before going there, is to press the "View" button in the upper right hand corner until the text to the right of it says "Partial". Then the list below will consist of those cygwin packages it intends to install (or upgrade).
- I ask setup.exe to install emacs version 23, and it doesn't install it. The setup program is mysteriously broken in many ways. Sometimes it displays the version number it intends to install, but the black box just to the right under the heading "B" for "Bin" is empty. Check all such boxes, so it will actually install something.
- Under windows 7, emacs can't start up Macaulay2, or even start up a shell. Perhaps this is a problem with emacs version 23, and you should revert to emacs version 21.
Let us know if there are any (further) problems!