Skip to main content

Questions tagged [mathlink-or-wstp]

MathLink is a suite of Mathematica functions that implement a protocol for the communication/interfacing of Mathematica with external programs.

Filter by
Sorted by
Tagged with
1 vote
0 answers
40 views

How to print multiple lines back to Wolfram from external C program?

I am developing a WSTP application using C and for debugging purposes, I am trying to print back multiple messages on to the kernel. This is what I have tried so far: ...
Sâu's user avatar
  • 555
1 vote
0 answers
22 views

How to handle unsigned long integers when returning values from C?

This is my function in C: uint64_t f(){ return 2147483648; } This is my function template specification: ...
Sâu's user avatar
  • 555
2 votes
0 answers
47 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 ...
Alex's user avatar
  • 51
0 votes
0 answers
36 views

The mcc command generated program segfaults

I am trying to get FormCalc to work with FeynArts, the only problem is that the ReadForm program that is required for FormCalc to work compiles fine but segfaults... I am using Mathematica 14, should ...
user15032639's user avatar
3 votes
1 answer
69 views

How to display the terminal for a WSTP program

I have a need for integrating/running C++ code in Mathematica. To this extend I've been using MathLink, and now since sth like 10 years WSTP. I have created tooling for using C++ the C code in the ...
gaohan's user avatar
  • 41
0 votes
0 answers
49 views

On MacOs, I cannot use Needs["QDENSITY`Qdensity`"]

