Menu

trouble installing runjags

runjags
Colin
2017-05-16
2017-05-16
  • Colin

    Colin - 2017-05-16

    Hello,

    I am trying to install the runjags package on a remote computer cluster. I am running R 3.4.0. I have JAGS 4.0.0 loaded, and can confirm that the rjags package will install and load. When I go to install the runjags package install.packages('runjags'), I get the following error:

    configure: error: "Cannot load JAGS library in /share/pkg/jags/4.0.0/install/lib64"

    I think part of the problem is that the directory /share/pkg/jags/4.0.0/install/lib64 does not exist in jags/4.0.0, but the directory /share/pkg/jags/4.0.0/install/lib, without the 64 does.

    Any ideas how I can get runjags up and running?

     
  • Matt Denwood

    Matt Denwood - 2017-05-22

    Hi Colin

    Thanks for your report. The runjags package is still using the same configure script as rjags 3.x, which assumes that the JAGS installation follows the same format as the R installation. However, there is a workaround for non-standard installs detailed in the README file within the runjags package:

    The configure script will try to guess the location of the JAGS
    library installation. It will look in /<prefix>/<lib>, where
    
    - <prefix> is the determined from the location of the jags
      script that launches the command line interface.
    
      For example, if this is "/usr/local/bin/jags", then prefix will
      be "/usr/local"
    
    - <lib> is derived from the value of "LIBnn", returned by 
      "R CMD config LIBnn".
    
      This is particularly important on 64-bit unix, where R is 
      installed by default in /usr/local/lib64 and LIBnn is "lib64"
    
    The configure script will also look for JAGS headers in
    /<prefix>/include/JAGS
    
    If the configure script fails to find the JAGS headers or library,
    you can set the environment variables JAGS_INCLUDE and JAGS_LIB
    to point to the correct directory.
    
    The header files for the module itself should be able to detect the
    version of JAGS installed on your system, but a JAGS_MAJOR_VERSION
    environmental variable can be set in case of problems which may be
    encountered with some versions of JAGS - e.g. JAGS 4-beta requires:
    
    export JAGS_MAJOR_VERSION=4
    R CMD install runjags...
    

    You have correctly observed that rjags version 4.x is more forgiving about installation paths as it tries to use pkg-config - I will update the configure script in the next version of runjags to do the same.

    Hope that helps,

    Matt

     
  • Colin

    Colin - 2017-05-22

    This helps, thanks so much Matt. I should have digged deeper in the runjags documentation. I was able to get runjags to install using the following:

    install.packages("runjags",configure.args = c("--with-jags-lib=/share/pkg/jags/4.0.0/install/lib"))

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.