Questions tagged [librarylink]
Wolfram LibraryLink provides a powerful way to connect external code to Mathematica, enabling high-speed and memory-efficient execution.
170 questions
2
votes
0
answers
71
views
RemoteRunProcess failing to establish an SSH connection
I have a notebook with a workflow that I use to update several servers. I have used it many times and I know it works. Until today. For some reason the ...
1
vote
0
answers
94
views
A strange problem with GeoElevationData
I encountered an issue with the GeoElevationData function (version 14.2.1, Windows 10 Pro version 2009). In a fresh instance of Mathematica, the example
...
8
votes
1
answer
569
views
Pure C++ code vs LibraryLink
Suppose we have two implementations of the same algorithm:
A standalone C++ program, compiled into an executable.
A C++ library, which is loaded and invoked from within Mathematica.
In practice, ...
0
votes
1
answer
208
views
Internal error thrown by some functions in Mathematica on Windows
I have been using Mathematica For Desktop v14.2 since its release on several machines running Windows 10 and several running Windows 11. Everything works absolutely fine except for one PC running ...
3
votes
1
answer
201
views
Making faster extraction of table elements in Mathematica or beyond
Consider the following code:
...
2
votes
0
answers
80
views
Is it possible to use external functions in CompiledLayer?
I am trying to build a custom layer for my neural network that can perform its computation on the GPU. The function is to be written in C and loaded in Mathematica via the LibraryLink. Is it possible ...
2
votes
0
answers
137
views
A question about using .dll in Mathematica with LibraryFunctionLoad
I am trying to use a custom trilinear interpolation written in C in Mathematica (Windows).
This is the code I start with:
...
14
votes
3
answers
518
views
ForeignFunctionLoad / RawMemoryAllocate and c-struct that includes an array
I have an external c-function I need to call, and I wish to use ForeignFunctionLoad.
The c-function, foo, takes as an argument a reference to a struct, for example:
...
0
votes
0
answers
94
views
Qualitative question: can the code matching the given patterns be made significantly faster if being written in pure C?
I made some code in Mathematica that I compiled in C. It involves operations such as looping inside While, custom random sampling from particular distributions, and ...
5
votes
0
answers
157
views
Are ForeignFunction and its friends the next generation of LibraryLink?
It's a bit surprising to me that no one asks about this so far, so let me step up :) .
In version 13.3, an EXPERIMENTAL Foreign Function Interface has been introduced. I'm by no means a C expert, but ...
2
votes
0
answers
78
views
Why I can't install this package [closed]
I am trying to run C++ in Mathematica. I got a package "LTemplate" from the answer from Szabolcs in this post: How to simplify writing LibraryLink code?. However I can't install it.
This is ...
3
votes
0
answers
121
views
GSL multiroot finding mode Hybrid function load with Mathematica : Crash
Hi everyone
I work on a Mac M1 Sonoma 14.3 with Mathematica 12.3.1 and 14.0
I have an issue when using a C++ multiroot finding from GSL library.
I used this example : https://www.gnu.org/software/gsl/...
2
votes
0
answers
164
views
How to load a .dylib library (C++ not compile with Mathematica library) on Mac with Mathematica?
I work on a mac M1 with MacOS Sonoma and i use Mathematica 12.3.1 and 14.0
I wanted to ask if there is a way to load a .dylib library on Mac with Mathematica, which was compiled without using the ...
2
votes
0
answers
62
views
Checking debug mode in C-code when call CreateLibrary with Debug -> True
I create a C-library and compile it using the tools in LibraryLink. When I create a code binary like this
...
2
votes
1
answer
137
views
Exported function discovery with LibraryFunction
Many internal calls boil down to invocations like
LibraryFunction["path/to/library", "funcName" , ...]
I'm on a mac, so I can use the ...