Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

installing JAGS and rjags as non-superuser

Help
Ege
2010-11-24
2012-09-01
  • Ege
    Ege
    2010-11-24

    Hi,

    I really need some help installing a working JAGS and rjags in my home dir
    without superuser rights.

    I'm running Ubuntu 10.04 Lucid Lynx and R 2.11.1 at work without superuser
    rights.

    I have successfully installed JAGS 2.2.0 from source into a directory called
    ~/jags/i486 by using the prefix option in ./configure

    After some trial-and-error I managed to install rjags by issuing the following
    commands in R:

    Sys.setenv(JAGS_INCLUDE="~/jags/i486/include/JAGS")
    Sys.setenv(JAGS_LIB="~/jags/i486/lib")
    ldpath <- paste(Sys.getenv("LD_LIBRARY_PATH"), ":~/jags/i486/lib", sep="")
    Sys.setenv(LD_LIBRARY_PATH=ldpath)
    install.packages("rjags")
    

    (Actually I did the commands with the absolute path rather than ~).

    However when I try to load rjags I get one of the following two errors (it has
    changed after I tried different versions of JAGS and rjags):

    > library(rjags)
    Error in get(hookname, envir = env, inherits = FALSE) : 
      internal error -3 in R_decompress1
    Error: package/namespace load failed for 'rjags'
    
    > library(rjags)
    Error : .onLoad failed in loadNamespace() for 'rjags', details:
      call: dyn.load(file, DLLpath = DLLpath, ...)
      error: unable to load shared library '~/R/i486-pc-linux-gnu-library/2.11/rjags/libs/rjags.so':
      libjags.so.2: cannot open shared object file: No such file or directory
    Error: package/namespace load failed for 'rjags'
    

    I both cases the problem is probably related to this output from the CLI:

    ~> ldd ~/R/i486-pc-linux-gnu-library/2.11/rjags/libs/rjags.so 
        linux-gate.so.1 =>  (0x0073d000)
        libjags.so.2 => not found
        libR.so => /usr/lib/libR.so (0x00308000)
    

    I read something about trying to use ldconfig somewhere online, but I have no
    knowledge of this tool at all and it seems to require superuser rights (all
    this would indeed be easier with the power of sudo).

    Any ideas what to do?

    Cheers,

    Ege

     
  • Martyn Plummer
    Martyn Plummer
    2010-11-25

    I don't think that changin LD_LIBRARY_PATH within an R session will actually
    change the behaviour of the linker. Try setting it before you launch R.

     
  • Ege
    Ege
    2010-12-01

    Thank you for the quick reply. I ended up being away from the office for some
    days, so haven't tested it before now. I can confirm setting LD_LIBRARY_PATH
    in the terminal works like a charm. For a reference for people searching help
    on this the command in BASH is:

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"~/jags/i486/lib"