JuliaObjDynamicLinker¶
jutils.spad line 584 [edit on github]
Generic Julia objects used for dynamically linking shared libraries.
- coerce: % -> OutputForm
from CoercibleTo OutputForm
- convert: % -> String
from ConvertibleTo String
- jdlink: String -> %
jdlink(lib)
opens/loads the dynamic shared librarylib
and returns a reference pointer that can be used to obtain adress to symbols in it using jlDlSym. It is up to the user to unload the shared object when it is no longer necessary using jlDlClose. example{jdlink “libopenlibm”} Throws a Julia error if it is not found. Use jlDlOpen for a version with options and/or without Julia errors.
- jlAbout: % -> Void
from JuliaObjectType
- jlApply: (String, %) -> %
from JuliaObjectType
- jlApply: (String, %, %) -> %
from JuliaObjectType
- jlApply: (String, %, %, %) -> %
from JuliaObjectType
- jlApply: (String, %, %, %, %) -> %
from JuliaObjectType
- jlApply: (String, %, %, %, %, %) -> %
from JuliaObjectType
- jlApply: (String, %, %, %, %, %, %) -> %
from JuliaObjectType
- jlDlCApply: (%, JuliaObject) -> JuliaObject
jlDlCApply(func,x)
applies the function pointerfunc
tox
. The Julia type ofx
must be compatible with the Libdl Julia module. Type of the returned value is assumed to be the same than the type ofx
. For example: example{libm:= jlDlOpen “libopenlibm”} example{squareRoot:=jlDlSym(libm,jsym(sqrt))} example{jlDlCApply(squareRoot,jobject(“2.”))}
- jlDlCApply: (%, JuliaObject, JuliaObject) -> JuliaObject
jlDlCApply(func,x,y)
applies the function pointerfunc
tox
andy
. Type of the returned value is assumed to be the same than the type ofx
. For example: example{libgsl:= jlDlOpen “libgsl”} example{ipower:=jlDlSym(libgsl, gsl_pow_int)} example{jlDlCApply(ipower,jobject(“2.0”),jobject(“7”))}
- jlDlCApply: (%, JuliaObject, JuliaObject, JuliaObject) -> JuliaObject
jlDlCApply(func,x,y,z)
applies the function pointerfunc
tox
,y
andz
. Returned value is assumed the same type than type ofx
. Use jlDlCApply with type options if necessary. For example with GSL: example{gsl:= jlDlOpen “libgsl”} example{hypot3:= jlDlSym(gsl,jsym(gsl_hypot3))} example{jlDlCApply(hypot3,jobject(“2.”),jobject(“7.”),jobjet(“9.0”))}
- jlDlCApply: (%, String, JuliaObject, String) -> JuliaObject
jlDlCApply(func, ctype, x, xctype)
applies the function pointerfunc
tox
given its JuliaC
type (xctype) or its supported Julia type, for example “Float64” or “Cdouble”. Returned value is assumed to be aC
typectype
(or any Julia supported types). For example: example{libm:= jlDlOpen “libopenlibm”} example{squareRoot:= jlDlSym(libm,jsym(sqrt))} example{jlDlCApply(squareRoot, “Cdouble” jobject(“2.”), “Cdouble”)} example{sinus:=jlDlSym(libm,jsym(sin))} example{jlDlCApply(sinus,”Float64”), jobject(“2.”), “Float64”)}
- jlDlCApply: (%, String, JuliaObject, String, JuliaObject, String) -> JuliaObject
jlDlCApply(func, ctype, x, xctype, y, xctype)
applies the function pointerfunc
tox
andy
given their JuliaC
type (xctype
andxctype
) or their supported Julia type, for example “Float64” or “Cdouble”. Returned value is assumed to be aC
typectype
(or any Julia supported types).
- jlDlCApply: (%, String, JuliaObject, String, JuliaObject, String, JuliaObject, String) -> JuliaObject
jlDlCApply(func, ctype, x, xctype, y, xctype, z, ztype)
applies the function pointerfunc
tox
given its JuliaC
type (xctype
) or its supported Julia type, for example “Float64” or “Cdouble”. Returned value is assumed to be aC
typectype
(or any Julia supported types).
- jlDlClose: % -> Boolean
jlDlClose(libPtr)
unload explicitely the shared library referenced bylibPtr
.
- jlDlFindLib: String -> String
jlDlFindLib(lib)
returns the the librarylib
. Returns an empty string if it is not found.
- jlDlList: () -> JuliaObject
jlDlList()
returns the list of loaded shared objects by the currect processus in a JuliaObject referencing a Julia vector of strings.
- jlDlOpen: (String, Boolean) -> %
jlDlOpen(lib, throw)
opens/loads the dynamic shared librarylib
and returns a reference pointer that can be used to obtain adress to symbols in it using jlDlSym. It is up to the user to unload the shared object when it is no longer used. ‘throw’ determines whether or not Julia throws an error if the library can not be loaded. example{jlDlOpen(“libopenlibm”, true)}
- jlDlOpen: (String, JuliaObject) -> %
jlDlOpen(lib, flags)
opens/loads the dynamic shared librarylib
and returns a reference pointer that can be used to obtain adress to symbols in it using jlDlSym. It is up to the user to unload the shared object when it is no longer used. Does not throw an error if the library can not be loaded by default and returns nothing in this case. Use the nothing? operation on the returned value if necessary. example{jlUsing “Libdl” – for flags} example{jlDlOpen(“libopenlibm”, jobject “Libdl.RTLD_NOW”)} flags can be one or combinaison of: RTLD_DEEPBIND RTLD_FIRST RTLD_GLOBAL RTLD_LAZY RTLD_LOCAL RTLD_NODELETE RTLD_NOLOAD RTLD_NOW Note: the Libdl must be loaded or imported before using these flags.
- jlDlOpen: (String, JuliaObject, Boolean) -> %
jlDlOpen(lib, flags, throw)
opens/loads the dynamic shared librarylib
and returns a reference pointer that can be used to obtain adress to symbols in it using jlDlSym. It is up to the user to unload the shared object when it is no longer used. Does not throw an error if the library can not be loaded by default and returns nothing in this case. Use the nothing? operation on the returned value if necessary. ‘throw’ determines whether or not Julia throws an error if the library can not be loaded. example{jlDlOpen(“libopenlibm”, jobject “Libdl.RTLD_NOW”, false)}flags
can be one or combinaison of: RTLD_DEEPBIND RTLD_FIRST RTLD_GLOBAL RTLD_LAZY RTLD_LOCAL RTLD_NODELETE RTLD_NOLOAD RTLD_NOW Note: the Libdl must be loaded or imported before using theseflags
.
- jlDlOpen: String -> %
jlDlOpen(lib)
opens/loads the dynamic shared librarylib
and returns a reference pointer that can be used to obtain adress to symbols in it using jlDlSym. It is up to the user to unload the shared object when it is no longer used. Does not throw an error if the library can not be loaded and returns ‘nothing’ in this case. Use the nothing? operation on the returned value if necessary.
- jlDlPath: % -> String
jlDlPath(lib)
returns the path of the loaded librarylib
.
- jlDlPath: String -> String
jlDlPath(lib)
returns the path of the librarylib
. Julia warns if it is not found and returns an empty string.
- jlDlSym: (%, JuliaSymbol) -> %
jlDlSym(lib, sym)
returns the pointer to the symbolsym
in the library referenced bylib
. See jlDlOpen. example{lnk:=jdlink “libjulia”} example{sym := jlDlSym(lnk,”jl_eval_string”)} example{TODO}
- jlId: % -> String
from JuliaObjectType
- jlRef: % -> SExpression
from JuliaObjectType
- jlref: String -> %
from JuliaObjectType
- jlType: % -> String
from JuliaObjectType
- latex: % -> String
from SetCategory
- mutable?: % -> Boolean
from JuliaObjectType
- nothing?: % -> Boolean
from JuliaObjectType
- string: % -> String
from JuliaObjectType