Last updated on: April 15, 2017
Building WeiDU requires and/or is facilitated by the
- Native OCaml (typically compiled with MinGW), obtained
from ocaml.org. For less
configuration, install to c:/ocaml.
- A Cygwin-based *nix toolchain, particularly binutils and
make from the Devel group. Perl is also required, but is
normally installed by default. Optionally also git (Devel),
openssh (Net), zip (Archive) and upx (Utils).
- Cygwin-hosted MinGW-GCC, called mingw-gcc-core (Devel) or some such.
- Elkhound (vide infra). For less configuration, place
the elkhound binary in Cygwin's /bin directory. Bear in mind
the make process does not like paths with spaces.
Once your environment is up, open the Cygwin terminal and wait
for it to finish setting up your home folder. By default, this
will be at c:\cygwin\home\<user>,
where <user> is your Windows user name. This is
where you will want to place your WeiDU source code and the
Cygwin terminal is what you will want to use when you compile
the source. Within the Cygwin environment, your home folder will
have the shorthand ~ (tilde).
WeiDU requires OCaml, including the native compilers, and a
basic GCC toolchain. Different distributions package these
differently. Perl is also required, but is normally installed
by default. You may additionally want/need git, hevea,
texlive, zip and upx. HeVeA and TexLive are only needed to
build the documentation and zip and upx are used in making the
distributable archives (upx is optional).
WeiDU additionally requires Elkhound (vide infra).
Place the executable on your path and allow Elkhound to be
executed as a program, for example, by using the terminal
chmod +x path/to/elkhound
- Make sure you have Xcode installed. You probably don't need
Xcode per se but apparently it is the conventional way of
obtaining some of the necessary programs (make, gcc, etc.). You
may be able to download and install Xcode's command-line tools
Developer without having to download and install all of
- Install MacPorts
- Install Perl. HomeBrew and MacPorts both seems to package
- Use MacPorts or HomeBrew to install OCaml. Note where OCaml
- Optionally, install UPX. UPX is used to compress the
compiled programs, but is not available for all platforms.
- Obtain Elkhound (vide infra) and place the executable
on your path. Allow Elkhound to be executed as a program, for
example, by using the terminal command
chmod +x path/to/elkhound
precompiled for Windows x86 (with Cygwin), GNU/Linux i386 and
AMD64, and macOS x86 and x86-64.
The source is available at
Elkhound is written in C++ by Scott McPeak, is licenced under
3-clause BSD terms and requires Bison and Flex to be built.
- Obtain WeiDU's source code. The recommended way is by using
git clone git://github.com/WeiDUorg/weidu.git relative/place/where/you/want/it
Bear in mind WeiDU builds distribution packages to the directory
one level up from where the source is located.
- Enter the directory where you put WeiDU's source code. Copy
the file ./sample.Configuration to ./Configuration. If you are
on Windows and installed OCaml to a location other than c:\ocaml
or if you are on macOS and installed OCaml to a location other
than /usr/local/, open ./Configuration and adjust the path to
- Make sure you have the up-to-date WeiDU source. The
recommended way is by using git (from inside the directory where
you keep your WeiDU source code):
git pull origin
- If the file ./sample.Configuration has been changed,
recreate ./Configuration and reapply any changes you have made
- Check out the branch you wish to compile WeiDU from. If you
are building a stable version, check out the master
branch. If your are building a beta version, check out
the devel branch. From inside your WeiDU source
directory, you check out a branch with:
git checkout <branch>
where <branch> is the branch you wish to check
- Run make. Relevant build targets are
The *_zip targets produce an archive in .. that is suitable for
distribution. If you are not developing WeiDU, you probably want
one of windows_zip, linux_zip or osx_zip.