Installing Herbie

Herbie supports Linux, macOS, 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.

Installing Racket

Use the official installer to install Racket, or use distro-provided packages provided they are version 7.0 or later of Racket (earlier versions are not supported).

Test that Racket is installed correctly and has a correct version:

racket
Welcome to Racket v7.3.
> (exit)

Installing Herbie from a package

Once Racket is installed, install Herbie with:

raco pkg install --auto herbie

This will install Herbie, compile it for faster startup, and place an executable in your Racket user path, likely into ~/.racket/7.3/. If you add this directory to your PATH you will be able to run herbie with the herbie command.

Once Herbie is installed and working correctly, check out the tutorial.

Installing Herbie from source

Once Racket is installed, download and build 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 7.3, and if the error still persists, please submit a bug.

For faster startup, to create the herbie command, and to enable plugins, run the following command:

raco pkg install --name herbie src/

Once Herbie is installed and working correctly, check out the tutorial.

Installing Herbie from Docker

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, macOS, and Linux. Depending on how you install Docker, you may need to prefix the docker command with sudo or run them as the 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. Note that Herbie in Docker is more limited; for example, it will not recognize plugins installed outside the Docker container.