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.

56 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
19 votes
0 answers
1k views

How to protect existing MathLink connection from disconnecting

I am developing an application that consists of a Mathematica package and an external Java program. The purpose of the application is to read streamed data from a port and update a variable in the ...
user avatar
  • 191
10 votes
0 answers
1k views

ParallelTable kernels die - maybe Mathlink timeout?

I am new to parallel computing in Mathematica. I am using LaunchKernels[16] ParallelTable[] to parallelize calculations. The ParallelTable consists of approx ...
user avatar
9 votes
0 answers
772 views

Configuring remote access when using a VPN

To address some of the responsiveness issues, I use the Mathematica front end (v9 or v10) to access a remote kernel on a Raspberry Pi. The (advanced) kernel configuration used is this: Arguments to ...
user avatar
8 votes
0 answers
191 views

Remote kernels, Neural Networks and formatting of Dynamic content

Bug fixed in 11.2 I have a few GPU/CPU 'loaded' Linux boxes in my lab, used largely for rendering. I want to compare the new 11.1 Neural Network stuff to some Tensorflow things we do here. Of course, ...
user avatar
  • 1,760
8 votes
0 answers
267 views

Socket communication and player pro

I'd like to create a simple communication channel between MMA and the animation package 'Maya'. This is possible over sockets ( very simple, just sending and receiving strings). I've got this working ...
user avatar
  • 1,411
5 votes
0 answers
91 views

How to implement LinkLaunch-like functionality with timeout?

tl;dr: What is the best way (and correct sequence of operations) to connect two programs using MathLink while anticipating failures / timeouts? Launch program and connect, with timeout I have a ...
user avatar
  • 227k
5 votes
0 answers
111 views

Integrating WSTP/MathLink communication into existing main loop

I have a C++ application that does some interactive rendering, and I'd like to link it up with a Mathematica notebook with two-way communication (there are some tasks like drawing plots that are ...
user avatar
  • 8,574
5 votes
0 answers
297 views

MathLink Excel version 3.5 & 3.6 inconsistency

I bought and installed Mathematica Link for Excel 3.6.0. However, after installation, it appears inside Excel as Version 3.5.0. Has anyone seen this issue? I have emailed Wolfram support but have ...
user avatar
  • 71
5 votes
0 answers
79 views

At what point should MLSetMessageHandler() be called?

I have an Installable MathLink program written in C. I would like to use a custom message handler. At which point in the C source code should I call ...
user avatar
  • 227k
4 votes
0 answers
258 views

How to make an executable .jar connect to Mathematica

I am writing a Java Swing program which collects data and connects to Mathematica to do some computations. As other answers here suggested, I have included JLink.jar in the classpath, as well as the ...
user avatar
  • 41
4 votes
0 answers
194 views

MathKernel with `-noprompt` hangs indefinitely when converting simple TeX expression

If I enter MathKernel -noprompt -run 'ToExpression["1", TeXForm]; Exit[]' the kernel hangs, apparently while running TeX.exe ...
user avatar
  • 250
4 votes
0 answers
417 views

Mathlink and multithreading

In order to make my computations faster I have developed a C/C++ application calling Mathematica kernel and performing many operations using Mathematica functions for equation solving. Now I want to ...
user avatar
  • 421
4 votes
0 answers
156 views

How can I link the c library GAUL into Mathematica?

Is there a way to load the library GAUL (Genetic Algorithm Utility Library) for use within Mathematica?
user avatar
  • 30.6k
3 votes
0 answers
95 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 ...
user avatar
3 votes
0 answers
115 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, ...
user avatar
  • 720
3 votes
0 answers
77 views

WSGetUTF8Function missing in WSTP DLL

Bug introduced in 10.0 and persisting through 11.3.0 Note: MLGetUTF8Function is new in 10.0 (ML interface 4). Despite being in docs and ...
user avatar
  • 633
3 votes
0 answers
69 views

Building WSTP C++ code with MSVS 2013

Has anyone successfully built WSTP code using MSVS 2013 C++? When I followed the online documentation (based on MSVS 2012) in Mathematica 11.1.1, something seemed to be missing, because when I built, ...
user avatar
3 votes
0 answers
121 views

Performance speed of WSTP code

I have found that running the following WSTP code, using C++ (MSVS 2010, Windows 7, 32-bit) and Mathematica 11.1, takes about 0.8 Second: ...
user avatar
3 votes
0 answers
145 views

Showing Mathematica's dynamic UI in external Java programs

I want to run Mathematica from an external Java program and display an interactive app in my own Jpanel. Is it possible? When I tried using MathGraphicsJpanel, I am getting only the snapshot of the ...
user avatar
  • 315
3 votes
0 answers
69 views

WSTP/MathLink: Transfering long lists (that require 64bit for index range)

I am using WSTP to call external C-Code from a Mathematica 10.2 session on a Linux-x86-64 system. The routine WSGetReal64List(WSLINK link,double **a,long *n) seems ...
user avatar
  • 31
3 votes
0 answers
256 views

Is it necessary to close MathLink connection?

