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
6
votes
0answers
62 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 ...
1
vote
0answers
75 views

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

How to link Mathematica and Fortran with WSTP?
4
votes
1answer
49 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 ...
5
votes
1answer
52 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 <...
1
vote
0answers
50 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 ...
6
votes
1answer
84 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. ...
1
vote
0answers
15 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 ...
3
votes
0answers
38 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, ...
1
vote
0answers
62 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 ...
1
vote
0answers
13 views

WSWaitForNewLinkFromLinkServer waits too long

Here's a snippet of C++ code: ...
1
vote
0answers
82 views

WSTP server with asynchronous callback in pure Wolfram Language

In this question, @Todd Gayley provided a nice snippet for WSTP server. ...
1
vote
0answers
82 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 ...
1
vote
0answers
30 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 ...
4
votes
1answer
275 views

Error LNK2019: unresolved external symbol WSEvaluate referenced in function

In the compile process of a C function written by using wstp.h library (Mathematica 11.3), an error (...
3
votes
0answers
60 views

How to use both WSTP and MathLink libraries? [duplicate]

We are in the process of writing a Mathematica library by using C language and WSTP library. We encountered a lot of problems like sending a message from C to Mathematica, implementing an argument ...
1
vote
1answer
37 views

Send an error message from a c function by using WSTP library

Consider that Func is a function written in c language by using WSTP library. In some situations, it can return an error to Mathematica. ...
1
vote
1answer
50 views

Return two arrays from a c function by using WSTP library to Mathematica in a special manner

I have two arrays. The first one is an array of integers, and the second one is an array of doubles. I want to write a c function to return these arrays by using WSTP library to Mathematica. I know ...
5
votes
1answer
73 views

How I can implement an argument which is an array of string by using WSTP library?

I have a c function named Func. Its argument is an array of strings. How I can implement this function by using WSTP library? ...
1
vote
0answers
46 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 ...
6
votes
1answer
140 views

How to send packed array from math kernel to 3rd party app via WSTP

Background I'm developing a small python wrapper PyWSTP. The wrapper is still in very early stage and lacking features. One important feature I'm considering is transferring dense array between math ...
3
votes
0answers
66 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 ...
2
votes
0answers
55 views

Publishing the result of a research related to development of Mathematica [closed]

We are developing a library in c language by using WSTP for Mathematica. Do you know a journal for publishing our results?
3
votes
1answer
88 views

How return an object of a struct from c to Mathematica?

I'm writing a c code by using WSTP library. In my c codes, I have a struct named Person, and I have a function named Foo, which returns an object of Person. ...
7
votes
2answers
198 views

Control a Mathematica kernel from the front-end and from python

I'd like to be able to start and control a Mathematica kernel/front-end from python and be able to evaluate things in a notebook and query results on the python side too. Is this possible?
2
votes
0answers
48 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 ...
7
votes
1answer
135 views

Bug in Mathematica 11.2 WSTP onwards - wstp.h defines only MLEvaluateString?

Bug introduced in 11.2 and persisting through 11.3 I maintain a C++ library with a WSTP interface to Mathematica. Some of my users have noticed that in Mathematica versions 11.2 and 11.3, they see a ...
5
votes
1answer
135 views

Current QuantLib implementation for Mac OS

Does anyone know of a current QuantLib implementation that can run on Mathematica version 10.3.0 (or higher) for Mac OS X x86 (64-bit)? About QuantLib: The QuantLib project is aimed at providing ...
3
votes
1answer
54 views

Why some Graphics cannot be captured by MathLink in NETLink?

I'm trying test on calling mathematica function from .NET application by running demo application MathKernelApp.exe which could be located at ...
10
votes
2answers
272 views

Link server WSTP API feature not receiving incoming connections

I'd like to apologize ahead of time that this may be a very long post but want to get all of this out there. Also, this post really only pertains to those with WSTP/MathLink experience. My problem ...
5
votes
1answer
98 views

Hide WSTP application from taskbar

I just updated a small MathLink program that I made a while ago, and recompiled it using the new WSTP system (Mathematica 11.2). ...
1
vote
1answer
88 views

Missing _MLDisownDoubleArray from libMLi4.a building MathLink with MEX

I'm trying to build MathLink on a Mac using Mex, according to the instructions included in the MathLink download. Unfortunately, when I compile ...
0
votes
0answers
75 views

WSTP Communicate to an external Mathematica Window

I am using WSTP to connect to Mathematica and get my computation tasks performed via WSTP Link. This connection is initiated with WSOpenArgcArgv. It looks like I am ...
3
votes
1answer
113 views

How to control which version of Mathematica .NET/Link uses

I have three versions of Mathematica installed: 7.0.1, 11.0.1 and 11.1.1 but my test .NET/Link application will only use version 7. In Visual Studio I have referenced the ...
5
votes
0answers
74 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 ...
11
votes
1answer
147 views

Why does LinkRead block when LinkReadyQ returns True?

The LinkRead documentation states: LinkRead will wait until it has read a complete expression before returning. You can ...
3
votes
2answers
138 views

Portable makefile for wscc builds

What's the canonical way to write a portable makefile for wscc programs? The makefile typically requires the location of the wscc...
3
votes
1answer
75 views

Linker warnings from wscc

I am building a Mathematica interface to my c++ program. My makefile and source are available at github. This is the line that invokes wscc, ...
1
vote
1answer
173 views

Trying to run J/Link SampleProgram.java from Mac Terminal: Exception in thread “main”

Trying to run the [WSTP J/Link SampleProgram.java][1] Mathematica version 11.0.1.0 file from the MacOS Sierra version 10.12.6 Terminal, generates "Exception in thread "main" ... Updating to Oracle ...
1
vote
1answer
80 views

How to return a list from a C++ mathlink function

If I wanted to return a list from a MathLink function, how could I do that? ...
2
votes
1answer
149 views

MathLink with Shaw's Complex Analysis with Mathematica

I purchased (some time ago) a copy of William Shaw's Complex Analysis with Mathematica, published in 2006. He uses MathLink (something I've never done before) to speed up a Mandelbrot application. ...
8
votes
0answers
148 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, ...
0
votes
1answer
99 views

