Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 365 lines (259 sloc) 13.494 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
52d996e According to Michael Wang <mwang@mindspring.com>, also works on
hornik authored
11 R will configure and build under a number of common Unix-like platforms
12 (including i386-freebsd, i386-linux, i386-sun-solaris, ppc-linux,
0f96547 add comments on setting MAKE, Windows 2000
ripley authored
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
52d996e According to Michael Wang <mwang@mindspring.com>, also works on
hornik authored
16 easy to adapt R to new platforms. See the section on new platforms for
17 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
af697e5 Cosmetics.
hornik authored
22 The simplest way is to download the most recent `R-x.y.z.tgz' package,
23 and 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
af697e5 Cosmetics.
hornik 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
af697e5 Cosmetics.
hornik authored
33 the `R-x.y.z.tgz-split.*' files and paste them together at the
34 destination with
df9bbcc information on getting and unpacking files
pd authored
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
67644f7 This commit was manufactured by cvs2svn to create tag
(no author) authored
38 and proceed as above. If you want the build to be usable by a group
39 of users, set umask before unpacking so that the files will be
40 readable by the target group (e.g. umask 022 to be usable by all
41 users).
df9bbcc information on getting and unpacking files
pd authored
42
f9f3206 Add info on compilation/installation of DVI, info and PDF manuals.
hornik authored
43 Finally, for minor-minor releases (x.y.z with z != 0), a patch against
af697e5 Cosmetics.
hornik authored
44 the preceding release is made available in `R-x.y.{z-1}-x.y.z.diff.gz'
f9f3206 Add info on compilation/installation of DVI, info and PDF manuals.
hornik authored
45 (e.g., R-0.63.2-0.63.3.diff.gz), which is generally a much shorter file
af697e5 Cosmetics.
hornik authored
46 that the `.tgz' files. Such a file can be applied to the sources of the
f9f3206 Add info on compilation/installation of DVI, info and PDF manuals.
hornik authored
47 previous version by changing to the top directory of it and
df9bbcc information on getting and unpacking files
pd authored
48
f9f3206 Add info on compilation/installation of DVI, info and PDF manuals.
hornik authored
49 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
50
799c96c documentation updates
ripley authored
51 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
52 been modified (e.g., by building in their directories).
fa44a2c Initial revision
r authored
53
8aa1433 GNOME dependencies etc
ripley authored
54
94e6a91 added make install
leisch authored
55 SIMPLE COMPILATION
fa44a2c Initial revision
r authored
56
da9f5c7 Explain that `make docs' requires Perl version 5 etc.
hornik authored
57 Choose a place to install the R tree (R is not just a binary, but has
58 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
59 place R_HOME. Untar the source code. This should create directories
60 src, doc, and several more. Issue the following commands:
fa44a2c Initial revision
r authored
61
62 ./configure
63 make
64
0f96547 add comments on setting MAKE, Windows 2000
ripley authored
65 (See USING MAKE below if your make is not called `make'.)
66
67644f7 This commit was manufactured by cvs2svn to create tag
(no author) authored
67 Then check the built system worked correctly, by
68
69 make check
70
71 Failures are not necessarily problems as they might be caused by missing
72 functionality, but you should look carefully at any reported discrepancies.
73
da9f5c7 Explain that `make docs' requires Perl version 5 etc.
hornik authored
74 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
75 the `${R_HOME}/bin' directory. In addition, a shell script front-end
da9f5c7 Explain that `make docs' requires Perl version 5 etc.
hornik authored
76 called "R" will be created and copied to the same directory. You can
77 copy this script to a place where users can invoke it, for example to
78 `/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
79 where your man reader finds it, such as `/usr/local/man/man1'. If you
23708c3 R_HOME currently is ${prefix}/lib/R.
hornik authored
80 want to install the complete R tree to, e.g., `/usr/local/lib/R', see
94e6a91 added make install
leisch authored
81 section INSTALLATION below.
fa44a2c Initial revision
r authored
82
f9f3206 Add info on compilation/installation of DVI, info and PDF manuals.
hornik authored
83 You do not necessarily have to build R in the top-level source directory
84 (say, TOP_SRCDIR). To build in BUILDDIR, cd there and run
ba6787e branch update
pd authored
85
86 TOP_SRCDIR/configure
87 make
88
97ad1f7 branch update
pd authored
89 and so on, as described further below. This has the advantage of always
af697e5 Cosmetics.
hornik authored
90 keeping your source tree ``clean''. (You may need GNU make to allow
f9f3206 Add info on compilation/installation of DVI, info and PDF manuals.
hornik authored
91 this.)
ba6787e branch update
pd authored
92
f7f10e3 Explain configure command line options.
hornik authored
93 If you need or want to set certain configure variables to something
94 other than their default, you can do that by either editing the file
b5bd200 explicitly say env vars are documented in config.site
ripley authored
95 `config.site' (which documents all the variables you might want to set)
96 or on the command line as
f7f10e3 Explain configure command line options.
hornik authored
97
e05c9c8 perl
maechler authored
98 VAR="..." ./configure # Bourne shell compatibles
99 (setenv VAR "..."; ./configure) # C shell
f7f10e3 Explain configure command line options.
hornik authored
100
eff400b warning about papersize in INSTALL
thomas authored
101 One common variable to change is R_PAPERSIZE, which defaults to a4, not
102 letter.
103
f9f3206 Add info on compilation/installation of DVI, info and PDF manuals.
hornik authored
104 If you have libraries and header files, e.g., for GNU readline, in
e6183ff Improve as suggested by BDR.
hornik authored
105 non-system directories, use the variables LIBS (for libraries) and
106 CPPFLAGS (for header files), respectively, to specify these locations.
af697e5 Cosmetics.
hornik authored
107 These default to `/usr/local/lib' and `/usr/local/include' to catch the
0f68cd2 Mention problem of linker not re-ordering -L/-l flags.
hornik authored
108 most common cases. If libraries are still not found, then maybe your
109 compiler/linker does not support re-ordering of `-L' and `-l' flags
110 (this has been reported to be a problem on HP-UX with native cc). In
111 this case, use a different compiler (or a front end shell script which
112 does the re-ordering).
e6183ff Improve as suggested by BDR.
hornik authored
113
fa5f983 mention removing config.cache
ripley authored
114 If you find you need to alter configure variables, it is worth noting
799c96c documentation updates
ripley authored
115 that some settings are cached in the file `config.cache', and it is a
fa5f983 mention removing config.cache
ripley authored
116 good idea to remove that file before re-configuring.
117
94e6a91 added make install
leisch authored
118 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
119 versions of the R object documentation (the three kinds can also be
af697e5 Cosmetics.
hornik authored
120 generated separately using `make help', `make html' and `make latex').
121 Note that you need Perl version 5, available via
122 http://www.perl.com/CPAN/, to build this documentation. If this is not
123 available on your system, you can obtain PDF versions of the
124 documentation files via the Comprehensive R Archive Network (CRAN), see
125 the file `RESOURCES' for information on CRAN.
f9f3206 Add info on compilation/installation of DVI, info and PDF manuals.
hornik authored
126
127 Now rehash if necessary, type `R', and read the R manuals and the R FAQ
af697e5 Cosmetics.
hornik authored
128 (files `FAQ' or `doc/html/faq.html' or the latest version at
799c96c documentation updates
ripley authored
129 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
130
131 The GNOME interface for R will only be built if you specify it: see the
132 GNOME section below.
6e97328 Added information on compiling the GNOME interface
lyndon authored
133
fa44a2c Initial revision
r authored
134
799c96c documentation updates
ripley authored
135 MAKING THE MANUALS
136
137 There is a set of manuals that can be built from the sources,
138
139 refman Printed versions of all the help pages.
67644f7 This commit was manufactured by cvs2svn to create tag
(no author) authored
140 R-FAQ R FAQ (which is already built for you).
af697e5 Cosmetics.
hornik authored
141 R-intro ``An Introduction to R''.
67644f7 This commit was manufactured by cvs2svn to create tag
(no author) authored
142 R-data ``R Data Import/Export''.
af697e5 Cosmetics.
hornik authored
143 R-exts ``Writing R Extensions''.
67644f7 This commit was manufactured by cvs2svn to create tag
(no author) authored
144 R-lang ``The R Language Definition''.
799c96c documentation updates
ripley authored
145
146 To make these, cd to the `doc/manual' directory and use
147
148 make dvi to create DVI versions
149 make pdf to create PDF versions
150 make info to create info files (not refman)
151
152 You will not be able to build the info files unless you have makeinfo
af697e5 Cosmetics.
hornik authored
153 version 4 or later installed (and some Linux distributions have 3.12).
799c96c documentation updates
ripley authored
154
fa60ce8 Cosmetics
hornik authored
155 The DVI versions can be previewed and printed using standard programs
799c96c documentation updates
ripley authored
156 such as `xdvi' and `dvips'. The PDF versions can be viewed using
157 Acrobat Reader or (recent versions of) ghostscript: they have
158 hyperlinks that can be followed in Acrobat Reader. The info files are
159 suitable for reading online with Emacs or the standalone GNU Info.
160
161
94e6a91 added make install
leisch authored
162 INSTALLATION
163
164 After
785c495 Updated.
hornik authored
165
94e6a91 added make install
leisch authored
166 ./configure
167 make
67644f7 This commit was manufactured by cvs2svn to create tag
(no author) authored
168 make check
785c495 Updated.
hornik authored
169
94e6a91 added make install
leisch authored
170 have been completed successfully, you can install the complete R tree
171 to your system by typing
172
173 make install
174
175 This will install to the following directories:
176
f9f3206 Add info on compilation/installation of DVI, info and PDF manuals.
hornik authored
177 ${prefix}/bin the front-end shell script
178 ${prefix}/man/man1 the man page
23708c3 R_HOME currently is ${prefix}/lib/R.
hornik authored
179 ${prefix}/lib/R all the rest (libraries, on-line help
94e6a91 added make install
leisch authored
180 system, ...)
181
f9f3206 Add info on compilation/installation of DVI, info and PDF manuals.
hornik authored
182 where prefix is determined during configuration (typically `/usr/local')
94e6a91 added make install
leisch authored
183 and can be set by running configure with the option
184
185 ./configure --prefix=/where/you/want/R/to/go
186
f9f3206 Add info on compilation/installation of DVI, info and PDF manuals.
hornik authored
187 This installs the R executable to `/where/you/want/R/to/go/bin', and so
188 on. The prefix of the installation directories can also be seen in the
9c94ec4 mention how to install other than in prefix.
ripley authored
189 status message that is displayed at the end of configure. You can
190 install into another directory by using
191
192 make prefix=/path/to/here install
f9f3206 Add info on compilation/installation of DVI, info and PDF manuals.
hornik authored
193
67644f7 This commit was manufactured by cvs2svn to create tag
(no author) authored
194 To install DVI, info and PDF versions of the manuals, use one or more of
195
196 make install-dvi
197 make install-info
198 make install-pdf
199
200 To ensure that the installed tree is usable by the right group of
201 users, set umask appropriately (perhaps to 022) before unpacking the
202 sources and throughout the build process.
fa44a2c Initial revision
r authored
203
204
aa7eb80 branch update
pd authored
205 USING MAKE
206
af697e5 Cosmetics.
hornik authored
207 To compile R, you will most likely find it easiest to use GNU make. On
67644f7 This commit was manufactured by cvs2svn to create tag
(no author) authored
208 Solaris 2.6/7/8 in particular, you need a version of GNU make different
af697e5 Cosmetics.
hornik authored
209 from 3.77; 3.79 works fine, as does the Sun make.
31eef2a clarify make requirements
ripley authored
210
211 To build in a separate directory you need a make that uses the VPATH
67644f7 This commit was manufactured by cvs2svn to create tag
(no author) authored
212 variable, for example GNU make, or Sun make on Solaris 2.7/8 (but not
af697e5 Cosmetics.
hornik authored
213 earlier).
aa7eb80 branch update
pd authored
214
0f96547 add comments on setting MAKE, Windows 2000
ripley authored
215 If you want to use a make by another name, for example if your GNU make
216 is called `gmake', you need to set MAKE at configure time, for example
217
e7553a1 Update.
hornik authored
218 MAKE=gmake ./configure (sh, bash)
219 env MAKE=gmake ./configure (csh)
0f96547 add comments on setting MAKE, Windows 2000
ripley authored
220
221
fa44a2c Initial revision
r authored
222 USING FORTRAN
223
f7f10e3 Explain configure command line options.
hornik authored
224 To compile R, you need a FORTRAN compiler or f2c, the FORTRAN-to-C
67644f7 This commit was manufactured by cvs2svn to create tag
(no author) authored
225 converter. The default is to search for g77, f77, xlf, cf77, cft77,
226 pgf77, fl32, af77, fort77, f90, xlf90, pgf90, epcf90, f95, xlf95, lf95,
227 g95, and fc (in that order), and then for f2c, and use whichever is
fae2d08 Also look for fort77.
hornik authored
228 found first; if none is found, R cannot be compiled. The search
229 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
230 `--with-f2c' command line options to configure. If your FORTRAN
785c495 Updated.
hornik authored
231 compiler is in a non-standard location, you should set the enviroment
862b8cb Mention looking at LD_LIBRARY_PATH.
hornik authored
232 variable PATH accordingly before running configure.
233
234 If your FORTRAN libraries are in slightly peculiar places, you should
235 also look at LD_LIBRARY_PATH to make sure that all libraries are on this
236 path.
fa44a2c Initial revision
r authored
237
c7b5dc4 branch update - not bugfree
pd authored
238 You must set whatever compilation flags (if any) are needed to ensure
239 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
240 `double precision' is equivalent to a C double pointer. This is checked
31eef2a clarify make requirements
ripley authored
241 during the configuration process.
c7b5dc4 branch update - not bugfree
pd authored
242
fa44a2c Initial revision
r authored
243
8aa1433 GNOME dependencies etc
ripley authored
244 BUILDING THE GNOME INTERFACE
245
c428673 update GNOME details
ripley authored
246 This interface is experimental, incomplete and not currently being
af697e5 Cosmetics.
hornik authored
247 developed. It provides a console and a graphics device (gtk(); the x11()
c428673 update GNOME details
ripley authored
248 device can also be used). Many of the `features' of the console are
249 currently stubs.
b96c09c list of systems, comments on GNOME, typos
ripley authored
250
8aa1433 GNOME dependencies etc
ripley authored
251 The GNOME interface for R will only be built if you specify it by
af697e5 Cosmetics.
hornik authored
252 running configure with the `--with-gnome' option. For example, you
253 might run
8aa1433 GNOME dependencies etc
ripley authored
254
255 ./configure --with-gnome
256
f9f3206 Add info on compilation/installation of DVI, info and PDF manuals.
hornik authored
257 but please check you have all the requirements first. It is advisable
258 to have reasonably-up-to-date versions of the gnome and gtk+ libraries
259 (later than those in RedHat 6.0, for example). You can find the
8aa1433 GNOME dependencies etc
ripley authored
260 versions you have by
261
262 gnome-config --version
263 gtk-config --version
264
c428673 update GNOME details
ripley authored
265 We know 1.0.10 and 1.2.3 suffice. You need the following RPMs and
266 their dependencies installed:
8aa1433 GNOME dependencies etc
ripley authored
267
268 gnome-libs
269 gnome-libs-devel
270 gtk+
271 gtk+-devel
24ccf97 Modified GNOME install info
lyndon authored
272 glib
273 glib-devel
8aa1433 GNOME dependencies etc
ripley authored
274
f7e2276 Clarify libglade requirements
ripley authored
275 You will need also libglade 0.5 or later for correct behaviour. For
276 more information on libglade and to download the source, see
f9f3206 Add info on compilation/installation of DVI, info and PDF manuals.
hornik authored
277 http://www.daa.com.au/~james/gnome/. The sources are also available
278 from the GNOME ftp site (ftp.gnome.org and mirrors). RPMs are in RedHat
c428673 update GNOME details
ripley authored
279 6.1 and later.
f69f528 update front matter, including CRAN addresses
ripley authored
280
281 libglade needs libxml 1.4 or later, the source for which is available
67644f7 This commit was manufactured by cvs2svn to create tag
(no author) authored
282 from the GNOME ftp site (ftp.gnome.org and mirrors).
8aa1433 GNOME dependencies etc
ripley authored
283
284
370aa8d flags to allow profiling
ripley authored
285 COMPILE AND LOAD FLAGS
286
287 A wide range of flags can be set in the file config.site or via
288 environment variables. We have already mentioned
289
290 CPPFLAGS extra include flags
af697e5 Cosmetics.
hornik authored
291 LIBS libraries and `-L/lib/path' flags
370aa8d flags to allow profiling
ripley authored
292
293 and others include
294
295 CFLAGS debugging and optimization flags, C
296 MAIN_CFLAGS ditto, for compiling the main program
297 SHLIB_CFLAGS or shared libraries
298 FFLAGS debugging and optimization flags, Fortran
299 MAIN_FFLAGS ditto, for compiling the main program
300 SHLIB_FFLAGS or shared libraries
142267f Ensure consistent MAIN_ and SHLIB_ naming.
hornik authored
301 MAIN_LDFLAGS additional flags for the main link
302 SHLIB_LDFLAGS additional flags for the linking shared libraries
370aa8d flags to allow profiling
ripley authored
303
304 Library paths specified as -L/lib/path in LIBS are collected together
305 and prepended to LD_LIBRARY_PATH, so there should be no need for
306 -R or -rpath flags.
307
308 To compile a profiling version of R, one might for example want to use
142267f Ensure consistent MAIN_ and SHLIB_ naming.
hornik authored
309 MAIN_CFLAGS=-pg, MAIN_FFLAGS=-pg, MAIN_LDFLAGS=-pg on platforms where
370aa8d flags to allow profiling
ripley authored
310 -pg cannot be used with position-independent code.
311
312
67644f7 This commit was manufactured by cvs2svn to create tag
(no author) authored
313 BUILDING ON MAC OS X
314
315 You can build R as a Unix application on MacOS X. You will need the
316 DevTools,
317
318 f2c (ftp://netlib.bell-labs.com/netlib/f2c.tar)
319 Compile with c++ or comment out sigcatch(0) in line 520 of main.c.
320
321 dlcompat libraries
322 (http://fink.sourceforge.net/files/dlcompat-20010123.tar.gz)
323
324 and either install a X sub-system or configure with --without-x.
325 If you want them, you will need to install readline and Tcl/Tk.
326
327
328
fa44a2c Initial revision
r authored
329 NEW PLATFORMS (Standards Hah!)
330
331 There are a number of sources of problems when installing R on a new
18ec53d syncs from patch branch
pd authored
332 hardware/os platform.
fa44a2c Initial revision
r authored
333
334 1. Floating Point Arithmetic: R supports the POSIX, SVID and IEEE
335 models for floating point arithmetic. The POSIX and SVID models
e05c9c8 perl
maechler authored
336 provide no problems. The IEEE model however can be a pain. The
fa44a2c Initial revision
r authored
337 problem is that there is no agreement on how to set the signalling
799c96c documentation updates
ripley authored
338 behavior; sgi/irix and i386 linux require no special action, freebsd
339 requires a call to (the macro) fpsetmask(0) and osf1 requires
af697e5 Cosmetics.
hornik authored
340 that computation be done with a `-ieee_with_inexact' flag etc ...
fa44a2c Initial revision
r authored
341 On a new platform you must find out the magic recipe and add some
342 code to make it work. This can often be done via the file
af697e5 Cosmetics.
hornik authored
343 `config.site' which resides in the top level directory.
fa44a2c Initial revision
r authored
344
345 2. Shared Libraries: There seems to be very little agreement across
346 platforms on what needs to be done to build shared libraries.
347 there are many different combinations of flags for the compilers
348 and loaders. The technique we use is to interrogate the X window
349 system about what it does (using xmkmf). This often works, but
350 you may have to manually override the results. Scanning the cc(1)
351 and ld(1) manual entries usually reveals the correct incantation.
352 Once you know the recipe you can modify the file config.site
353 (following the instructions therein) so that the build will use
354 these options.
355
356 If you do manage to get R running on a new platform please let us know
357 about it so we can modify the configuration procedures to include that
358 platform.
359
360 If you are having trouble getting R to work on your platform please
361 feel free to get in touch to ask questions. We've had a fair amount
af697e5 Cosmetics.
hornik authored
362 of practice at porting R to new platforms ...
fa44a2c Initial revision
r authored
363
3ade498 Updates
ihaka authored
364 R Core Members
Something went wrong with that request. Please try again.