Please note this an unofficial version. Find the old version here.
The version of OCaml needs to be greater than or equal to 4.04 and less than or equal to 4.11, and configured without forced safe strings.
- OCaml with native compilers. Generally we recommend opam to get started. You'll need to create a switch because weidu uses unsafe strings:
opam switch create 4.08.1+default-unsafe-string-
A basic GCC tool chain with make. This should come preinstalled on most versions of linux.
-
Perl, which is normally installed by default.
-
Optionally, also git and hevea, texlive. HeVeA and TexLive are only needed to build the documentation.
-
Elkhound (vide infra). Place the executable on you path and allow Elkhound to be executed as a program, for example, by using the terminal command
chmod +x path/to/elkhound. You can find a pre-built version of elkhound here.
It is possible to build weidu via, nix. We have included a flake.nix file, which will automatically install all the tools and systems required. You will have to enable flakes once you have installed nix. Please note this is not available in windows.
To enable flakes in Nix, you need to add the following line to your configuration file:
experimental-features = nix-command flakesIn either ~/.config/nix/nix.conf for user-specific settings or /etc/nix/nix.conf for system-wide settings. After that, you can use the nix command with flakes features enabled.
Building executables (for linux and macos) is very straight forward with nix.
For linux:
nix build '.#packages.x86_64-linux'For macos:
nix build '.#packages.aarch64-darwin'- Native OCaml (typically compiled by MinGW), obtained from either from ocaml.org or via opam. Again this is tricky due to unsafe strings. Builds of OCaml before 4.14 don't exist for opam for 64 bit windows. So the following is required.
opam switch create --packages=ocaml-option-default-unsafe-string ocaml-variants.4.14.2+options-
A Cygwin-based *nix tool chain, particularly
binutilsandmakefrom theDevelgroup. Perl is also required but is typically installed by default. Optionally alsogit(Devel). -
Cygwin-hosted MinGW-GCC, called
mingw-gcc-core, or some such. -
Elkhound (vide infra). For less configuration, place the elkhound binary in Cygwin's
/bindirectory, or equivalent. The build process does not like paths with spaces.
- OCaml with native compilers. Generally we recommend opam to get started. You'll need to create a switch because weidu uses unsafe strings:
opam switch create 4.08.1+default-unsafe-string-
Install Perl (using MacPorts or HomeBrew, for example).
-
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
The source code and build instructions for Elkhound are available at GitHub.
There are also compiled executables for some platforms available under Releases.
-
Obtain WeiDU's source code. The recommended way is by using git:
git clone git://github.com/WeiDUorg/weidu.git your/directoryBear 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.Configurationto
./Configuration- 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 reset origin/devel --hard- If the file ./sample.Configuration has been changed, recreate ./Configuration and re-apply any changes you have made to it.
- Check out the branch from which you wish to compile WeiDU.
git checkout devel- Run make. Relevant build targets are
- clean
- weidu
- weinstall
- tolower
- doc
- windows_zip
- linux_zip
- osx_zip
WEIDU_VERA variable that contains the version of the WeiDU binary (e.g., 25000).WEIDU_EXECUTABLEA variable that contains the full path of the current WeiDU binary.WEIDU_OSA variable that is set to the users current os (e.g., unix).WEIDU_ARCHA variable that is set to the users current cpu architecture (e.g., amd64).
This is handled in here. And maybe disabled via the:
ignore (Arch2.associate_these ())set in some of the commands.