This help topic is for R version 2.9.0. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/utils/html/SHLIB.html
SHLIB {utils}R Documentation

Build a DLL for Dynamic Loading

Description

The given source files are first compiled. All specified object files are then linked into a shared library which can be loaded into R using dyn.load or library.dynam.

Usage

R CMD SHLIB [options] [-o dllname] files

Arguments

files

a list of names of (typically) source files to be compiled and included in the library. You can also include the names of object files which are automagically made from their sources, and archive (*.a) and library linking commands.

dllname

the name of the shared library to be built, optionally including the extension ‘.dll’. If not given, the name of the DLL is taken from the first source or object file specified.

options

Further options to control the processing. Use R CMD SHLIB --help for a current list. The most useful one is -d to build a debug DLL.

Details

R CMD SHLIB uses the mechanism as used by INSTALL to compile source code in packages. To use SHLIB you need to have installed (from the R installer) the files for compiling source packages as well as the tools described in the ‘R Installation and Administration’ manual.

Please consult section ‘Creating shared objects’ in the manual ‘Writing R Extensions’ for how to customize it (for example to add cpp flags and to add libraries to the link step) and for details of some of its quirks.

Items in files with extensions ‘.c’, ‘.cpp’, ‘.cc’, ‘.C’, ‘.f’, ‘.f90’, ‘.f95’ and ‘.m’, are regarded as source files, and those with extension ‘.o’ as object files. All other items are passed to the linker.

If there is an exports file ‘dllname-win.def’ in the current directory it will be used, otherwise all entry points in objects (but not libraries) will be exported from the DLL.

See Also

dyn.load, library.dynam.

The ‘R Installation and Administration’ and ‘Writing R Extensions’ manuals.

Examples

## Not run: 
rcmd SHLIB -o my.dll a.f b.f -L/AMD/acml3.5.0/gnu32/lib -lacml

## End(Not run)

[Package utils version 2.9.0 ]