Rev 2886 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
INSTALLING R UNDER UNIXGENERALITIESR will configure and build under a number of common Unix platformsincluding dec-alpha-osf, freebsd, hpux, linux-elf, sgi-irix, solaris,and sunos. In general it is relatively easy to adapt R to newplatforms. See below for details.SIMPLE COMPILATIONChoose a place to install the R tree (R is not just a binary, but hasadditional data sets, help files, font metrics etc). Let's call thisplace RHOME. Untar the source code. This should create directoriessrc, etc, cmd, help and doc. Issue the following commands:./configuremakeIf these commands execute successfully, the R binary will be copied tothe `$RHOME/bin' directory. In addition, a shell script font-endcalled "R" will be created and copied to the same directory. You cancopy this script to a place where users can invoke it, for example to`/usr/local/bin/R'. You could also copy the man page `R.1' to a placewhere your man reader finds it, such as `/usr/local/man/man1'. If youwant to install the complete R tree to, e.g., /usr/local/lib/R, seesection INSTALLATION below.If you need or want to set certain configure variables to somethingother than their default, you can do that by either editing the file`config.site' or on the command line asVAR="..." ./configure # Bourne shell compatibles(setenv VAR "..."; ./configure) # C shellOne common variable to change is R_PAPERSIZE, which defaults to a4, notletter.If you have libraries and header files, e.g. for GNU readline, innon-system directories, use the variables LIBS (for libraries) andCPPFLAGS (for header files), respectively, to specify these locations.Make will also build plain text help pages as well as HTML and LaTeXversions of the documentation (the three kinds can also be generatedseparately using make help, make html and make latex). Note that asof R version 0.60, you need Perl version 5 to build the documentation.If this is not available on your system, you can obtain precompileddocumentation files via the `doc/pre-formatted-help' directory of theComprehensive R Archive Network (CRAN), see the file `RESOURCES' forinformation on CRAN.Now rehash if necessary, type `R' and reach for your S manuals ...And, read the R FAQ (http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html).INSTALLATIONAfter./configuremakehave been completed successfully, you can install the complete R treeto your system by typingmake installThis will install to the following directories:$prefix/bin (some) executables$prefix/man/man1 man pages$prefix/share/R all the rest (libraries, online helpsystem, ...)where prefix is determined during configuration (typically /usr/local)and can be set by running configure with the option./configure --prefix=/where/you/want/R/to/goThe prefix of the installation directories can also be seen in thestatus message that is displayed at the end of configure.You do not necessarily have to build R in the top-level sourcedirectory (say, TOP_SRCDIR). To build in BUILDDIR, cd there and runTOP_SRCDIR/configuremakeand so on, as described further above. This has the advantage of alwayskeeping your source tree `clean'.USING MAKETo compile R, you currently most likely need GNU make. (To be moreprecise, you need a version of make which accepts shell wildcards independencies.) On Solaris 2.6 in particular, you need a version ofGNU make different from 3.77 (the current one); 3.76.1 works fine.USING FORTRANTo compile R, you need a FORTRAN compiler or f2c, the FORTRAN-to-Cconverter. The default is to search for f77, g77, fort77, f90, xlf,cf77, and fc (in that order), and then for f2c, and use whichever isfound first; if none is found, R cannot be compiled. The searchmechanism can be changed using the `--with-g77', `--with-f77', and`--with-f2c' command line options to configure. If your FORTRANcompiler is in a non-standard location, you should set the enviromentvaiable PATH accordingly before running configure.NEW PLATFORMS (Standards Hah!)There are a number of sources of problems when installing R on a newhardware/os platform.1. Floating Point Arithmetic: R supports the POSIX, SVID and IEEEmodels for floating point arithmetic. The POSIX and SVID modelsprovide no problems. The IEEE model however can be a pain. Theproblem is that there is no agreement on how to set the signallingbehavior; sgi/irix and linux require no special action, freebsdrequires a call to (the macro) fpsetmask(0) and osf1v3.2 requiresthat computation be done with a -ieee_with_inexact flag etc...On a new platform you must find out the magic recipe and add somecode to make it work. This can often be done via the fileconfig.site which resides in the top level directory.2. Shared Libraries: There seems to be very little agreement acrossplatforms on what needs to be done to build shared libraries.there are many different combinations of flags for the compilersand loaders. The technique we use is to interrogate the X windowsystem about what it does (using xmkmf). This often works, butyou may have to manually override the results. Scanning the cc(1)and ld(1) manual entries usually reveals the correct incantation.Once you know the recipe you can modify the file config.site(following the instructions therein) so that the build will usethese options.If you do manage to get R running on a new platform please let us knowabout it so we can modify the configuration procedures to include thatplatform.If you are having trouble getting R to work on your platform pleasefeel free to get in touch to ask questions. We've had a fair amountof practice at porting R to new platforms...R Core Members