EVOLUTION-MANAGER
Edit File: SHLIB.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: Build Shared Object/DLL for Dynamic Loading</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 SHLIB {utils}"><tr><td>SHLIB {utils}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Build Shared Object/DLL for Dynamic Loading</h2> <h3>Description</h3> <p>Compile the given source files and then link all specified object files into a shared object aka DLL which can be loaded into <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> using <code>dyn.load</code> or <code>library.dynam</code>. </p> <h3>Usage</h3> <pre> R CMD SHLIB [options] [-o dllname] files </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>files</code></td> <td> <p>a list specifying the object files to be included in the shared object/DLL. You can also include the name of source files (for which the object files are automagically made from their sources) and library linking commands. </p> </td></tr> <tr valign="top"><td><code>dllname</code></td> <td> <p>the full name of the shared object/DLL to be built, including the extension (typically ‘<span class="file">.so</span>’ on Unix systems, and ‘<span class="file">.dll</span>’ on Windows). If not given, the basename of the object/DLL is taken from the basename of the first file.</p> </td></tr> <tr valign="top"><td><code>options</code></td> <td> <p>Further options to control the processing. Use <code>R CMD SHLIB --help</code> for a current list. </p> </td></tr> </table> <h3>Details</h3> <p><code>R CMD SHLIB</code> is the mechanism used by <code><a href="INSTALL.html">INSTALL</a></code> to compile source code in packages. It will generate suitable compilation commands for C, C++, Objective C(++) and Fortran sources: Fortran 90/95 sources can also be used but it may not be possible to mix these with other languages (on most platforms it is possible to mix with C, but mixing with C++ rarely works). </p> <p>Please consult section ‘Creating shared objects’ in the manual ‘Writing R Extensions’ for how to customize it (for example to add <code>cpp</code> flags and to add libraries to the link step) and for details of some of its quirks. </p> <p>Items in <code>files</code> with extensions ‘<span class="file">.c</span>’, ‘<span class="file">.cpp</span>’, ‘<span class="file">.cc</span>’, ‘<span class="file">.C</span>’, ‘<span class="file">.f</span>’, ‘<span class="file">.f90</span>’, ‘<span class="file">.f95</span>’, ‘<span class="file">.m</span>’ (ObjC), ‘<span class="file">.M</span>’ and ‘<span class="file">.mm</span>’ (ObjC++) are regarded as source files, and those with extension ‘<span class="file">.o</span>’ as object files. All other items are passed to the linker. </p> <p>Objective C(++) support is optional when <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> was configured: their main usage is on macOS. </p> <p>Note that the appropriate run-time libraries will be used when linking if C++, Fortran or Objective C(++) sources are supplied, but not for compiled object files from these languages. </p> <p>Option <span class="option">-n</span> (also known as <span class="option">--dry-run</span>) will show the commands that would be run without actually executing them. </p> <h3>Note</h3> <p>Some binary distributions of <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> have <code>SHLIB</code> in a separate bundle, e.g., an <code>R-devel</code> RPM. </p> <h3>See Also</h3> <p><code><a href="COMPILE.html">COMPILE</a></code>, <code><a href="../../base/html/dynload.html">dyn.load</a></code>, <code><a href="../../base/html/library.dynam.html">library.dynam</a></code>. </p> <p>The ‘R Installation and Administration’ and ‘Writing R Extensions’ manuals, including the section on “Customizing compilation” in the former. </p> <h3>Examples</h3> <pre>## Not run: # To link against a library not on the system library paths: R CMD SHLIB -o mylib.so a.f b.f -L/opt/acml3.5.0/gnu64/lib -lacml ## End(Not run)</pre> <hr /><div style="text-align: center;">[Package <em>utils</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>