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

Close

Diff of /README [599ce0] .. [c6d5fb] Maximize Restore

  Switch to unified view

a/README b/README
1
Installation instructions for the rjags package
2
-----------------------------------------------
3
1
The rjags package is an interface to the JAGS library.  In order to
4
The rjags package is an interface to the JAGS library.  In order to
2
build a binary package, or install from source, you must have a matching
5
build a binary package, or install from source, you must have a matching
3
installation of the JAGS library.
6
installation of the JAGS library.
4
7
5
Windows
8
1 Windows
6
-------
9
---------
7
10
8
At compile time, there is no way for Windows to guess where the JAGS
11
If you are installing the Windows binary rjags package, then R will
9
library is installed, so you must supply the location yourself using
12
consult the Windows registry to find the location of JAGS.
10
the make variable JAGS_ROOT, defining it in the file HOME/.R/Makevars.win
11
13
12
JAGS_ROOT=c:\Program Files\JAGS\JAGS-3.1.0
14
If you are compiling the rjags package from source then you must
15
supply the location of JAGS yourself using the make variable
16
JAGS_ROOT, defining it in the file HOME/.R/Makevars.win, e.g.
13
17
14
Unix
18
JAGS_ROOT=c:\Program Files\JAGS\JAGS-3.3.0
15
19
20
2 Unix/Linux
21
------------
16
22
17
The configure script will try to guess the location of the JAGS
23
The configure script will try to guess the location of the JAGS
18
library installation. It will look in /<prefix>/<lib>, where
24
library. It does this by querying the R and jags executables, so both
25
of these need to be on your PATH for automatic detection to work
26
properly.
19
27
20
 <prefix> is the determined from the location of the jags
28
Recall that most Linux distributions divide software into `user' and
21
  script that launches the command line interface.
29
`developer' versions, so if you are using a pre-built JAGS binary
30
package for your Linux distribution then remember to install the
31
developer version.
22
32
23
  For example, if this is "/usr/local/bin/jags", then prefix will
33
If you have installed JAGS in a non-standard place then you may need
24
  be "/usr/local"
34
to supply hints to the configure script.  This can be done by 
35
passing configure arguments or setting environment variables (see below).
25
36
26
 <lib> is derived from the value of "LIBnn", returned by 
37
The options/environment variables correspond to options that were
27
  "R CMD config LIBnn".
38
used when JAGS was installed. They are shown in the table below:
28
39
29
  This is particularly important on 64-bit unix, where R is 
40
JAGS configure  rjags configure        Environmnent     default
30
  installed by default in /usr/local/lib64 and LIBnn is "lib64"
41
option          option                 variable
42
--------------  ---------------        ------------     -------
43
--prefix        --with-jags-prefix     JAGS_PREFIX      /usr/local
44
--libdir        --with-jags-libdir     JAGS_LIBDIR      ${prefix}/${LIBnn}
45
--includedir    --with-jags-includedir JAGS_INCLUDEDIR  ${prefix}/include
31
46
32
The configure script will also look for JAGS headers in
47
By default LIBnn is the value returned by `R CMD config LIBnn`.
33
/<prefix>/include/JAGS
48
This can be overridden by setting the environment variable LIBnn.
34
49
35
If the configure script fails to find the JAGS headers or library,
50
2.1 Setting the prefix
36
you can set the environment variables JAGS_INCLUDE and JAGS_LIB
51
----------------------
37
to point to the correct directory.
38
52
39
Alternatively, you can use the configure options
53
By default, all JAGS files are installed in subdirectories of /usr/local.
54
This is the prefix of the installation, and it can be changed to any
55
value by supplying the --prefix argument when installing JAGS.
40
56
41
with-jags-include=/path/to/jags/headers 
57
- The jags script goes in ${prefix}/bin
42
                    (default /usr/local/include/JAGS)
