Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 323 lines (230 sloc) 12.053 kb
fa44a2cd » r
1997-09-18 Initial revision
1
2 INSTALLING R UNDER UNIX
3
4
5 GENERALITIES
6
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
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).
df9bbcc6 » pd
1999-04-07 information on getting and unpacking files
10
0f965475 » ripley
2000-02-23 add comments on setting MAKE, Windows 2000
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.
8aa1433b » ripley
1999-08-21 GNOME dependencies etc
18
fa44a2cd » r
1997-09-18 Initial revision
19
df9bbcc6 » pd
1999-04-07 information on getting and unpacking files
20 GETTING AND UNPACKING THE SOURCES
21
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
22 The simplest way is to download the most recent R-x.y.z.tgz package, and
23 unpack them with
df9bbcc6 » pd
1999-04-07 information on getting and unpacking files
24
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
25 tar xvfz R-x.y.z.tgz
df9bbcc6 » pd
1999-04-07 information on getting and unpacking files
26
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
27 on systems that have GNU tar installed. On other systems you need at
799c96c5 » ripley
2000-02-27 documentation updates
28 least to have the "gzip" program installed. Then you can use
df9bbcc6 » pd
1999-04-07 information on getting and unpacking files
29
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
30 gzip -dc R-x.y.z.tgz | tar xvf -
df9bbcc6 » pd
1999-04-07 information on getting and unpacking files
31
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
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
df9bbcc6 » pd
1999-04-07 information on getting and unpacking files
34 with
35
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
36 cat R-x.y.z.tgz-split.* > R-x.y.z.tgz
df9bbcc6 » pd
1999-04-07 information on getting and unpacking files
37
38 and proceed as above.
39
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
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
df9bbcc6 » pd
1999-04-07 information on getting and unpacking files
45
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
46 gzip -dc /path/to/it/R-x.y.{z-1}-x.y.z.diff.gz | patch -E -p1
df9bbcc6 » pd
1999-04-07 information on getting and unpacking files
47
799c96c5 » ripley
2000-02-27 documentation updates
48 Beware that this does not necessarily work if the older sources have
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
49 been modified (e.g., by building in their directories).
fa44a2cd » r
1997-09-18 Initial revision
50
8aa1433b » ripley
1999-08-21 GNOME dependencies etc
51
94e6a91a » leisch
1998-06-10 added make install
52 SIMPLE COMPILATION
fa44a2cd » r
1997-09-18 Initial revision
53
da9f5c75 » hornik
1997-12-10 Explain that `make docs' requires Perl version 5 etc.
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
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
56 place R_HOME. Untar the source code. This should create directories
57 src, doc, and several more. Issue the following commands:
fa44a2cd » r
1997-09-18 Initial revision
58
59 ./configure
60 make
61
0f965475 » ripley
2000-02-23 add comments on setting MAKE, Windows 2000
62 (See USING MAKE below if your make is not called `make'.)
63
da9f5c75 » hornik
1997-12-10 Explain that `make docs' requires Perl version 5 etc.
64 If these commands execute successfully, the R binary will be copied to
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
65 the `${R_HOME}/bin' directory. In addition, a shell script front-end
da9f5c75 » hornik
1997-12-10 Explain that `make docs' requires Perl version 5 etc.
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
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
69 where your man reader finds it, such as `/usr/local/man/man1'. If you
23708c37 » hornik
2000-02-27 R_HOME currently is ${prefix}/lib/R.
70 want to install the complete R tree to, e.g., `/usr/local/lib/R', see
94e6a91a » leisch
1998-06-10 added make install
71 section INSTALLATION below.
fa44a2cd » r
1997-09-18 Initial revision
72
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
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
ba6787e8 » pd
1999-05-08 branch update
75
76 TOP_SRCDIR/configure
77 make
78
97ad1f7e » pd
1999-07-02 branch update
79 and so on, as described further below. This has the advantage of always
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
80 keeping your source tree `clean'. (You may need GNU make to allow
81 this.)
ba6787e8 » pd
1999-05-08 branch update
82
f7f10e38 » hornik
1998-03-06 Explain configure command line options.
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
e05c9c8b » maechler
1999-06-01 perl
87 VAR="..." ./configure # Bourne shell compatibles
88 (setenv VAR "..."; ./configure) # C shell
f7f10e38 » hornik
1998-03-06 Explain configure command line options.
89
eff400bd » thomas
1998-04-03 warning about papersize in INSTALL
90 One common variable to change is R_PAPERSIZE, which defaults to a4, not
91 letter.
92
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
93 If you have libraries and header files, e.g., for GNU readline, in
e6183ffc » hornik
1998-09-07 Improve as suggested by BDR.
94 non-system directories, use the variables LIBS (for libraries) and
95 CPPFLAGS (for header files), respectively, to specify these locations.
370aa8da » ripley
2000-06-07 flags to allow profiling
96 These default to /usr/local/lib and /usr/local/include to catch the
97 most common cases.
e6183ffc » hornik
1998-09-07 Improve as suggested by BDR.
98
fa5f9830 » ripley
1999-11-13 mention removing config.cache
99 If you find you need to alter configure variables, it is worth noting
799c96c5 » ripley
2000-02-27 documentation updates
100 that some settings are cached in the file `config.cache', and it is a
fa5f9830 » ripley
1999-11-13 mention removing config.cache
101 good idea to remove that file before re-configuring.
102
94e6a91a » leisch
1998-06-10 added make install
103 Make will also build plain text help pages as well as HTML and LaTeX
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
104 versions of the R object documentation (the three kinds can also be
105 generated separately using make help, make html and make latex). Note
106 that you need Perl version 5, available via http://www.perl.com/CPAN/,
107 to build this documentation. If this is not available on your system,
108 you can obtain PDF versions of the documentation files via the
109 Comprehensive R Archive Network (CRAN), see the file `RESOURCES' for
110 information on CRAN.
111
112 Now rehash if necessary, type `R', and read the R manuals and the R FAQ
799c96c5 » ripley
2000-02-27 documentation updates
113 (files FAQ or doc/html/faq.html or the latest version at
114 http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html).
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
115
116 The GNOME interface for R will only be built if you specify it: see the
117 GNOME section below.
6e973286 » lyndon
1999-08-13 Added information on compiling the GNOME interface
118
fa44a2cd » r
1997-09-18 Initial revision
119
799c96c5 » ripley
2000-02-27 documentation updates
120 MAKING THE MANUALS
121
122 There is a set of manuals that can be built from the sources,
123
124 refman Printed versions of all the help pages.
e7553a1b » hornik
2000-02-27 Update.
125 R-intro `An Introduction to R'.
799c96c5 » ripley
2000-02-27 documentation updates
126 R-exts `Writing R Extensions'.
127 R-FAQ R FAQ (which is already built for you).
128
129 To make these, cd to the `doc/manual' directory and use
130
131 make dvi to create DVI versions
132 make pdf to create PDF versions
133 make info to create info files (not refman)
134
135 You will not be able to build the info files unless you have makeinfo
669dc294 » ripley
2000-06-12 common texinfo version is 3.12 not 3.2
136 version 4 or later installed (and most Linux distributions have 3.12).
799c96c5 » ripley
2000-02-27 documentation updates
137
fa60ce89 » hornik
2000-06-04 Cosmetics
138 The DVI versions can be previewed and printed using standard programs
799c96c5 » ripley
2000-02-27 documentation updates
139 such as `xdvi' and `dvips'. The PDF versions can be viewed using
140 Acrobat Reader or (recent versions of) ghostscript: they have
141 hyperlinks that can be followed in Acrobat Reader. The info files are
142 suitable for reading online with Emacs or the standalone GNU Info.
143
144
94e6a91a » leisch
1998-06-10 added make install
145 INSTALLATION
146
147 After
785c4956 » hornik
1998-09-28 Updated.
148
94e6a91a » leisch
1998-06-10 added make install
149 ./configure
150 make
785c4956 » hornik
1998-09-28 Updated.
151
94e6a91a » leisch
1998-06-10 added make install
152 have been completed successfully, you can install the complete R tree
153 to your system by typing
154
155 make install
156
157 This will install to the following directories:
158
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
159 ${prefix}/bin the front-end shell script
160 ${prefix}/man/man1 the man page
23708c37 » hornik
2000-02-27 R_HOME currently is ${prefix}/lib/R.
161 ${prefix}/lib/R all the rest (libraries, on-line help
94e6a91a » leisch
1998-06-10 added make install
162 system, ...)
163
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
164 where prefix is determined during configuration (typically `/usr/local')
94e6a91a » leisch
1998-06-10 added make install
165 and can be set by running configure with the option
166
167 ./configure --prefix=/where/you/want/R/to/go
168
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
169 This installs the R executable to `/where/you/want/R/to/go/bin', and so
170 on. The prefix of the installation directories can also be seen in the
9c94ec4b » ripley
2000-05-05 mention how to install other than in prefix.
171 status message that is displayed at the end of configure. You can
172 install into another directory by using
173
174 make prefix=/path/to/here install
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
175
fa60ce89 » hornik
2000-06-04 Cosmetics
176 To install DVI, info and PDF versions of the manuals, use `make
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
177 install-dvi', `make install-info' and `make install-pdf', respectively.
fa44a2cd » r
1997-09-18 Initial revision
178
179
aa7eb80a » pd
1998-12-04 branch update
180 USING MAKE
181
31eef2ac » ripley
2000-01-11 clarify make requirements
182 To compile R, you will most likely find it easiest to use GNU make.
183 On Solaris 2.6/7 in particular, you need a version of GNU make
5d67f689 » ripley
2000-06-07 update info on Sun make
184 different from 3.77; 3.79 works fine, as does the Sun make.
31eef2ac » ripley
2000-01-11 clarify make requirements
185
186 To build in a separate directory you need a make that uses the VPATH
5d67f689 » ripley
2000-06-07 update info on Sun make
187 variable, for example GNU make, or Sun make on Solaris 2.7 (but not earlier).
aa7eb80a » pd
1998-12-04 branch update
188
0f965475 » ripley
2000-02-23 add comments on setting MAKE, Windows 2000
189 If you want to use a make by another name, for example if your GNU make
190 is called `gmake', you need to set MAKE at configure time, for example
191
e7553a1b » hornik
2000-02-27 Update.
192 MAKE=gmake ./configure (sh, bash)
193 env MAKE=gmake ./configure (csh)
0f965475 » ripley
2000-02-23 add comments on setting MAKE, Windows 2000
194
195
fa44a2cd » r
1997-09-18 Initial revision
196 USING FORTRAN
197
f7f10e38 » hornik
1998-03-06 Explain configure command line options.
198 To compile R, you need a FORTRAN compiler or f2c, the FORTRAN-to-C
e7553a1b » hornik
2000-02-27 Update.
199 converter. The default is to search for g77, fort77, f77, f90, xlf,
fae2d086 » hornik
1998-03-22 Also look for fort77.
200 cf77, and fc (in that order), and then for f2c, and use whichever is
201 found first; if none is found, R cannot be compiled. The search
202 mechanism can be changed using the `--with-g77', `--with-f77', and
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
203 `--with-f2c' command line options to configure. If your FORTRAN
785c4956 » hornik
1998-09-28 Updated.
204 compiler is in a non-standard location, you should set the enviroment
862b8cb4 » hornik
1999-03-29 Mention looking at LD_LIBRARY_PATH.
205 variable PATH accordingly before running configure.
206
207 If your FORTRAN libraries are in slightly peculiar places, you should
208 also look at LD_LIBRARY_PATH to make sure that all libraries are on this
209 path.
fa44a2cd » r
1997-09-18 Initial revision
210
c7b5dc4b » pd
1999-10-07 branch update - not bugfree
211 You must set whatever compilation flags (if any) are needed to ensure
212 that FORTRAN `integer' is equivalent to a C int pointer and FORTRAN
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
213 `double precision' is equivalent to a C double pointer. This is checked
31eef2ac » ripley
2000-01-11 clarify make requirements
214 during the configuration process.
c7b5dc4b » pd
1999-10-07 branch update - not bugfree
215
fa44a2cd » r
1997-09-18 Initial revision
216
8aa1433b » ripley
1999-08-21 GNOME dependencies etc
217 BUILDING THE GNOME INTERFACE
218
c428673b » ripley
2000-05-23 update GNOME details
219 This interface is experimental, incomplete and not currently being
220 developed. It provides a console and a graphics device (gtk(); the x11()
221 device can also be used). Many of the `features' of the console are
222 currently stubs.
b96c09cf » ripley
1999-08-25 list of systems, comments on GNOME, typos
223
8aa1433b » ripley
1999-08-21 GNOME dependencies etc
224 The GNOME interface for R will only be built if you specify it by
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
225 running configure with the --with-gnome option. For example, you might
226 run
8aa1433b » ripley
1999-08-21 GNOME dependencies etc
227
228 ./configure --with-gnome
229
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
230 but please check you have all the requirements first. It is advisable
231 to have reasonably-up-to-date versions of the gnome and gtk+ libraries
232 (later than those in RedHat 6.0, for example). You can find the
8aa1433b » ripley
1999-08-21 GNOME dependencies etc
233 versions you have by
234
235 gnome-config --version
236 gtk-config --version
237
c428673b » ripley
2000-05-23 update GNOME details
238 We know 1.0.10 and 1.2.3 suffice. You need the following RPMs and
239 their dependencies installed:
8aa1433b » ripley
1999-08-21 GNOME dependencies etc
240
241 gnome-libs
242 gnome-libs-devel
243 gtk+
244 gtk+-devel
24ccf97f » lyndon
1999-08-25 Modified GNOME install info
245 glib
246 glib-devel
8aa1433b » ripley
1999-08-21 GNOME dependencies etc
247
f7e22767 » ripley
1999-11-16 Clarify libglade requirements
248 You will need also libglade 0.5 or later for correct behaviour. For
249 more information on libglade and to download the source, see
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
250 http://www.daa.com.au/~james/gnome/. The sources are also available
251 from the GNOME ftp site (ftp.gnome.org and mirrors). RPMs are in RedHat
c428673b » ripley
2000-05-23 update GNOME details
252 6.1 and later.
f69f528a » ripley
1999-11-14 update front matter, including CRAN addresses
253
254 libglade needs libxml 1.4 or later, the source for which is available
f9f3206a » hornik
2000-01-18 Add info on compilation/installation of DVI, info and PDF manuals.
255 from the GNOME ftp site (ftp.gnome.org and mirrors). RPMs of libxml-1.4
256 and libxml-devel-1.4 are available from updates.redhat.com and mirrors,
257 or ftp.gurulabs.com/pub/gnome/updates.
8aa1433b » ripley
1999-08-21 GNOME dependencies etc
258
259
370aa8da » ripley
2000-06-07 flags to allow profiling
260 COMPILE AND LOAD FLAGS
261
262 A wide range of flags can be set in the file config.site or via
263 environment variables. We have already mentioned
264
265 CPPFLAGS extra include flags
266 LIBS libraries and -L/lib/path flags
267
268 and others include
269
270 CFLAGS debugging and optimization flags, C
271 MAIN_CFLAGS ditto, for compiling the main program
272 SHLIB_CFLAGS or shared libraries
273 FFLAGS debugging and optimization flags, Fortran
274 MAIN_FFLAGS ditto, for compiling the main program
275 SHLIB_FFLAGS or shared libraries
142267fa » hornik
2000-07-22 Ensure consistent MAIN_ and SHLIB_ naming.
276 MAIN_LDFLAGS additional flags for the main link
277 SHLIB_LDFLAGS additional flags for the linking shared libraries
370aa8da » ripley
2000-06-07 flags to allow profiling
278
279 Library paths specified as -L/lib/path in LIBS are collected together
280 and prepended to LD_LIBRARY_PATH, so there should be no need for
281 -R or -rpath flags.
282
283 To compile a profiling version of R, one might for example want to use
142267fa » hornik
2000-07-22 Ensure consistent MAIN_ and SHLIB_ naming.
284 MAIN_CFLAGS=-pg, MAIN_FFLAGS=-pg, MAIN_LDFLAGS=-pg on platforms where
370aa8da » ripley
2000-06-07 flags to allow profiling
285 -pg cannot be used with position-independent code.
286
287
fa44a2cd » r
1997-09-18 Initial revision
288 NEW PLATFORMS (Standards Hah!)
289
290 There are a number of sources of problems when installing R on a new
18ec53d7 » pd
1998-06-18 syncs from patch branch
291 hardware/os platform.
fa44a2cd » r
1997-09-18 Initial revision
292
293 1. Floating Point Arithmetic: R supports the POSIX, SVID and IEEE
294 models for floating point arithmetic. The POSIX and SVID models
e05c9c8b » maechler
1999-06-01 perl
295 provide no problems. The IEEE model however can be a pain. The
fa44a2cd » r
1997-09-18 Initial revision
296 problem is that there is no agreement on how to set the signalling
799c96c5 » ripley
2000-02-27 documentation updates
297 behavior; sgi/irix and i386 linux require no special action, freebsd
298 requires a call to (the macro) fpsetmask(0) and osf1 requires
fa44a2cd » r
1997-09-18 Initial revision
299 that computation be done with a -ieee_with_inexact flag etc...
300 On a new platform you must find out the magic recipe and add some
301 code to make it work. This can often be done via the file
302 config.site which resides in the top level directory.
303
304 2. Shared Libraries: There seems to be very little agreement across
305 platforms on what needs to be done to build shared libraries.
306 there are many different combinations of flags for the compilers
307 and loaders. The technique we use is to interrogate the X window
308 system about what it does (using xmkmf). This often works, but
309 you may have to manually override the results. Scanning the cc(1)
310 and ld(1) manual entries usually reveals the correct incantation.
311 Once you know the recipe you can modify the file config.site
312 (following the instructions therein) so that the build will use
313 these options.
314
315 If you do manage to get R running on a new platform please let us know
316 about it so we can modify the configuration procedures to include that
317 platform.
318
319 If you are having trouble getting R to work on your platform please
320 feel free to get in touch to ask questions. We've had a fair amount
321 of practice at porting R to new platforms...
322
3ade4989 » ihaka
1998-05-26 Updates
323 R Core Members
Something went wrong with that request. Please try again.