The function performs the following steps:
Queries the GitHub API to find the specified release of Project-OSRM/osrm-backend.
Identifies the correct binary (.tar.gz archive) for the user's OS (Linux, macOS, or Windows) and architecture (x64, arm64).
Downloads the archive to a temporary location.
Extracts the archive and locates the OSRM executables (e.g., osrm-routed, osrm-extract).
Copies these executables to a local directory (defaults to
file.path(tools::R_user_dir("osrm.backend", which = "cache"), <version>)).
Downloads the matching Lua profiles from the release tarball and installs them alongside the binaries.
Optionally modifies the PATH environment variable for the current session or project.
macOS users should note that upstream OSRM v6.x binaries are built for macOS 15.0 (Sequoia, Darwin 24.0.0) or newer.
osrm_install() automatically blocks v6 installs on older macOS releases and, when version = "latest",
selects the most recent v5 build instead while warning about the requirement. Warnings include both the
marketing version and Darwin kernel so you'll see messages like macOS 13 Ventura [Darwin 22.6.0].
When installing OSRM v6.x for Windows, the upstream release omits the Intel
Threading Building Blocks (TBB) runtime and a compatible bz2 DLL. To keep
the executables runnable out of the box, osrm_install() fetches TBB from
oneTBB
v2022.3.0 and the BZip2 runtime from
bzip2-windows
v1.0.8.0, verifying their SHA-256 checksums before extraction. Without these
extra libraries, the OSRM v6 binaries shipped for Windows cannot start.
On macOS, OSRM v6.x binaries also miss the bundled TBB runtime. The installer
reuses the libraries from release v5.27.1 to keep the binaries functional
and patches their libbz2 linkage using install_name_tool so that they load
the system-provided BZip2 runtime.
Power users (including package authors running cross-platform tests) can
override the auto-detected platform by setting the R options
osrm.backend.override_os and osrm.backend.override_arch (e.g.,
options(osrm.backend.override_os = "linux", osrm.backend.override_arch = "arm64"))
before calling osrm_install(). Overrides allow requesting binaries for any
OS and CPU combination that exists on the GitHub releases.