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

Tree [0f7a81] default /
History



File Date Author Commit
R 2013-10-16 martyn martyn [0f7a81] Added license headers from release branch
data 2010-09-22 martyn_plummer martyn_plummer [fda875] - Tidied up R interface code in jags.cc after f...
man 2012-05-15 martyn martyn [d8c018] Updated documentation for list.samplers()
src 2013-10-16 martyn martyn [0f7a81] Added license headers from release branch
.hgtags 2011-01-05 convert-repo convert-repo [4054d4] update tags
DESCRIPTION 2013-10-16 martyn martyn [0f7a81] Added license headers from release branch
NAMESPACE 2011-09-03 martyn martyn [858cf4] Added parallel.seeds function
README 2013-10-16 martyn martyn [0f7a81] Added license headers from release branch
aclocal.m4 2007-12-18 martyn_plummer martyn_plummer [26b00e] Bump to 1.0.1
cleanup 2008-03-18 martyn_plummer martyn_plummer [7f6cf1] Drop pkg-config dependency. Script now guesses ...
configure 2013-10-16 martyn martyn [0f7a81] Added license headers from release branch
configure.ac 2013-10-16 martyn martyn [0f7a81] Added license headers from release branch
configure.win 2010-05-17 martyn_plummer martyn_plummer [0baf7d] Update Windows configuration.

Read Me

Installation instructions for the rjags package
-----------------------------------------------

The rjags package is an interface to the JAGS library.  In order to
build a binary package, or install from source, you must have a matching
installation of the JAGS library.

1 Windows
---------

If you are installing the Windows binary rjags package, then R will
consult the Windows registry to find the location of JAGS.

If you are compiling the rjags package from source then you must
supply the location of JAGS yourself using the make variable
JAGS_ROOT, defining it in the file HOME/.R/Makevars.win, e.g.

JAGS_ROOT=c:\Program Files\JAGS\JAGS-3.3.0

2 Unix/Linux
------------

The configure script will try to guess the location of the JAGS
library. It does this by querying the R and jags executables, so both
of these need to be on your PATH for automatic detection to work
properly.

Recall that most Linux distributions divide software into `user' and
`developer' versions, so if you are using a pre-built JAGS binary
package for your Linux distribution then remember to install the
developer version.

If you have installed JAGS in a non-standard place then you may need
to supply hints to the configure script.  This can be done by 
passing configure arguments or setting environment variables (see below).

The options/environment variables correspond to options that were
used when JAGS was installed. They are shown in the table below:

JAGS configure  rjags configure        Environmnent     default
option          option                 variable
--------------  ---------------        ------------     -------
--prefix        --with-jags-prefix     JAGS_PREFIX      /usr/local
--libdir        --with-jags-libdir     JAGS_LIBDIR      ${prefix}/${LIBnn}
--includedir    --with-jags-includedir JAGS_INCLUDEDIR  ${prefix}/include

By default LIBnn is the value returned by `R CMD config LIBnn`.
This can be overridden by setting the environment variable LIBnn.

2.1 Setting the prefix
----------------------

By default, all JAGS files are installed in subdirectories of /usr/local.
This is the prefix of the installation, and it can be changed to any
value by supplying the --prefix argument when installing JAGS.

- The jags script goes in ${prefix}/bin
- The jags executable launched by the script goes in ${prefix}/libexec
- The libraries go in ${prefix}/lib
- The modules go in ${prefix}/lib/JAGS
- The headers go in ${prefix}/include/JAGS

Suppose that when you installed JAGS, you used the configure argument
'--prefix=/opt' to install JAGS in the directory /opt instead of the
default /usr/local.  If /opt/bin is on your PATH then the configure
script should still automatically detect JAGS for you.  Otherwise, you
need to supply the configure argument '--with-jags-prefix=/opt' when
installing rjags.

Alternatively you can set the environment variable JAGS_PREFIX
before building rjags:

export JAGS_PREFIX=/opt

2.2 Setting the library directory
---------------------------------

Suppose you are on a 64-bit system and installed the JAGS library in
/usr/local/lib64 instead of the default /usr/local/lib.  If R_HOME is
/usr/lib64/R then the configure script should automatically look in
the right place for the JAGS library.  Otherwise, you need to supply
the configure argument '--with-jags-libdir=/usr/local/lib64' when
installing rjags.

Alternatively you can set the environment variable JAGS_LIBDIR
before building rjags:

export JAGS_LIBDIR=/usr/local/lib64

If the library directory is in the right prefix, but just has a
different name (e.g. ${prefix}/lib64 or ${prefix}/lib32 instead of the
default ${prefix}/lib), then you can just set the environment variable
LIBnn.

export LIBnn=lib64

2.3 Setting the include directory
-----------------------------

It is unlikely that you will need to set the include directory, as
there is no good reason for changing the default. Nevertheless,
this option is included for completeness.

By default, the header files go into ${prefix}/include, in a
sub-directory JAGS. If you have put this subdirectory somewhere other
than ${prefix}/include by supplying the --includedir option to
configure when you built JAGS, then the corresponding option for rjags
is --with-jags-includedir.

Alternatively, you may set the environment variable JAGS_INCLUDEDIR.


2.4 Passing configure arguments
-------------------------------

Configure options for rjags are passed via the --configure-args
argument to R CMD INSTALL:

  R CMD INSTALL --configure-args='--with-jags...'

or, if you are using the install.packages() function from an R
session, using the configure.args argument:

  install.packages("rjags", configure.args="--with-jags...")

If configure arguments are set, they always override the corresponding
environment variables.

2.2 Failure to load 
-------------------

Even with the above options, the rjags package may compile and install
correctly, but then fail with the message "ERROR:loading failed".

On some systems it is possible to hard-code the location of the JAGS
library at compile time so that the linker knows where to look. This
can be done by adding the configure argument --enable-rpath, e.g.

R CMD INSTALL --configure-args="--prefix=/opt --enable-rpath" rjags

However, please note that this is not portable and may not work on
your system. In this case you need to set the environment variable
LD_LIBRARY_PATH to include the directory containing the jags libraries
before starting R, e.g

export LD_LIBRARY_PATH=/opt/lib:$LD_LIBRARY_PATH