Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 192 lines (136 sloc) 7.331 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
fa44a2c Initial revision
r authored
11 R will configure and build under a number of common Unix platforms
12 including dec-alpha-osf, freebsd, hpux, linux-elf, sgi-irix, solaris,
13 and sunos. In general it is relatively easy to adapt R to new
14 platforms. See below for details.
15
df9bbcc information on getting and unpacking files
pd authored
16 GETTING AND UNPACKING THE SOURCES
17
18 The simplest way is to download the most recent R-x.yy.z.tgz package,
19 and unpack them with
20
21 tar xvfz R-x.yy.z.tgz
22
23 on systems that have GNU tar installed. On other systems you need at
24 least to have the "gzip" program installed. Then you can do
25
26 gzip -dc | tar xvf -
27
28 If you need to transport the sources on floppy disks, you can download the
29 R-x.yy.z.tgz-split.* files. and paste them together at the destination
30 with
31
32 cat R-x.yy.z.tgz-split.* > R-x.yy.z.tgz
33
34 and proceed as above.
35
36 Finally, for minor-minor releases (x.yy.z with z != 0), a patch
37 against the preceding release is made available in
38 R-x.yy.{z-1}-x.yy.z.diff.gz (e.g. R-0.63.2-0.63.3.diff.gz), which is
39 generally a much shorter file that the .tgz files. Such a file can be
40 applied to the sources of the previous version by changing to the top
41 directory of it and
42
43 gzip -dc /path/to/it/R-x.yy.{z-1}-x.yy.z.diff.gz | patch -E -p1
44
45 Notice that this does not necessarily work if the older sources have
46 been modified (e.g. by building in their directories).
fa44a2c Initial revision
r authored
47
94e6a91 added make install
leisch authored
48 SIMPLE COMPILATION
fa44a2c Initial revision
r authored
49
da9f5c7 Explain that `make docs' requires Perl version 5 etc.
hornik authored
50 Choose a place to install the R tree (R is not just a binary, but has
51 additional data sets, help files, font metrics etc). Let's call this
52 place RHOME. Untar the source code. This should create directories
53 src, etc, cmd, help and doc. Issue the following commands:
fa44a2c Initial revision
r authored
54
55 ./configure
56 make
57
da9f5c7 Explain that `make docs' requires Perl version 5 etc.
hornik authored
58 If these commands execute successfully, the R binary will be copied to
59 the `$RHOME/bin' directory. In addition, a shell script font-end
60 called "R" will be created and copied to the same directory. You can
61 copy this script to a place where users can invoke it, for example to
62 `/usr/local/bin/R'. You could also copy the man page `R.1' to a place
94e6a91 added make install
leisch authored
63 where your man reader finds it, such as `/usr/local/man/man1'. If you
64 want to install the complete R tree to, e.g., /usr/local/lib/R, see
65 section INSTALLATION below.
fa44a2c Initial revision
r authored
66
da5adfc This commit was manufactured by cvs2svn to create tag 'R-0-64-1'.
(no author) authored
67 You do not necessarily have to build R in the top-level source
68 directory (say, TOP_SRCDIR). To build in BUILDDIR, cd there and run
69
70 TOP_SRCDIR/configure
71 make
72
73 and so on, as described further below. This has the advantage of always
74 keeping your source tree `clean'.
75
f7f10e3 Explain configure command line options.
hornik authored
76 If you need or want to set certain configure variables to something
77 other than their default, you can do that by either editing the file
78 `config.site' or on the command line as
79
80 VAR="..." ./configure # Bourne shell compatibles
81 (setenv VAR "..."; ./configure) # C shell
82
eff400b warning about papersize in INSTALL
thomas authored
83 One common variable to change is R_PAPERSIZE, which defaults to a4, not
84 letter.
85
e6183ff Improve as suggested by BDR.
hornik authored
86 If you have libraries and header files, e.g. for GNU readline, in
87 non-system directories, use the variables LIBS (for libraries) and
88 CPPFLAGS (for header files), respectively, to specify these locations.
89
94e6a91 added make install
leisch authored
90 Make will also build plain text help pages as well as HTML and LaTeX
91 versions of the documentation (the three kinds can also be generated
92 separately using make help, make html and make latex). Note that as
93 of R version 0.60, you need Perl version 5 to build the documentation.
94 If this is not available on your system, you can obtain precompiled
95 documentation files via the `doc/pre-formatted-help' directory of the
96 Comprehensive R Archive Network (CRAN), see the file `RESOURCES' for
97 information on CRAN.
fa44a2c Initial revision
r authored
98
e6183ff Improve as suggested by BDR.
hornik authored
99 Now rehash if necessary, type `R' and reach for your S manuals ...
100 And, read the R FAQ (http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html).
fa44a2c Initial revision
r authored
101
102
94e6a91 added make install
leisch authored
103 INSTALLATION
104
105 After
785c495 Updated.
hornik authored
106
94e6a91 added make install
leisch authored
107 ./configure
108 make
785c495 Updated.
hornik authored
109
94e6a91 added make install
leisch authored
110 have been completed successfully, you can install the complete R tree
111 to your system by typing
112
113 make install
114
115 This will install to the following directories:
116
785c495 Updated.
hornik authored
117 $prefix/bin (some) executables
94e6a91 added make install
leisch authored
118 $prefix/man/man1 man pages
862b8cb Mention looking at LD_LIBRARY_PATH.
hornik authored
119 $prefix/lib/R all the rest (libraries, online help
94e6a91 added make install
leisch authored
120 system, ...)
121
122 where prefix is determined during configuration (typically /usr/local)
123 and can be set by running configure with the option
124
125 ./configure --prefix=/where/you/want/R/to/go
126
862b8cb Mention looking at LD_LIBRARY_PATH.
hornik authored
127 Then the R executable will be installed in /where/you/want/R/to/go/bin,
128 and so on. The prefix of the installation directories can also be seen
129 in the status message that is displayed at the end of configure.
fa44a2c Initial revision
r authored
130
131
aa7eb80 branch update
pd authored
132 USING MAKE
133
134 To compile R, you currently most likely need GNU make. (To be more
135 precise, you need a version of make which accepts shell wildcards in
136 dependencies.) On Solaris 2.6 in particular, you need a version of
137 GNU make different from 3.77 (the current one); 3.76.1 works fine.
138
139
fa44a2c Initial revision
r authored
140 USING FORTRAN
141
f7f10e3 Explain configure command line options.
hornik authored
142 To compile R, you need a FORTRAN compiler or f2c, the FORTRAN-to-C
8d2e6b4 Last minute release changes:
pd authored
143 converter. The default is to search for f77, g77, fort77, f90, xlf,
fae2d08 Also look for fort77.
hornik authored
144 cf77, and fc (in that order), and then for f2c, and use whichever is
145 found first; if none is found, R cannot be compiled. The search
146 mechanism can be changed using the `--with-g77', `--with-f77', and
147 `--with-f2c' command line options to configure. If your FORTRAN
785c495 Updated.
hornik authored
148 compiler is in a non-standard location, you should set the enviroment
862b8cb Mention looking at LD_LIBRARY_PATH.
hornik authored
149 variable PATH accordingly before running configure.
150
151 If your FORTRAN libraries are in slightly peculiar places, you should
152 also look at LD_LIBRARY_PATH to make sure that all libraries are on this
153 path.
fa44a2c Initial revision
r authored
154
155
156 NEW PLATFORMS (Standards Hah!)
157
158 There are a number of sources of problems when installing R on a new
18ec53d syncs from patch branch
pd authored
159 hardware/os platform.
fa44a2c Initial revision
r authored
160
161 1. Floating Point Arithmetic: R supports the POSIX, SVID and IEEE
162 models for floating point arithmetic. The POSIX and SVID models
163 provide no problems. The IEEE model however can be a pain. The
164 problem is that there is no agreement on how to set the signalling
165 behavior; sgi/irix and linux require no special action, freebsd
166 requires a call to (the macro) fpsetmask(0) and osf1v3.2 requires
167 that computation be done with a -ieee_with_inexact flag etc...
168 On a new platform you must find out the magic recipe and add some
169 code to make it work. This can often be done via the file
170 config.site which resides in the top level directory.
171
172 2. Shared Libraries: There seems to be very little agreement across
173 platforms on what needs to be done to build shared libraries.
174 there are many different combinations of flags for the compilers
175 and loaders. The technique we use is to interrogate the X window
176 system about what it does (using xmkmf). This often works, but
177 you may have to manually override the results. Scanning the cc(1)
178 and ld(1) manual entries usually reveals the correct incantation.
179 Once you know the recipe you can modify the file config.site
180 (following the instructions therein) so that the build will use
181 these options.
182
183 If you do manage to get R running on a new platform please let us know
184 about it so we can modify the configuration procedures to include that
185 platform.
186
187 If you are having trouble getting R to work on your platform please
188 feel free to get in touch to ask questions. We've had a fair amount
189 of practice at porting R to new platforms...
190
3ade498 Updates
ihaka authored
191 R Core Members
Something went wrong with that request. Please try again.