Here are instructions on how to compile WeiDU under Windows, while running as administrator. Mac and Linux users should be able to derive instructions for their platforms from this.

Setting up on Windows



Things to download:
- Download cygwin from http://cygwin.com
- Download Ocaml from http://ocaml.org (get the version for windows compiled using MinGW, not the one using Microsoft toolchain). Make sure you're using V3.10 or higher.
- Download Tcl/TK (version 8.4) from activestate.com.
- Download any recent Windows version of WeiDU (the latest from weidu.org/~thebigg works fine)
- Download the Elkhound source from here (this is Scott McPeak's version, with a minor bug fix to account for a changed flex version).
- Download the Binary Package of Flexlink from alain.frisch.fr.

Things to set up (note: these assume you use default paths, except where noted):
- Install ocaml. To do slightly less configuration, install it in C:\ocaml.
- Install Tcl/Tk.
- Double click setup.exe (the program used to install cygwin). When asked for packages, add the following ones to the standard selection (additional ones will be added automagically by the setup.exe program, to account for dependancies. This is expected):
- from archive: unzip, zip
- from devel: binutils, make, gcc, flex, bison
- from utils: upx
Note: do NOT install ocaml from the cygwin packages; install the one from ocaml.org instead.
- run once start -> programs -> cygwin -> Cygwin Bash shell, wait for it to do some processing, and then simply type ctrl-d to exit.
- Open C:\cygwin\home\something, where something is your Windows username (it should be the only directory in here anyhow). copy and unzip here your Windows WeiDU version (so that you end up with C:\cygwin\home\something\WeiDU\WeiDU.exe as a valid file)
- if present, delete C:\cygwin\home\something\WeiDU\tk83.dll
- if absent from the destination, copy C:\tcl\bin\tk84.dll to C:\cygwin\home\something\WeiDU
- Open C:\cygwin\home\something, where something is your Windows username (it should be the only directory in here anyhow). Copy here the Elsa package (the .tar.gz file).
- From the Flexlink binary distribution, extract flexlink.exe to C:\cygwin\usr\bin.
- start -> programs -> cygwin -> Cygwin Bash shell, type the commands in bold (or copy/paste them):
    tar xzf elkhound-2009.01.29.tar.gz
    cd elkhound-2009.01.29
    ./configure
    make
    cp elkhound/elkhound.exe /usr/bin

If you're unlucky, the compiler might barf. This alternative tarball of Elkhound (made by roystgnr) might work better than the previous one for you. If not, I hope you know enough C++ to fix any errors that crop up.

Compiling


Download the latest source package from either the stable location or git, according to the case.

unzip the source package to C:\cygwin\home\something (so that C:\cygwin\home\something\WeiDU\src\tp.ml is a valid file)
- run start -> Programs -> cygwin -> cygwin bash shell, and type the following commands:
- cd WeiDU
- find -exec touch {} \;
- make windows_zip

after a while, you'll end up with weidu, weigui and weinstall in c:\cygwin\home\something\WeiDU, and the Windows zip file in c:\cygwin\home\something.

Troubleshooting


Problem: Windows is complaining about `as' not being a valid command.
Cause: Sometimes installing tcl/tk will deteriorate your PATHEXT variable.
Check if this is the problem: start -> Run -> cmd.exe <enter> and run `echo %PATHEXT% '. Make sure it has the various Windows executable extensions (.COM;.EXE;.BAT etc.). If the variable only contains ".tcl", to fix you have to right click on My Computer, properties, advanced tab, Environment Variables, and change the user PATHEXT variable from ".tcl" to "%PATHEXT%;.tcl". After that, rebooting might be needed.