Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 257 lines (185 sloc) 9.797 kB
fa44a2c Initial revision
r authored
1
2 INSTALLING R UNDER UNIX
3
4
5 GENERALITIES
6
df9bbcc information on getting and unpacking files
pd authored
7 This document concerns building and installing R from sources.
8 Pre-made binaries are made available for some systems with varying
9 regularity and can be obtained from CRAN (see the RESOURCES file).
10
c43f04d modify platform information
ripley authored
11 R will configure and build under a number of common Unix-like
b96c09c list of systems, comments on GNOME, typos
ripley authored
12 platforms (including i386-freebsd, i386-linux, ppc-linux,
13 mips-sgi-irix, alpha-linux, alpha-dec-osf4, rs6000-ibm-aix,
14 hppa-hp-hpux, sparc-linux, and sparc-sun-solaris) and on Windows 9x/NT
15 (see src/gnuwin32/readme). In general it is relatively easy to adapt
16 R to new platforms. See the section on new platforms for details.
8aa1433 GNOME dependencies etc
ripley authored
17
fa44a2c Initial revision
r authored
18
df9bbcc information on getting and unpacking files
pd authored
19 GETTING AND UNPACKING THE SOURCES
20
21 The simplest way is to download the most recent R-x.yy.z.tgz package,
e05c9c8 perl
maechler authored
22 and unpack them with
df9bbcc information on getting and unpacking files
pd authored
23
24 tar xvfz R-x.yy.z.tgz
25
26 on systems that have GNU tar installed. On other systems you need at
27 least to have the "gzip" program installed. Then you can do
28
b96c09c list of systems, comments on GNOME, typos
ripley authored
29 gzip -dc R-x.yy.z.tgz | tar xvf -
df9bbcc information on getting and unpacking files
pd authored
30
31 If you need to transport the sources on floppy disks, you can download the
32 R-x.yy.z.tgz-split.* files. and paste them together at the destination
33 with
34
35 cat R-x.yy.z.tgz-split.* > R-x.yy.z.tgz
36
37 and proceed as above.
38
39 Finally, for minor-minor releases (x.yy.z with z != 0), a patch
40 against the preceding release is made available in
41 R-x.yy.{z-1}-x.yy.z.diff.gz (e.g. R-0.63.2-0.63.3.diff.gz), which is
42 generally a much shorter file that the .tgz files. Such a file can be
43 applied to the sources of the previous version by changing to the top
44 directory of it and
45
46 gzip -dc /path/to/it/R-x.yy.{z-1}-x.yy.z.diff.gz | patch -E -p1
47
48 Notice that this does not necessarily work if the older sources have
49 been modified (e.g. by building in their directories).
fa44a2c Initial revision
r authored
50
8aa1433 GNOME dependencies etc
ripley authored
51
94e6a91 added make install
leisch authored
52 SIMPLE COMPILATION
fa44a2c Initial revision
r authored
53
da9f5c7 Explain that `make docs' requires Perl version 5 etc.
hornik authored
54 Choose a place to install the R tree (R is not just a binary, but has
55 additional data sets, help files, font metrics etc). Let's call this
56 place RHOME. Untar the source code. This should create directories
57 src, etc, cmd, help and doc. Issue the following commands:
fa44a2c Initial revision
r authored
58
59 ./configure
60 make
61
da9f5c7 Explain that `make docs' requires Perl version 5 etc.
hornik authored
62 If these commands execute successfully, the R binary will be copied to
63 the `$RHOME/bin' directory. In addition, a shell script font-end
64 called "R" will be created and copied to the same directory. You can
65 copy this script to a place where users can invoke it, for example to
66 `/usr/local/bin/R'. You could also copy the man page `R.1' to a place
94e6a91 added make install
leisch authored
67 where your man reader finds it, such as `/usr/local/man/man1'. If you
68 want to install the complete R tree to, e.g., /usr/local/lib/R, see
69 section INSTALLATION below.
fa44a2c Initial revision
r authored
70
ba6787e branch update
pd authored
71 You do not necessarily have to build R in the top-level source
e05c9c8 perl
maechler authored
72 directory (say, TOP_SRCDIR). To build in BUILDDIR, cd there and run
ba6787e branch update
pd authored
73
74 TOP_SRCDIR/configure
75 make
76
97ad1f7 branch update
pd authored
77 and so on, as described further below. This has the advantage of always
78 keeping your source tree `clean'. (You may need GNU make to allow this.)
ba6787e branch update
pd authored
79
f7f10e3 Explain configure command line options.
hornik authored
80 If you need or want to set certain configure variables to something
81 other than their default, you can do that by either editing the file
82 `config.site' or on the command line as
83
e05c9c8 perl
maechler authored
84 VAR="..." ./configure # Bourne shell compatibles
85 (setenv VAR "..."; ./configure) # C shell
f7f10e3 Explain configure command line options.
hornik authored
86
eff400b warning about papersize in INSTALL
thomas authored
87 One common variable to change is R_PAPERSIZE, which defaults to a4, not
88 letter.
89
e6183ff Improve as suggested by BDR.
hornik authored
90 If you have libraries and header files, e.g. for GNU readline, in
91 non-system directories, use the variables LIBS (for libraries) and
92 CPPFLAGS (for header files), respectively, to specify these locations.
93
fa5f983 mention removing config.cache
ripley authored
94 If you find you need to alter configure variables, it is worth noting
95 that some settings are cached in the file config.cache, and it is a
96 good idea to remove that file before re-configuring.
97
94e6a91 added make install
leisch authored
98 Make will also build plain text help pages as well as HTML and LaTeX
99 versions of the documentation (the three kinds can also be generated
e05c9c8 perl
maechler authored
100 separately using make help, make html and make latex). Note that you need
b488b14 .
maechler authored
101 Perl version 5, available via http://www.perl.com/CPAN/, to build the
e05c9c8 perl
maechler authored
102 documentation.
94e6a91 added make install
leisch authored
103 If this is not available on your system, you can obtain precompiled
104 documentation files via the `doc/pre-formatted-help' directory of the
105 Comprehensive R Archive Network (CRAN), see the file `RESOURCES' for
106 information on CRAN.
fa44a2c Initial revision
r authored
107
e6183ff Improve as suggested by BDR.
hornik authored
108 Now rehash if necessary, type `R' and reach for your S manuals ...
109 And, read the R FAQ (http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html).
fa44a2c Initial revision
r authored
110
8aa1433 GNOME dependencies etc
ripley authored
111 The GNOME interface for R will only be built if you specify it:
112 see the GNOME section below.
6e97328 Added information on compiling the GNOME interface
lyndon authored
113
fa44a2c Initial revision
r authored
114
94e6a91 added make install
leisch authored
115 INSTALLATION
116
117 After
785c495 Updated.
hornik authored
118
94e6a91 added make install
leisch authored
119 ./configure
120 make
785c495 Updated.
hornik authored
121
94e6a91 added make install
leisch authored
122 have been completed successfully, you can install the complete R tree
123 to your system by typing
124
125 make install
126
127 This will install to the following directories:
128
785c495 Updated.
hornik authored
129 $prefix/bin (some) executables
94e6a91 added make install
leisch authored
130 $prefix/man/man1 man pages
862b8cb Mention looking at LD_LIBRARY_PATH.
hornik authored
131 $prefix/lib/R all the rest (libraries, online help
94e6a91 added make install
leisch authored
132 system, ...)
133
134 where prefix is determined during configuration (typically /usr/local)
135 and can be set by running configure with the option
136
137 ./configure --prefix=/where/you/want/R/to/go
138
862b8cb Mention looking at LD_LIBRARY_PATH.
hornik authored
139 Then the R executable will be installed in /where/you/want/R/to/go/bin,
140 and so on. The prefix of the installation directories can also be seen
141 in the status message that is displayed at the end of configure.
fa44a2c Initial revision
r authored
142
143
aa7eb80 branch update
pd authored
144 USING MAKE
145
e05c9c8 perl
maechler authored
146 To compile R, you currently most likely need GNU make. (To be more
aa7eb80 branch update
pd authored
147 precise, you need a version of make which accepts shell wildcards in
f69f528 update front matter, including CRAN addresses
ripley authored
148 dependencies.) On Solaris 2.6/7 in particular, you need a version of
149 GNU make different from 3.77; 3.78.x and 3.76.1 work fine, as
97ad1f7 branch update
pd authored
150 does the Sun make. To build in a separate directory you need a make
151 than uses the VPATH variable: GNU make does but e.g. Sun make does
152 not.
aa7eb80 branch update
pd authored
153
154
fa44a2c Initial revision
r authored
155 USING FORTRAN
156
f7f10e3 Explain configure command line options.
hornik authored
157 To compile R, you need a FORTRAN compiler or f2c, the FORTRAN-to-C
8d2e6b4 Last minute release changes:
pd authored
158 converter. The default is to search for f77, g77, fort77, f90, xlf,
fae2d08 Also look for fort77.
hornik authored
159 cf77, and fc (in that order), and then for f2c, and use whichever is
160 found first; if none is found, R cannot be compiled. The search
161 mechanism can be changed using the `--with-g77', `--with-f77', and
e05c9c8 perl
maechler authored
162 `--with-f2c' command line options to configure. If your FORTRAN
785c495 Updated.
hornik authored
163 compiler is in a non-standard location, you should set the enviroment
862b8cb Mention looking at LD_LIBRARY_PATH.
hornik authored
164 variable PATH accordingly before running configure.
165
166 If your FORTRAN libraries are in slightly peculiar places, you should
167 also look at LD_LIBRARY_PATH to make sure that all libraries are on this
168 path.
fa44a2c Initial revision
r authored
169
c7b5dc4 branch update - not bugfree
pd authored
170 You must set whatever compilation flags (if any) are needed to ensure
171 that FORTRAN `integer' is equivalent to a C int pointer and FORTRAN
172 `double precision' is equivalent to a C double pointer. (Beware of
173 f2c and compilers whose integer type is by default equivalent to C
174 long on platforms where long != int.)
175
fa44a2c Initial revision
r authored
176
8aa1433 GNOME dependencies etc
ripley authored
177 BUILDING THE GNOME INTERFACE
178
13d4d93 Minor update to INSTALL for GNOME info
lyndon authored
179 This interface is experimental and currently incomplete. For more
180 information on the GNOME interface and upcoming features, see
181 http://stat.auckland.ac.nz/~lyndon/roadmap.html.
b96c09c list of systems, comments on GNOME, typos
ripley authored
182
8aa1433 GNOME dependencies etc
ripley authored
183 The GNOME interface for R will only be built if you specify it by
184 running configure with the --with-gnome option. For example, you
185 might run
186
187 ./configure --with-gnome
188
189 but please check you have all the requirements first. It is advisable to
190 have reasonably-up-to-date versions of the gnome and gtk+ libraries
191 (later than those in RedHat 6.0, for example). You can find the
192 versions you have by
193
194 gnome-config --version
195 gtk-config --version
196
b96c09c list of systems, comments on GNOME, typos
ripley authored
197 We know 1.0.10 and 1.2.3 suffice. Updates are available, for example
17455e4 put back updates.redhat.com
ripley authored
198 from updates.redhat.com or ftp.gurulabs.com/pub/gnome/updates for
199 RPM-based systems. You need the following RPMs and their dependencies
200 installed:
8aa1433 GNOME dependencies etc
ripley authored
201
202 gnome-libs
203 gnome-libs-devel
204 gtk+
205 gtk+-devel
24ccf97 Modified GNOME install info
lyndon authored
206 glib
207 glib-devel
8aa1433 GNOME dependencies etc
ripley authored
208
f7e2276 Clarify libglade requirements
ripley authored
209 You will need also libglade 0.5 or later for correct behaviour. For
210 more information on libglade and to download the source, see
f69f528 update front matter, including CRAN addresses
ripley authored
211 http://www.daa.com.au/~james/gnome/. The sources are also available
212 from the GNOME ftp site (ftp.gnome.org and mirrors). RPMs are in
213 RedHat 6.1 and are available from rawhide.redhat.com.
214
215 libglade needs libxml 1.4 or later, the source for which is available
216 from the GNOME ftp site (ftp.gnome.org and mirrors). RPMs of
217 libxml-1.4 and libxml-devel-1.4 are available from updates.redhat.com
218 and mirrors, or ftp.gurulabs.com/pub/gnome/updates.
8aa1433 GNOME dependencies etc
ripley authored
219
220
fa44a2c Initial revision
r authored
221 NEW PLATFORMS (Standards Hah!)
222
223 There are a number of sources of problems when installing R on a new
18ec53d syncs from patch branch
pd authored
224 hardware/os platform.
fa44a2c Initial revision
r authored
225
226 1. Floating Point Arithmetic: R supports the POSIX, SVID and IEEE
227 models for floating point arithmetic. The POSIX and SVID models
e05c9c8 perl
maechler authored
228 provide no problems. The IEEE model however can be a pain. The
fa44a2c Initial revision
r authored
229 problem is that there is no agreement on how to set the signalling
230 behavior; sgi/irix and linux require no special action, freebsd
231 requires a call to (the macro) fpsetmask(0) and osf1v3.2 requires
232 that computation be done with a -ieee_with_inexact flag etc...
233 On a new platform you must find out the magic recipe and add some
234 code to make it work. This can often be done via the file
235 config.site which resides in the top level directory.
236
237 2. Shared Libraries: There seems to be very little agreement across
238 platforms on what needs to be done to build shared libraries.
239 there are many different combinations of flags for the compilers
240 and loaders. The technique we use is to interrogate the X window
241 system about what it does (using xmkmf). This often works, but
242 you may have to manually override the results. Scanning the cc(1)
243 and ld(1) manual entries usually reveals the correct incantation.
244 Once you know the recipe you can modify the file config.site
245 (following the instructions therein) so that the build will use
246 these options.
247
248 If you do manage to get R running on a new platform please let us know
249 about it so we can modify the configuration procedures to include that
250 platform.
251
252 If you are having trouble getting R to work on your platform please
253 feel free to get in touch to ask questions. We've had a fair amount
254 of practice at porting R to new platforms...
255
3ade498 Updates
ihaka authored
256 R Core Members
Something went wrong with that request. Please try again.