Import a dll function in Mathematica?

Sorry for my English. I did a library with LibraryLink. It’s possible avoid every time I startup Mathematica to execute the notebook that compile the dll files and load it to use the imported function?

You can compile it once, then create a plain text .m file (a package file) that contains all the LibraryFunctionLoad commands for it. Then you can simply load that file using Get.

Do you mean ?

that allows a two way exchange over a unix (file/stream) socket called a LiinkObject (which also is used for remote kernels, remote kernels speak the same link language on the socket, per say)

HOWEVER you said memory and that depends. you can copy the data over the link (i’m unsure if your avoiding that so will continue …)

You could return a unix shared memory location to a mathematica program that can directly read user space memory. if it’s CL video card data then that memory is shared.

BETTER: is copy only a filename over the link containing data which is on a memory drive made in shared memory. now your (other side, a notebook) can poke (bytes) of data from the file after opening file without ever the whole file being copied over the link

On a modern system files are cached very well and if used temporarily never are committed to (slow memory or drive), so you really don’t need the trouble of insuring file is located on a shared memory drive I think.

In the Unix world there is an old saying: “everything is a file”.

Hello,
I tried to build a package that load a dll but when I call the package function I get the following error (screenshot with error)

If I tried to copy the body of package function on notebook and it work.

This is my package file “meshAlgorithms.m”

BeginPackage["meshAlgorithms`"]

AdjVertex::usage = "adjVert=adjVertex[v, f] returns a list adj vertex";
Begin["`Private`"]

partitionRagged[v_List,l_?VectorQ]:=MapThread[Take[v,{#1,#2}]&,Module[{a=Accumulate[l]},{a-l+1,a}]]
unpack[packed_]:=With[{len=Round@First[packed]},partitionRagged[packed[[len+2;;All]],Round[packed[[2;;len+1]]]]]

AdjVertex[v_,f_]:=Module[{l={},lib,vertexAdj},
lib=FindLibrary[ "vertexAdj"];
vertexAdj=LibraryFunctionLoad[lib,"vertexAdj",{{Real,2},{Integer,2}},{Integer,1}];
(unpack[vertexAdj[vdata,idata]])];

End[]
EndPackage[]

Sorry I wrong to call function vertexAdj[vdata,idata] instead of vertexAdj[v,f]…