WSTP simple function doesn't finish evaluating

I'm new to WSTP so I tried to write a small c program, similar to one of the examples in the developerkit and tried to execute the functions in Mathematica. I'm using Ubuntu 16.04 64bit by the way. I ...
5
votes
1answer
224 views

WSTP simplifying expression from C

I am looking to simplify arbitrary algebraic expressions by invoking the mathematica kernel from C using WSTP. My initial attempt was the following, which was based on the online documentation and the ...
3
votes
0answers
58 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, ...
3
votes
0answers
97 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: ...
1
vote
0answers
44 views

LinkOpen::links: Too many open links. >> error [closed]

I am opening iteratively an external program (executable) by using LinkOpen[]. After a certain number of iterations (more than 1000), I get the following error: ...
14
votes
1answer
989 views

C++ interface to large project

We are developing a quite large mathematical software in C++ and would like to have a Mathematica interface. We have our own C++ library and our idea would be, to write a Mathematica wrapper class and ...
1
vote
1answer
163 views

LinkConnect errors while connecting to remote kernel. Interactive commands fail

For a while I have a set-up running a Mathematica front-end on a Macbook and a remote kernel on a Linux (CentOS) computer. Recently something changed and I have issues with the remote kernel but I ...
6
votes
1answer
349 views

Is there a complete example of manipulating Mathematica expressions in an external C++ program?

I have been trying to use WSTP to call from C++ (MSVS 2010, Windows 7, 32-bit), a Wolfram Mathematica function in a package which I have created. From the following link, I understand that the key ...
4
votes
1answer
128 views

Can you trigger update of Dynamic elements from a LinkedLibrary?

Is it possible to write a LinkedLibrary (or WSTP executable) computing a function f such that Dynamic@f[] is updated when the ...