Go to the first, previous, next, last section, table of contents.


Dynamic Loading in S

What is dynamic loading? When is it available?

Dynamic loading is implemented by the S function dyn.load. (See "The New S Language", Ch. 7, pgs 193-204). This function will take the object file (typically output

by a C or Fortran compiler) and load it into memory so that it can be executed by the S functions .C() or .Fortran(). During the loading, dyn.load() attempts to resolve any references to other routines. These references can come from explicit subroutine calls or from implicit calls to library routines.

Unfortunately, the implementation of dyn.load() is difficult and dependent on hardware and the operating system, so the AT&T distribution of S provides it for Vax and Motorola 68000-based architectures. AT&T does not supply dyn.load for Sun's Sparc architecture.

MathSoft provides a working version of dyn.load, dyn.load2, and/or dyn.load.shared for each Unix architecture on which S-PLUS runs.

For more info, See section What is the statlib server? How can I access it?.

What is static loading and how does it differ from dynamic loading?

Static loading is another way of loading subroutines with S. Static loading creates a local version of S in your current working directory. Remember, however, that a copy of S requires about 6Mb of space and must be recreated whenever changes are made to S.

You would use static loading if:

Can I call S/S-PLUS routines from within C?

Yes, you can use the function call_S within C to call an S/S-PLUS function from within a C program. See section 7.2.4 of the blue book, and SPLUS reference manual. Note that C code calling S must be linked into the S executable (via dynamic or static loading).


Go to the first, previous, next, last section, table of contents.