EVOLUTION-MANAGER
Edit File: COMPILE.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Compile Files for Use with R on Unix-alikes</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for COMPILE {utils}"><tr><td>COMPILE {utils}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Compile Files for Use with R on Unix-alikes</h2> <h3>Description</h3> <p>Compile given source files so that they can subsequently be collected into a shared object using <code>R CMD SHLIB</code> or an executable program using <code>R CMD LINK</code>. Not available on Windows. </p> <h3>Usage</h3> <pre> R CMD COMPILE [options] srcfiles </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>srcfiles</code></td> <td> <p>A list of the names of source files to be compiled. Currently, C, C++, Objective C, Objective C++ and Fortran are supported; the corresponding files should have the extensions ‘<span class="file">.c</span>’, ‘<span class="file">.cc</span>’ (or ‘<span class="file">.cpp</span>’), ‘<span class="file">.m</span>’, ‘<span class="file">.mm</span>’ (or ‘<span class="file">.M</span>’), ‘<span class="file">.f</span>’ and ‘<span class="file">.f90</span>’ or ‘<span class="file">.f95</span>’, respectively.</p> </td></tr> <tr valign="top"><td><code>options</code></td> <td> <p>A list of compile-relevant settings, or for obtaining information about usage and version of the utility.</p> </td></tr> </table> <h3>Details</h3> <p><code>R CMD SHLIB</code> can both compile and link files into a shared object: since it knows what run-time libraries are needed when passed C++, Fortran and Objective C(++) sources, passing source files to <code>R CMD SHLIB</code> is more reliable. </p> <p>Objective C and Objective C++ support is optional and will work only if the corresponding compilers were available at <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> configure time: their main usage is on macOS. </p> <p>Compilation arranges to include the paths to the <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> public C/C++ headers. </p> <p>As this compiles code suitable for incorporation into a shared object, it generates PIC code: that might occasionally be undesirable for the main code of an executable program. </p> <p>This is a <code>make</code>-based facility, so will not compile a source file if a newer corresponding ‘<span class="file">.o</span>’ file is present. </p> <h3>Note</h3> <p>Some binary distributions of <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> have <code>COMPILE</code> in a separate bundle, e.g. an <code>R-devel</code> RPM. </p> <p>This is not available on Windows. </p> <h3>See Also</h3> <p><code><a href="LINK.html">LINK</a></code>, <code><a href="SHLIB.html">SHLIB</a></code>, <code><a href="../../base/html/dynload.html">dyn.load</a></code>; the section on “Customizing compilation under Unix” in “R Administration and Installation” (see the ‘<span class="file">doc/manual</span>’ subdirectory of the <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> source tree). </p> <hr /><div style="text-align: center;">[Package <em>utils</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>