Herbie currently supports Linux, OS X, and Windowsβ.
Herbie can be installed from a package or from source. (It is also available in a Docker image.) To install Herbie, first install Racket, which Herbie is written in.
Use the official installer to install Racket, or use distro-provided packages provided they are version 6.7 or later of Racket (earlier versions are not supported).
Test that Racket is installed correctly and has a correct version:
$ racket Welcome to Racket v6.12. > (exit)
Once Racket is installed, install Herbie with:
raco pkg install herbie
This will install Herbie, compile it for faster startup, and place
an executable in your Racket user path, likely
into ~/.racket/6.12/
. If you add this directory to
your PATH
you will be able to run herbie with
the herbie
command.
Once Racket is installed, download the Herbie source from GitHub with:
git clone https://github.com/uwplse/herbie
If you go to the herbie
directory,
you should see a README.md
file, a directory named src
,
a directory named bench/
, and a few other directories.
Do a trial run of Herbie to make sure everything is installed and working correctly:
racket src/herbie.rkt report bench/tutorial.fpcore graphs/
This command will take approximately a minute to run.
After the command completes,
a directory named graphs
should be created.
Open the report.html
file inside with your browser;
you will see a listing of the expressions Herbie was run on,
all of which should be green.
If not, please check that your Racket installation is at least version 6.7,
and if the error still persists,
please submit a bug.
You can make Herbie start up faster by byte-compiling it:
raco make src/herbie.rkt
Docker is a container manager, which is sort of like an easily-scriptable virtual machine. We do not recommend using Herbie through Docker without prior Docker experience.
First, install
Docker. Docker supports Windows, OS X, and Linux. Depending on
how you install Docker, you may need to prefix
all docker
commands on this page
with sudo
or run them as the root or administrative
user.
With Docker installed, you should be able to download the Herbie image with:
docker pull uwplse/herbie
Check out the Docker page for more on how to run Herbie with Docker.