JAGS 4.0.1 for Mac OS X

It transpires that JAGS 4.0.0 for Mac OS X has an unwanted runtime dependency on libgfortran. The bugs module will not load on systems that do not have libgfortran installed. This has been corrected with the release of JAGS 4.0.1, now available from Sourceforge.

This is for Mac only. There will be no official release of JAGS 4.0.1 for other platforms, as these were unaffected by the bug.


11 thoughts on “JAGS 4.0.1 for Mac OS X

  1. jags does not seem to work with jags 4.0.1. It installs OK from the source, however, when I call the library I get:

    Error in get(method, envir = home) :
    lazy-load database ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rjags/R/rjags.rdb’ is corrupt
    In addition: Warning messages:
    1: In .registerS3method(fin[i, 1], fin[i, 2], fin[i, 3], fin[i, 4], :
    restarting interrupted promise evaluation
    2: In get(method, envir = home) :
    restarting interrupted promise evaluation
    3: In get(method, envir = home) : internal error -3 in R_decompress1
    Error: package or namespace load failed for ‘jags’

    • A quick Google search suggests that restarting your RStudio session will solve this. It seems to be a bug in RStudio and is not specific to the rjags package. Let us know if it works.

      • Thank you! I do not use RStudio, the problem seems to be with R. However, it does work after re-starting.

  2. I’ve installed jags from homebrew (running El Capitan), which installs jags into /usr/local, but have trouble installing rjags — would very much appreciate any pointers. Thank you so much for making software available!

    Trying to install rjags, compilation works fine, but the test loading fails as such:
    *** installing help indices
    ** building package indices
    Warning: namespace ‘rjags’ is not available and has been replaced
    by .GlobalEnv when processing object ‘LINE’
    ** testing if installed package can be loaded
    Error : .onLoad failed in loadNamespace() for ‘rjags’, details:
    call: dyn.load(file, DLLpath = DLLpath, …)
    error: unable to load shared object ‘/Users/martin/Library/R/3.2/library/rjags/libs/rjags.so’:
    dlopen(/Users/martin/Library/R/3.2/library/rjags/libs/rjags.so, 10): Symbol not found: __ZN4jags11SimpleRangeC1ERKSt6vectorIiSaIiEES5_
    Referenced from: /Users/martin/Library/R/3.2/library/rjags/libs/rjags.so
    Expected in: flat namespace
    in /Users/martin/Library/R/3.2/library/rjags/libs/rjags.so
    Error: loading failed
    Execution halted
    ERROR: loading failed

    • It looks like the rjags package is linking to the wrong version of JAGS. The missing symbol is in JAGS 4.0.0 and above but not in earlier versions. If you have an earlier version of JAGS anywhere then uninstall it. Also make sure you are installing version 4-6 of rjags. I put a lot of checks in the configure script to catch this problem.

      • Thank you for the reply, Martyn! Yes, versions should be good, 4.2.0 of jags (searched the system and didn’t find any left-over versions), rjags_4-6, R 3.2.4. Reinstalled jags, this time from source (r packages also from source). Got this:
        Warning: jags dependency gcc was built with a different C++ standard library (libstdc++ from clang). This may cause problems at runtime.

        Reinstalled gcc from source, reinstalled R and jags from source (all using homebrew — and still with above Warning). Trying to install rjags, I’m still getting the “Symbol not found” error. I’m puzzled. Please let me know if there’s anything I can do to help trouble-shoot this issue.

      • The warning tells you what the problem is: the rjags package and JAGS are linked to different implementations of the C++ standard library (libstdc++ and libc++). These are binary incompatible. In order to prevent sponetaneous crashes from cross linking, the authors of libc++ put all their functions inside a private namespace. This is why you are getting a missing symbol error.

        The compiler options are the same ones used when JAGS was built. So if you haven’t rebuilt R from source then you may be inheriting different options for the C++ compiler and its flags when you build the rjags package. So you can either go all the way and rebuild R from source, or you can revert to using the binaries provided by Matt, which are compatible:


        and of course use the Mavericks version of R from CRAN.

  3. I was also having the similar issue with below error :

    Warning: namespace ‘evaluate’ is not available and has been replaced by .GlobalEnv when processing object”
    1- Root Cause : package “evaluate” was not properly installed, so remove it and install again :

    remove.packages(“evaluate”, lib=”~/R/win-library/3.2″)

    2- so when I tried to load the package evaluate ,I started getting below error:

    library(“evaluate”, lib.loc=”~/R/win-library/3.2″) Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : there is no package called ‘stringi’ In addition: Warning message: package ‘evaluate’ was built under R version 3.2.5 Error: package or namespace load failed for ‘evaluate’
    3- I installed the package “stringi” again and problem was resolved. 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s