JAGS 5.0.0 is now available for macOS

[This article was first published on R – JAGS News, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

This is a guest post by Matt Denwood.

After a longer-than-anticipated delay, the macOS installer for JAGS 5.0.0 is now available via SourceForge. There are some big changes for how the official binaries of JAGS 5.x are installed on macOS, which is the topic covered by this news post.

Multi-threading and BLAS linkage

JAGS now has multi-threading support to allow parallel execution of independent chains, which uses Apple’s Grand Central Dispatch for the macOS binaries. This is the default build, as most users will want to benefit from the parallel computation. However, a single-threaded build is also provided as part of the installer, which has the same behaviour as JAGS 4.3.2. A third build is also provided within the installer, which uses single threading along with Netlib’s reference implementation of BLAS and LAPACK rather than Apple’s vecLib (Accelerate framework). By default, all three of these builds are installed so that the user can later switch between them;  however, the installer can be customised to deselect builds that are not needed.  For any users wishing to avoid the larger download and installation footprint (e.g. build/test machines), we have also provided single-build installers via SourceForge. For discussion on the difference between BLAS implementations, see the relevant section of the R for macOS FAQ. It is also possible to build JAGS using OpenMP on macOS – this is not provided as part of the official macOS installer, but the necessary compilation instructions will be added to the macOS section of the JAGS installation manual in due course.

Installation location

  1. Although there is no standardised location for installing system-level software on macOS, the /opt directory is now more frequently used (by e.g. homebrew and some elements of R) than /usr/local. Part of the reason for this is that installation under /opt/jags ensures a clean separation between software relating to JAGS and other software that you may have installed under other subdirectories of /opt.
  2. The installer now contains multiple builds of JAGS as well as utilities that are specific to macOS (see below) – the versioned directory structure allows the different builds and utilities to coexist.
  3. Having a versioned directory structure also allows different major versions of JAGS to be installed on the same system – we hope that this will ease the transition from JAGS 4.3.2 to JAGS 5.0.0 on CRAN’s build systems.

The installer also contains a build of JAGS 4.3.2 that installs under the same /opt/jags directory, with symbolic links to the older /usr/local directory that allow the CRAN build of rjags-4 to continue to function as expected. These symlinks also allow JAGS 5.x to be accessed from the Terminal (and by pkg-config) without updating the PATH variable, although we recommend adding the new directory to the PATH explicitly using (for example): echo 'export PATH="/opt/jags/bin:$PATH"' >> ~/.zshrc

JAGS utilities

As well as JAGS itself, the macOS installer provides the following three utilities:

  • jags-version – this allows the active build of JAGS to be switched, both for the command-line version and for rjags.  Switching between major versions of JAGS requires re-installation of the rjags package with matching version, as well as re-compilation of the runjags package. Switching between builds of JAGS with the same major version does not require re-installation of any R package (but may require R to be restarted, if the required packages are loaded).
  • jags-uninstall – this allows for complete removal of any JAGS installations detected either under the new /opt/jags directory or the legacy /usr/local directory.
  • pkgconf-lite – as macOS does not include pkg-config by default, this small utility (provided by pkgconf) is installed in order to facilitate compilation of rjags on vanilla macOS installations.

See the provided man pages for jags-version and jags-uninstall for more information on these utilities.  Note that these utilities are not installed if using the single-build installers.

Getting help

If you encounter any issues with the macOS installer or utilities, please either post to the macOS-specific JAGS installation thread on the JAGS discussion forum. If you have comments or suggestions regarding the macOS utilities or build process for JAGS then please feel free to open an issue on the GitHub repo for the macOS build scripts.

To leave a comment for the author, please follow the link and comment on their blog: R – JAGS News.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)