Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Trouble installing rjags 2.0.0-2

Help
Louis
2010-05-08
2012-09-01
  • Louis
    Louis
    2010-05-08

    I am having trouble installing rjags 2.0.0-2 on Ubuntu (Linux). I noticed
    through searching on the internet (in particular finding entries on Roger
    Levy's and Yu-Sung Su's blogs) that there have been a couple rounds of the
    same problem with past versions (1.x.x.) of rjags , but I cannot tell if there
    was a general solution that are still working in the 2.x.x version.

    For rjags I followed the advice on Rogblog
    <http://quote.ucsd.edu/blogs/rogblog/2008/11/09/installing-rjags-on-64-bit-
    debian-etch/
    > when he had this problem in rjags 1.0.3-4 I used

    sudo R --with-jags-modules=/usr/local/lib/JAGS/modules-2.0.0/ CMD INSTALL
    rjags_2.0.0-2.tar.gz

    Then, when I try to load the library I get:

    library(rjags)

    Loading required package: coda

    Loading required package: lattice

    Error in dyn.load(file, DLLpath = DLLpath, ...) :

    unable to load shared library '/home/lluang/R/i486-pc-linux-gnu-
    library/2.10/rjags/libs/rjags.so':

    libjags.so.2: cannot open shared object file: No such file or directory

    Error : .onLoad failed in 'loadNamespace' for 'rjags'

    Error: package/namespace load failed for 'rjags'

    Help on what I could try next would be appreciated.

    /r

    Louis

    =====

    Configuration:

    I installed JAGS 2.0.0 (20100430) using:

    ./configure

    make

    sudo make install

    make installcheck

    I confirmed installation by running the classic-bugs volume 1 examples.

    Inside my config.log from when I installed JAGS-2.0.0-20100430 the following
    locations are defined

    exec_prefix='${prefix}'

    prefix='/usr/local'

    jagsmoddir='${exec_prefix}/lib/JAGS/modules-2.0.0'

    libdir='${exec_prefix}/lib

    libjags.so.2 is a symbolic link in my /usr/local/lib directory that points to
    libjags.so.2.0.0 which is also in my /usr/local/lib directory

     
  • Martyn Plummer
    Martyn Plummer
    2010-05-08

    Is /usr/local/lib on your default linker path? It might not be. Check with

    ldd  /home/lluang/R/i486-pc-linux-gnu-library/2.10/rjags/libs/rjags.so
    

    The two solutions are:

    a) Set LD_LIBRARY_PATH to include the location of the jags library, or

    b) Set the default linker path, usually by editing /etc/ld.so.conf or adding a
    suitable include file to /etc/ld.so.conf.d

    The option --with-jags-modules is doing nothing as you are setting it to the
    default directory. You can drop it.

     
  • Louis
    Louis
    2010-05-10

    Yes, adding /usr/local/lib in the /etc/ld.so.conf file seems to work. I ran
    make Rcheck as well to confirm. Thank you.