Installing BINSEC from sources
June 30, 2026 ยท View on GitHub
The latest public revision of binsec is available on GitHub:
https://github.com/binsec/binsec.
(optional) OCaml "environment"
:information_source: Local opam switch
Similarly to Python's venv, opam offers a mechanism for isolated OCaml environments, called switches.
In particular, local switches are activated when inside the specified directory.
A local switch makes the installation of dependencies, including OCaml supported version, not impacting the system wide OCaml configuration. Doing so, everything installed will be readily available but only inside the BINSEC directory.
If opam is available, using the following command will create a new OCaml switch inside the BINSEC tree.
OCAML_COMPILER=4.14.3 make switch
If you require a local switch in a parent directory to BINSEC's, look into:
opam switch create . 4.14.3
:warning: You might have to load the new switch, as indicated by opam at the end of the creation, or after a opam switch.
eval $(opam env)
Dependencies
Dependencies can be automatically installed via opam.
$ opam install dune dune-site menhir grain_dypgen ocamlgraph zarith toml
$ opam install bitwuzla bitwuzla-cxx z3 # optional -- for native SMT solver bindings
$ opam install unisim_archisec # optional -- for x86-64, ARMv7 and ARMv8
$ opam install curses # optional -- for real time summary window
System
OCaml
- dune >= 3.18
- menhir
- toml
- ocamlgraph >= 1.8.5
- zarith >= 1.4
- unisim_archisec (optional)
- bitwuzla (optional)
- z3 (optional)
- curses (optional)
- odoc (documentation)
- qcheck (test)
- ounit2 (test)
Build instructions
With make
Makefile is a wrapper around dune build system.
When opam is available, using the command make will automatically install the missing dependencies.
Run the following in order to build the binsec executable:
make
Then run the following in order to install binsec in the current switch:
make install
With dune
Make sure the above dependencies are available.
Run the following in order to build binsec executable:
dune build @install
binsec executable can be found in
_build/install/default/bin.
Run the following in order to install binsec in the current switch:
dune install
Or use it locally with:
dune exec -- binsec [...]