# Install herdtools7 completely from sources

For this demonstration we shall install all software as a standard user in `$HOME/TST`

## Install OCaml

First get the last OCaml release, for instance from https://github.com/ocaml/ocaml/archive/refs/tags/5.1.1.tar.gz.


Uncompress, untar, then:
```
% cd ocaml-5.1.1
% ./configure -prefix=$HOME/TST
% make
% make install
```

From that point, `$HOME/TST/bin` should be part of your path, for instance (bash):
```
PATH=$HOME/TST/bin:$PATH
```

## Install ocamlfind
From `https://github.com/ocaml/ocamlfind/tags`, we select the most recent version: `https://github.com/ocaml/ocamlfind/archive/refs/tags/findlib-1.9.6.tar.gz`. Fetch uncompess, untar, then:
```
% ./configure
# Check output for target directories (in $HOME/TST/.. for us)
% make install
```

## Install dune

From `https://github.com/ocaml/dune/releases`, we select the last release (3.15.0). Fetch, uncompress, untar...
```
% cd dune-3.15.0
%  ./configure --bindir $HOME/TST/bin --libdir $HOME/TST/lib --datadir $HOME/TST/share --docdir $HOME/TST/doc --mandir=$HOME/TST/man
% make release
% make install
```


Configuraton is necessary for proper installation of future software.
    

## Install menhir

Menhir releases are here: `https://gitlab.inria.fr/fpottier/menhir/-/tags`. Select the most recent one. Fetch, uncompress, untar...
```
% dune build @install
% dune install
```


## Install zarith
Releases are here: `https://github.com/ocaml/Zarith/releases`, select the most recent one (https://github.com/ocaml/Zarith/archive/refs/tags/release-1.13.tar.gz) for us. Fetch, uncompress, untar, then, assuming that `gmp` with developement  files is properly installed:
```
% ./configure -installdir $HOME/TST/lib
...
detected configuration:

  native-code:          yes
  dynamic linking:      yes
  defines:              -DHAS_GMP 
  includes:             -I/home/nas/gallium/maranget/TST/lib/ocaml
  libraries:             -lgmp 
  linker options:       
  C options:            -O3 -Wall -Wextra 
  installation path:    /home/nas/gallium/maranget/TST/lib
  installation method   findlib

configuration successful!
now type "make" to build
then type "make install" or "sudo make install" to install
% make
% make install
```

# Install herdtools7
Releases are available at `https://github.com/herd/herdtools7/releases`. We selecct the last release canididate `https://github.com/herd/herdtools7/archive/refs/tags/7.57.tar.gz`. Fetch, uncompress, untar, then:

```
% make build install PREFIX=$HOME/TST
```
