Timeline for How to use the library exported from FunctionCompileExportLibrary outside of Mathematic (e.g., in Visual Studio)?
Current License: CC BY-SA 4.0
17 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 22, 2020 at 12:30 | comment | added | Mauro Lacy |
@happy fish, you can solve the library path issues by setting LD_LIBRARY_PATH in the process environment: RunProcess[test, ProcessEnvironment -> <| "LD_LIBRARY_PATH" -> "/Applications/Mathematica.app/Contents/SystemFiles/Libraries/MacOSX-x86-64:" <> $CCompilerDefaultDirectory|>] . This works, but I'm now getting a segmentation fault each time I try to use a Kernel function.
|
|
Apr 24, 2019 at 9:40 | vote | accept | yode | ||
Apr 19, 2019 at 19:45 | comment | added | yode | I make a note for your answer in following answer but I don't get any reputation. Hope you don't mind the behavior. All honor should belong to you. | |
Apr 19, 2019 at 19:42 | comment | added | yode |
It's seem the name alway is Main . If we export two function into a .dll . How to call those? And can we export a noramal function(not pure function) now? Can we put two or more function into a .dll file?
|
|
Apr 19, 2019 at 18:19 | comment | added | ilian | No, definitely not documented. MTensor and MNumericArray have the same underlying representation. | |
Apr 19, 2019 at 16:54 | comment | added | Szabolcs |
What if the input or the output is an array? What would be the prototype of Main , and is this documented somewhere? Is it an MTensor or MNumericArray?
|
|
Apr 19, 2019 at 16:45 | history | edited | ilian | CC BY-SA 4.0 |
added 60 characters in body
|
Apr 19, 2019 at 14:39 | history | edited | ilian | CC BY-SA 4.0 |
added 11 characters in body
|
Apr 19, 2019 at 13:40 | history | edited | ilian | CC BY-SA 4.0 |
added 232 characters in body
|
Apr 19, 2019 at 13:36 | comment | added | ilian | @happyfish Yes, I'm using the Windows feature of looking for DLLs next to the executable. This can be made to work on Mac too, but it would need setting some rpaths and/or copying over some additional .dylibs. | |
Apr 19, 2019 at 10:19 | comment | added | vapor |
This method does not work on osx, got dyld: Library not loaded: @rpath/function.dylib Referenced from: ... Reason: image not found Abort trap: 6 on the generated executable.
|
|
Apr 19, 2019 at 6:16 | comment | added | sunt05 |
This is quite promising! I am curious about other valid settings in "CompilerOptions" , which seem to make this function more powerful! However, this is heavily undocumented...
|
|
Apr 19, 2019 at 6:15 | comment | added | sunt05 |
it is also discoverable by using nm -gU library.dylib under macOS.
|
|
Apr 19, 2019 at 3:53 | comment | added | ilian |
One way is to look at e.g. LibraryFunctionLoad[lib] // InputForm
|
|
Apr 19, 2019 at 3:36 | comment | added | yode | Fun, would mind to tell me how to know the name is 'Main'? It's seem not very explicit... | |
Apr 18, 2019 at 22:03 | history | edited | ilian | CC BY-SA 4.0 |
added 3 characters in body
|
Apr 18, 2019 at 20:37 | history | answered | ilian | CC BY-SA 4.0 |