58
- The jags executable launched by the script goes in ${prefix}/libexec
59
- The libraries go in ${prefix}/lib
60
- The modules go in ${prefix}/lib/JAGS
61
- The headers go in ${prefix}/include/JAGS
43
62
44
with-jags-lib=/path/to/jags/library
63
Suppose that when you installed JAGS, you used the configure argument
45
                (default /usr/local/[lib|lib64])
64
'--prefix=/opt' to install JAGS in the directory /opt instead of the
65
default /usr/local.  If /opt/bin is on your PATH then the configure
66
script should still automatically detect JAGS for you.  Otherwise, you
67
need to supply the configure argument '--with-jags-prefix=/opt' when
68
installing rjags.
46
69
47
These options are onto the rjags configure script with:
70
Alternatively you can set the environment variable JAGS_PREFIX
48
"R CMD INSTALL --configure-args='--with-jags...'
71
before building rjags:
49
72
50
Exceptionally, you may need to set the location of the JAGS modules.
73
export JAGS_PREFIX=/opt
51
But this will only be necessary if you reset moddir when installing
52
JAGS. This can be done by setting the environment variabel JAGS_MODULES
53
or by using the configure option
54
74
55
with-jags-modules=/path/to/jags/modules
75
2.2 Setting the library directory
56
                    (default /usr/local/[lib|lib64]/JAGS/modules-w.y.z)
76
---------------------------------
57
                     where w.y.z is the version number of JAGS
77
78
Suppose you are on a 64-bit system and installed the JAGS library in
79
/usr/local/lib64 instead of the default /usr/local/lib.  If R_HOME is
80
/usr/lib64/R then the configure script should automatically look in
81
the right place for the JAGS library.  Otherwise, you need to supply
82
the configure argument '--with-jags-libdir=/usr/local/lib64' when
83
installing rjags.
84
85
Alternatively you can set the environment variable JAGS_LIBDIR
86
before building rjags:
87
88
export JAGS_LIBDIR=/usr/local/lib64
89
90
If the library directory is in the right prefix, but just has a
91
different name (e.g. ${prefix}/lib64 or ${prefix}/lib32 instead of the
92
default ${prefix}/lib), then you can just set the environment variable
93
LIBnn.
94
95
export LIBnn=lib64
96
97
2.3 Setting the include directory
98
-----------------------------
99
100
It is unlikely that you will need to set the include directory, as
101
there is no good reason for changing the default. Nevertheless,
102
this option is included for completeness.
103
104
By default, the header files go into ${prefix}/include, in a
105
sub-directory JAGS. If you have put this subdirectory somewhere other
106
than ${prefix}/include by supplying the --includedir option to
107
configure when you built JAGS, then the corresponding option for rjags
108
is --with-jags-includedir.
109
110
Alternatively, you may set the environment variable JAGS_INCLUDEDIR.
58
111
59
112
113
2.4 Passing configure arguments
114
-------------------------------
60
115
116
Configure options for rjags are passed via the --configure-args
117
argument to R CMD INSTALL:
118
119
  R CMD INSTALL --configure-args='--with-jags...'
120
121
or, if you are using the install.packages() function from an R
122
session, using the configure.args argument:
123
124
  install.packages("rjags", configure.args="--with-jags...")
125
126
If configure arguments are set, they always override the corresponding
127
environment variables.
128
129
2.2 Failure to load 
130
-------------------
131
132
Even with the above options, the rjags package may compile and install
133
correctly, but then fail with the message "ERROR:loading failed".
134
135
On some systems it is possible to hard-code the location of the JAGS
136
library at compile time so that the linker knows where to look. This
137
can be done by adding the configure argument --enable-rpath, e.g.
138
139
R CMD INSTALL --configure-args="--prefix=/opt --enable-rpath" rjags
140
141
However, please note that this is not portable and may not work on
142
your system. In this case you need to set the environment variable
143
LD_LIBRARY_PATH to include the directory containing the jags libraries
144
before starting R, e.g
145
146
export LD_LIBRARY_PATH=/opt/lib:$LD_LIBRARY_PATH