It is recommended that you get the downloadable files from the example dataset that we have provided, available at http://www.packtpub.com/support. You will be using the XML OSM data. You can also get custom extracts directly from the web interface at http://www.openstreetmap.org/or by using the overpass turbo interface to access OSM data (https://overpass-turbo.eu/), but this could limit the area we would be able to extract.
Once we have the data, we need to unzip it using our favorite compression utility. Double-clicking on the file to unzip it will typically work on Windows and macOS machines. Two good utilities for unzipping on Linux are bunzip2 and zip. What will remain is an XML extract of the data we want for routing. In our use case, we are downloading the data for the greater Cleveland area.
Now we need a utility for placing this data into a routable database. An example of one such tool is osm2pgrouting, which can be downloaded and compiled using the instructions at http://github.com/pgRouting/osm2pgrouting. Use CMake from https://cmake.org/download/ to make the installation build in macOS. For Linux Ubuntu users there is an available package at https://packages.ubuntu.com/artful/osm2pgrouting.