Skip to content

HTTPS clone URL

Subversion checkout URL

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