I use WSTP (formerly known as MathLink) program LoopTools (here is the link with executables and source: http://www.feynarts.de/looptools/). To create connection within Mathematica, I use command <...
user avatar
  • 202
3 votes
0 answers
303 views

Generating Mathlink executables by CCompilerDriver

I'm trying to generate a MathLink executable by CCompilerDriver package. The MathLink ...
user avatar
  • 827
3 votes
0 answers
202 views

FrontEndTokens, MathLink, and Serializer.exe

I have been using some basic MathLink programming in my work and wanted to create some more sophisticated MathLink programs. I came across the book "MathLink: Network Programming with Mathematica", ...
user avatar
2 votes
0 answers
69 views

Update Matrix entry from Java

I found the following example online (which works fine) for sending commands from Java: ...
user avatar
  • 291
2 votes
0 answers
155 views

WSTP server with asynchronous callback in pure Wolfram Language

In this question, @Todd Gayley provided a nice snippet for WSTP server. ...
user avatar
  • 633
2 votes
0 answers
56 views

connecting to an existing application's C API from Mathematica

I have a general question about accessing the contents of an existing application's C API (https://libfive.com/) from Mathematica. Can it be done, and some hints on how? I am about to embark on ...
user avatar
  • 53
2 votes
0 answers
257 views

Example program WSTP Mathematica 10.3

I am writing a Fortran program and I want to use Mathematica functions form within. I know that a C wrapper should be written first, but I do not know how to proceed further. Basically I want to call ...
user avatar
  • 284
2 votes
0 answers
674 views

MathLink error msg: Libraries are not installed or outdated

I installed Mathematica 10.2.0.0, Excel 2013 32-bit, and MLink for Excel 3.6.0. In Excel, I added Mathematica Link in Add-Ins, and included the C:\ProgramData\Mathematica\ folder as a Trusted Location....
user avatar
  • 71
2 votes
0 answers
221 views

How can I launch kernels in series using mathlink

I have written below code to launch n kernels connected to one another in series using mathlinks. Before you read the code allow me to be more precise what i want to achieve: Source kernel(k1) will ...
user avatar
  • 609
2 votes
0 answers
249 views

webMathematica - MathLink linkname missing or malformed

I just installed webMathematica on Linux Debian + Tomcat7 + Mathematica 9.0. I'm getting this error web testing any example. HTTP 403 - MathLink linkname missing or malformed. The error is also ...
user avatar
  • 342
2 votes
0 answers
217 views

Mathlink program with low cpu usage on linux machines only

Question I am incorporating some c++ code via Mathlink into my simulations in Mathematica. My questions involves the execution efficiency of the c++ code on different machines. For example, on my ...
user avatar
2 votes
0 answers
198 views

Calling Mathematica from Lazarus/Freepascal

I will appreciate if anyone can give me an hint about freepascal and mathematica mathlink communication. I'd like to build a Form using Lazarus/freepascal that call mathkernel. I'm trying to move ...
user avatar
  • 679
1 vote
0 answers
67 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 ...
user avatar
  • 151
1 vote
0 answers
51 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 ...
user avatar
  • 1,436
1 vote
0 answers
27 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# ...
user avatar
  • 111
1 vote
0 answers
232 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? ...
user avatar
  • 111
1 vote
0 answers
46 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....
user avatar
  • 11.4k
1 vote
0 answers
184 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: ...
user avatar
  • 8,377
1 vote
0 answers
183 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 ...
user avatar
  • 8,377
1 vote
0 answers
162 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 ...
user avatar
1 vote
0 answers
19 views

WSWaitForNewLinkFromLinkServer waits too long

Here's a snippet of C++ code: ...
user avatar
  • 633
1 vote
0 answers
375 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 ...
user avatar
1 vote
0 answers
69 views

How can I launch GenerateDocument with a template file on multiple kernels in a batch fashion?

I am trying to do automated testing of my MMA package by launching test cases that are generated on-the-fly with GenerateDocument and a template document, and then evaluated with NotebookEvaluate. I ...
user avatar
  • 1,285
1 vote
0 answers
57 views

How does the mainloop know how to respond to a given packet?

In the MathLink / WTSP mainloop different packets get passed to a kernel in "MathLink mode" and the kernel has a specific response for each. I can guess how the kernel picks a response, generally, but ...
user avatar
  • 45.6k
1 vote
0 answers
304 views

Issue with WSTP

I'm trying to get Pythonika to work once again - with the latest version of the WSTP. The changes required are not many, basically just three: Change ML to WS Change mprep to wsprep Change mcc to ...
user avatar
  • 30.6k
1 vote
0 answers
148 views

Mathematica interoperability with Max/MSP

A little foreword: I'm an absolute beginner of Mathematica (but I'm a programmer in other languages/software). Now the question: I have a Mathematica Notebook written by a friend of mine which takes ...
user avatar
  • 111
1 vote
0 answers
145 views

Retrieve rendered graphics via WSTP

I am planning on using Mathematica as calculation and rendering backend for an application, i.e., call Mathematica via WSTP and use EvaluatePacket to have it ...
user avatar
  • 3,675
1 vote
0 answers
250 views

choose a WSTP program to launch

When I run an external program(compiled by Visul C++ 2012 in windows 7) to use the wolframkernal by WTSP, for example:project1.exe -linkmode launch,it will open a dialog box named "choose a WSTP ...
user avatar
  • 11
1 vote
0 answers
140 views

How to get the value of the answer that computed by calling Mathematica function from .NET program?

...
user avatar
  • 135
1 vote
0 answers
130 views

Set form of all output to InputForm

I try to interact with mathematica using MathLink for symbolic computations. By default it returns strings such as 2\012-1 + E\012-------\012 3\012 E if the ...
user avatar
  • 1,630