Macaulay2 » Documentation
Packages » ForeignFunctions » SharedLibrary » openSharedLibrary
next | previous | forward | backward | up | index | toc

# openSharedLibrary -- open a shared library

- Usage:
    `openSharedLibrary name`
- Inputs:
  - name, a string,
- Optional inputs:
  - FileName => a string, default value null, the filename of the library to open;
- Outputs:
  - a shared library,

## Description

Open a shared library with the given name. In particular, this is a wrapper around the C dlopen function. A library is searched for with the filename "lib" | name | ".so" (in Linux) or "lib" | name | ".dylib" (in macOS). Alternatively, a specific filename can be specified using the FileName option. A corresponding SharedLibrary object, which can be later used by foreignFunction, is returned.

    i1 : openSharedLibrary "mpfr"

    o1 = mpfr

    o1 : SharedLibrary

## Ways to use openSharedLibrary:

- `openSharedLibrary(String)`

## For the programmer

The object openSharedLibrary is a method function with options.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/ForeignFunctions.m2:1858:0.