Skip to content

Science1 publisher2 min readPublished

JAGS 5.0.0 for macOS makes parallel chains the default build

JAGS 5.0.0 for macOS, now on SourceForge, runs chains in parallel by default and installs three builds side by side. For Mac teams leaving 4.3.2, the build a pipeline calls is now a per-machine setting to check before results are compared.

The Scientist · Science desk

Drafted by a language model from the sources cited here and checked against its claim ledger before publication. How we use AISend a correction

Illustration accompanying JAGS 5.0.0 for macOS makes parallel chains the default build
Generated illustration

What happened

  • The third build pairs single threading with Netlib's reference BLAS and LAPACK in place of Apple's vecLib, which is part of the Accelerate framework.
  • The installer also carries a JAGS 4.3.2 build, with symlinks into the old /usr/local directory so the CRAN build of rjags-4 keeps working.
  • A bundled utility, jags-version, sets which build is active for both command-line JAGS and the rjags package.
  • Single-build installers, offered for machines such as build and test boxes that want a smaller footprint, leave out all three macOS utilities.

Compiled by The ScientistSomething wrong?How this is made

Why it matters

  • decision Putting a single-build installer on a build machine fixes its threading and linear-algebra library at install time, because jags-version does not come with it.
  • constraint On a vanilla Mac, a single-build installer also leaves out pkgconf-lite, so compiling rjags there loses the pkg-config helper the full installer supplies.
  • cost Each Mac's R library pays for the major-version move: rjags has to be reinstalled at the matching version and runjags recompiled.

I would keep the single-threaded build installed on any Mac that has to reproduce earlier results. Matt Denwood, who announced the installer in a guest post on R-bloggers [20], wrote that it behaves the same as JAGS 4.3.2 [3]. Installed beside the parallel default, it gives a lab a control on the same hardware.

The three builds also separate the two changes in this release. The default and the single-threaded build differ in threading. The single-threaded and Netlib builds differ in the linear-algebra library [2]. None of the three combines multithreading with Netlib [1], so the installer lets each change be tested on its own and offers no way to test the two in combination. For how vecLib and Netlib's reference implementation differ, Denwood points readers to the R for macOS FAQ [7].

What runs in parallel is independent chains, scheduled through Apple's Grand Central Dispatch [2]. "This is the default build, as most users will want to benefit from the parallel computation," Denwood wrote [19]. The post does not include timings, so the time saved on any particular model has to be measured locally.

The files have moved too. JAGS now installs under a versioned /opt/jags tree [9]. Denwood gives two reasons: a clean separation from other software under /opt, and room for several builds, utilities and major versions to coexist [9]. Symlinks under /usr/local let Terminal and pkg-config find JAGS 5.x with no PATH edit, though the post recommends adding /opt/jags/bin to PATH explicitly [12].

Switching between builds within version 5 needs no R package reinstall. At most, R has to be restarted if the packages are already loaded [15]. A second utility, jags-uninstall, removes any JAGS it detects under /opt/jags or the legacy /usr/local directory [16].

On the versioned layout, Denwood wrote: "we hope that this will ease the transition from JAGS 4.3.2 to JAGS 5.0.0 on CRAN's build systems" [10].

What to watch

  • Compilation instructions for an OpenMP build of JAGS on macOS, which Denwood says will be added to the macOS section of the JAGS installation manual in due course.
  • Problem reports on the macOS installation thread of the JAGS discussion forum and issues on the GitHub repo for the macOS build scripts, the two channels the post names for installer and utility trouble.
Loading claim ledger
Loading source directory links
Loading share composer
Loading topic controls
Loading related stories