I am trying to get Needs["QDENSITY`Qdensity`"] from (https://library.wolfram.com/infocenter/MathSource/5715/), however, it failed and I get this error: ...
Xui Lao's user avatar
18 votes
1 answer
713 views

Fast Hankel Function in Mathematica

I am working on a project that requires repeated calls to HankelH1[0, r] for $r$ spanning the full real axis. When I use the mathematica routine, it can be as much ...
JonBean's user avatar
  • 183
0 votes
1 answer
103 views

Error "cannot find the required native library named JLinkNativeLibrary"

I have a problem running my test program on linux. I want to connect to mathematica kernel using java API. On windows, I put both jlink.jar and JLinkNativeLibrary.dll next to my executable file, let's ...
Azzurro94's user avatar
  • 499
0 votes
1 answer
161 views

Call executable .exe in C

I would like to improve my Mathematica code by executing some function in C, since it is way faster. The flow would be: Mathematica: generate inputs and store in .dat file, then call .exe previously ...
Cairo Martins's user avatar
4 votes
0 answers
71 views

Inserting data into a mathlink slave kernel via Table

I'm trying to perform a computation that will: Be long on my machine (I estimate 24-48 hours) Consume a lot of memory Generate ~1 gig of data at the end To manage the calculation I'd like to chunk ...
Haer'Dalis's user avatar
1 vote
0 answers
85 views

In version 13, WSTPServer cannot execute LaunchKernels[]

When I execute LaunchKernels[] or Kernels[], I get the following errors.The output of Kernels[] is {}. "WSTPServer" is not among the known evaluation environments {Session, RemoteSession, ...
Mather's user avatar
  • 11
1 vote
1 answer
79 views

Cannot render boxes from WSTP C++

I am attempting to send text from a WSTP C++ backend to the Mathematica kernel which should be parsed and rendered as boxes. The goal is for the user to see the ...
Anti Earth's user avatar
  • 1,211
5 votes
1 answer
111 views

Detect front-end Abort in C WSTP process

I have a long loop in a C WSTP process, within which I intermittently check for abort messages sent by the front-end: ...
Anti Earth's user avatar
  • 1,211
1 vote
0 answers
108 views

It is possible to call C functions with pointers as arguments in Mathematica?

Here is my goal: I want to call external library functions, written in C (not by me), in Mathematica. I may have found a way to do it using LibraryLink by following this scheme: First, for each ...
User3000's user avatar
  • 311
2 votes
0 answers
92 views

How can we call Mathematica functions from another server using the `wolframscript` Python library?

How can we use the wolframclient Python library to call Mathematica functions when Mathematica is running in an another server? For example, if we have Mathematica ...
GarouDan's user avatar
  • 1,536
1 vote
0 answers
36 views

MathKernel.exe not being killed while running from .NET C#

I am using Mathematica from .NET (C#) to compute the result based on some input, following is the code snippet of C# ...
Mohsan's user avatar
  • 111
4 votes
1 answer
129 views

Change DataStructure (or maybe just a symbol) from JLink/Java program

I try to use JLink and Java program for receiving responses from the abstract WebSocket server. WSS not supported by Wolfram Language now, but I can use this java project + JLink for the creating a ...
Kirill Belov's user avatar
2 votes
0 answers
405 views

Problem Using Remote Kernel

Problem The success rate of connecting to a remote kernel is only 30%. And no matter success or not, it takes 5 mins for Mathematica to give me a result! Is there anyone who has tried this function? ...
Youran's user avatar
  • 121
0 votes
0 answers
99 views

MathLink related error on HPC

Most of the times, Mathematica gives the following error for the jobs submitted on multiple nodes in queue: ...
Schrodinger's user avatar
0 votes
1 answer
130 views

cannot launch the Visual Studio C++ Mathematica program on debug mode, only on release mode!

Edited I am trying to run a C++ program on Visual Studio. this program needs to connect to mathematica kernel. assume any simple program, no matters. something like this code. I added and linked ...
Azzurro94's user avatar
  • 499
1 vote
1 answer
199 views

Run a code in Fortran, C++, or Python in Wolfram Mathematica 12 on Mac OS [closed]

I would like to run an external code, written in Fortran, C++, or Python, within Wolfram Mathematica 12 on my MAC OS. I looked up on Internet and I tried to read the WSTP documentation on Wolfram ...
VDF's user avatar
  • 453
2 votes
1 answer
173 views

WSTP connection does not connect on windows

I am new in mathematica programming. Actually referring this link, I tried to connect to kernel from c++ program on Windows with visual studio. I copied all these .exe files in related folder which i ...
Azzurro94's user avatar
  • 499
2 votes
1 answer
327 views

error LNK2019: unresolved external symbol _WSInitialize

I tried to run very simple example of connecting to WSTP. I checked a few links in this site but none of them could resolved my issue. I added three .lib files to visual studio location from this link ...
Azzurro94's user avatar
  • 499
1 vote
0 answers
63 views

Substitute for MathLink to integrate PARI with Mathematica?

How does one access MathLink with current version of Mathematica? I'm trying to integrate the "computer algebra system" PARI with Mathematica, as documented at https://pari.math.u-bordeaux....
murray's user avatar
  • 11.9k
2 votes
0 answers
78 views

Update Matrix entry from Java

I found the following example online (which works fine) for sending commands from Java: ...
Gouz's user avatar
  • 291
3 votes
1 answer
96 views

IMO WSTP does not work with the Visual Studio 2019 tools, can you prove otherwise?

Can LINK addtwo.obj addtwotm.obj wstp64i4.lib /OUT:addtwo.exe actually work with Visual Studio 2019 tools, if so how? ...
nilo de roock's user avatar
2 votes
2 answers
323 views

Where to place the essential WSTP files in Visual Studio 2019?

I have Visual Studio for C installed in : C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC From https://reference.wolfram.com/language/tutorial/WSTPDeveloperGuide-Windows.html : "...
nilo de roock's user avatar
2 votes
2 answers
247 views

LinkOpen::linke: Specified file is not a MathLink executable. in AceGen

I tried to run AceGen/AceFEM on my Mac(10.15.5). I installed Mathematica (12.1.0.0) successfully and also the latest version of the AcePackage (7.113). The installation of the AcePackage is successful,...
Carina's user avatar
  • 23
3 votes
1 answer
268 views

How to get information from all built-in Mathematica functions in order to create a Kotlin library like the Wolfram Client Library for Python?

I'd like to use (if this already exists) or create a library to use Mathematica together with Kotlin (or Java) (not JLink, please see below). We already have this very useful implementation for ...
GarouDan's user avatar
  • 1,536
2 votes
1 answer
81 views

What is the use of explicitly calling EvaluatePacket?

I noticed that many examples of C code for communicating via MathLink with the Mathematica kernel first pass an EvaluatePacket call to Mathematica, like this: ...
Jasper Koning's user avatar
5 votes
1 answer
85 views

ProgressIndicator during a WSTP C function

My WSTP package includes some C++ calculations which can take a long time. I'd therefore like to display a ProgressIndicator during this calculation, the progress ...
Anti Earth's user avatar
  • 1,211
0 votes
1 answer
75 views

Create error Message with runtime value

I've written a Mathematica package (see here) which uses WSTP to call a C/C++ library. Some possible user-errors are known by the package and can be detected and reported by the front-end package code....
Anti Earth's user avatar
  • 1,211
3 votes
1 answer
161 views

Callable interface

I have a c++ program that generates large numbers of small graphs (millions). I would like to remove graphs that are isomorphic to each other so I am thinking about trying to use the callable ...
Neill Clift's user avatar
1 vote
0 answers
190 views

How to get physical memory addresses out of WSTP?

Appologies this is a very stupid question since I am learning c and wstp's input outputs. Suppose I have a template file as follows: ...
user13892's user avatar
  • 9,443
1 vote
0 answers
217 views

What is the best setup for creating WSTP Programs?

I am relearning C++ so I can create C++ programs and run them inside Wolfram Language. I am installing the environment for writing C++. Can someone suggest the best and minimalist one which works best ...
user13892's user avatar
  • 9,443
5 votes
1 answer
176 views

Passing an image to Kernel via NETLink

I have created a specialized image analysis method in Mathematica that takes an image and returns a marked up image with some detection output. In order to allow others to feed images into my ...
ahhhh's user avatar
  • 305
5 votes
1 answer
211 views

Can I distribute Wolfram.NETLink.dll with an open-source project?

I am developing an open-source suite of Windows Workflow Foundation activities for the Wolfram Language to use with UiPath, a Windows automation platform. I built it using the Wolfram.NETLink library. ...
Joe Iaquinto's user avatar
8 votes
1 answer
509 views

How to call the Wolfram Engine from swift?

I'd like to call the Wolfram Engine within a swift project in Xcode. Are there any known methods or available resources on how to do this? I'm hoping to include it as a resource library for use inside ...
user5601's user avatar
  • 3,625
2 votes
2 answers
434 views

How to detect when the evaluation queue is empty?

Mathematica provides $Post, whose value, if set, is applied to every output expression. In particular, if one sets ...
Andrew Norton's user avatar
1 vote
0 answers
182 views

Can we link Mathematica and Fortran with WSTP? [closed]

How to link Mathematica and Fortran with WSTP?
Prabhakar Namdev's user avatar
4 votes
1 answer
72 views

MathLink: What is the difference between MLPutNext and MLPutType?

What is the difference between MLPutNext and MLPutType (also called WSPutNext and WSPutType)? Their documentation is virtually ...
Szabolcs's user avatar
  • 235k
5 votes
1 answer
115 views

MathLink: How do I send a bigint?

Suppose I have a big integer from some library such as GMP. I need to return this from a LibraryLink function. What is the most efficient way to do it? The simplest way is to convert it to a string <...
Szabolcs's user avatar
  • 235k
1 vote
0 answers
85 views

Using WSTP to connect a C process to local and remote kernels simultaneously [closed]

Is it possible for a C program to communicate (via WSTP) with both a Mathematica kernel running on its machine, and a remote one? For context: I use a local Mathematica kernel which talks to a remote ...
Anti Earth's user avatar
  • 1,211
6 votes
1 answer
198 views

MathLink: How to change the default listening IP address?

I have multiple VPNs, one gives local IP address 10.8.0.6 and another is 10.2.3.2. Now I wish to access machines in 10.2.3.x but Mathematica listens in 10.8.0.6 which is not known for those machines. ...
Turgon's user avatar
  • 1,050
3 votes
0 answers
131 views

Unknown Math error while creating a WSTP link

When I was executing this code link = LinkCreate[LinkProtocol -> "TCPIP"] I was getting the response as "LinkOpen::linke: Unknown MathLink problem ...
Kr Sudharsan's user avatar
3 votes
0 answers
150 views

WSTP HTTP interface

Wolfram's website mentions a "one-way" HTTP WSTP interface (https://www.wolfram.com/wstp/ ) One-way connection to the Wolfram Language is supported through HTTP in many languages, including PHP, ...
Dan's user avatar
  • 870
1 vote
0 answers
205 views

WSTP with an MPI application

I'm looking to use WSTP to make functions defined in a C MPI application available to a remote Mathematica kernel. I've got this working for a non-MPI version of the application, but now wish to have ...
Anti Earth's user avatar
  • 1,211
1 vote
0 answers
19 views

WSWaitForNewLinkFromLinkServer waits too long

Here's a snippet of C++ code: ...
kh40tika's user avatar
  • 684
2 votes
0 answers
186 views

WSTP server with asynchronous callback in pure Wolfram Language

In this question, @Todd Gayley provided a nice snippet for WSTP server. ...
kh40tika's user avatar
  • 684
1 vote
1 answer
694 views

“LinkConnect::linkc: -- Message text not found” on startup, removing ~/.Mathematica helps

We have a university license of Mathematica. In /usr/remote/Wolfram/Mathematica/10.3/Configuration/Licensing/mathpass on all the Debian 9 systems we have the ...
Martin Ueding's user avatar

1
2 3 4 5 6