Fetching contributors…
Cannot retrieve contributors at this time
142 lines (78 sloc) 3.33 KB
This file contains instructions for building "piqi" command-line executable from
source code.
Pre-built binaries can be downloaded from
Piqi has been tested on Linux (i386 and amd64 architectures), Mac OS X and
FreeBSD. It is also known to work on Windows and Solaris.
Piqi is written in OCaml so, in theory, it should work on platforms and hardware
architectures supported by OCaml. See the list of supported platforms at
On Debian and Ubuntu:
apt-get install ocaml camlp4-extra ocaml-findlib gcc make sed
On Mac OS X (using Homebrew):
brew install ocaml opam
opam init
eval `opam config env`
opam install ocamlfind camlp4
(Here, we used [OPAM]( to build and install
On Windows:
See the "CROSS-COMPILATION" section below for instructions on building a
Windows executable on Linux and Mac OS X.
For building native Windows binaries, download and install OCaml for
Windows from here:
For building under Cygwin, follow the steps from the next section.
On other Unix systems:
* OCaml (>= 4.02.0)
OCaml is available in most Linux distributions. It can also be
downloaded from here:
* CamlP4 -- Caml Preprocessor and Pretty Printer
It comes as a part of OCaml source distribution. It should be
prepackaged in major Linux distributions as well.
* Ocamlfind/Findlib -- library manager for OCaml
If installed separately form prepackaged OCaml distribution, it
is recommended to build it from sources after you build/install
OCaml. It can be downloaded from here:
* C compiler
GCC works. Other compilers should work if they are able to build
* GNU make, sed and probably some other tools.
1. Run ./configure
Run "./configure --help" for the list of available options.
2. Build third-party dependencies
make deps
3. Build Piqi
4. Install the "piqi" binary along with the "piqi.1" man page
make install
5. (Optional) build HTML documentation -- see doc/ for more details
make doc
make test
See tests/README for further information.
To build a Windows (win64) executable on Linux/MacOsX:
1. Install OCaml cross-compiler and cross-compiled dependencies
Follow instructions here:
For example, on Mac OS X:
brew install mingw-w64 gawk
opam repository add windows git://
opam switch 4.04.0
eval `opam config env`
opam install ocaml-windows ocamlfind camlp4
2. Build
./configure --toolchain windows
make deps
make strip # optional
# ex: sw=4 et