The R Project SVN R

Rev

Rev 75092 | Rev 88498 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
75092 maechler 1
% File src/library/utils/man/COMPILE.Rd
68948 ripley 2
% Part of the R package, https://www.R-project.org
75092 maechler 3
% Copyright 1995-2018 R Core Team
42333 ripley 4
% Distributed under GPL 2 or later
5
 
27445 ripley 6
\name{COMPILE}
56186 murdoch 7
\alias{COMPILE}
75092 maechler 8
\title{Compile Files for Use with R on Unix-alikes}
27445 ripley 9
\description{
10
  Compile given source files so that they can subsequently be collected
63539 ripley 11
  into a shared object using \command{R CMD SHLIB} or an executable
75092 maechler 12
  program using \command{R CMD LINK}.   Not available on Windows.
27445 ripley 13
}
34190 hornik 14
\usage{
15
\special{R CMD COMPILE [options] srcfiles}
16
}
27445 ripley 17
\arguments{
18
  \item{srcfiles}{A list of the names of source files to be compiled.
63362 ripley 19
    Currently, C, C++, Objective C, Objective C++ and Fortran are
40121 urbaneks 20
    supported; the corresponding files should have the extensions
52400 ripley 21
    \file{.c}, \file{.cc} (or \file{.cpp}), \file{.m},
52401 ripley 22
    \file{.mm} (or \file{.M}), \file{.f} and \file{.f90} or \file{.f95},
23
    respectively.}
63539 ripley 24
  \item{options}{A list of compile-relevant settings, or for obtaining
27445 ripley 25
    information about usage and version of the utility.}
26
}
27
\details{
63539 ripley 28
  \command{R CMD SHLIB} can both compile and link files into a
29
  shared object: since it knows what run-time libraries are needed
63362 ripley 30
  when passed C++, Fortran and Objective C(++) sources, passing source
31
  files to \command{R CMD SHLIB} is more reliable.
75092 maechler 32
 
40121 urbaneks 33
  Objective C and Objective C++ support is optional and will work only
63362 ripley 34
  if the corresponding compilers were available at \R configure time:
70779 ripley 35
  their main usage is on macOS.
63539 ripley 36
 
37
  Compilation arranges to include the paths to the \R public C/C++ headers.
38
 
39
  As this compiles code suitable for incorporation into a shared object,
40
  it generates PIC code: that might occasionally be undesirable for the
41
  main code of an executable program.
42
 
43
  This is a \command{make}-based facility, so will not compile a source file
44
  if a newer corresponding \file{.o} file is present.
27445 ripley 45
}
33131 ripley 46
\note{
47
  Some binary distributions of \R have \code{COMPILE} in a separate
66444 hornik 48
  bundle, e.g.\sspace{}an \code{R-devel} RPM.
75092 maechler 49
 
63556 ripley 50
  This is not available on Windows.
33131 ripley 51
}
27445 ripley 52
\seealso{
63539 ripley 53
  \code{\link{LINK}}, \code{\link{SHLIB}}, \code{\link{dyn.load}};
33442 hornik 54
  the section on \dQuote{Customizing compilation under Unix} in
55
  \dQuote{R Administration and Installation}
61433 ripley 56
  (see the \file{doc/manual} subdirectory of the \R source tree).
27445 ripley 57
}
58
\keyword{utilities}