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

learn more… | top users | synonyms

2
votes
0answers
29 views

Install hangs for precompiled Cuba integration executable

I am trying to use the Cuba integration package in Mathematica 10.2 on a Windows 10 machine. However, having downloaded the supplied Vegas.exe MathLink executable, when I try running ...
3
votes
1answer
166 views

How could get all escape characters in Mathematica?

I am evaluating expression by using KernelLink. But the kernel will be suspended endless when meets a invalid escape character. ...
13
votes
1answer
297 views

Asynchronous Programming

Consider that you would like to listen for Raw WiFi Packets coming into your NIC. Since Mathematica doesn't have built-in functions for such low level programming (as far as I know), one alternative ...
1
vote
0answers
83 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 ...
1
vote
0answers
38 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 ...
5
votes
1answer
97 views

Initializing and keeping track of a large c++ object and reusing it from inside Mathematica

I have a c++ library function that calculates a distance between two vectors given an underlying matrix. ...
2
votes
0answers
51 views

Has anybody been able to build WSTP applications under Visual Studio 2015's IDE?

I recently picked up an old project involving WSTP (formerly MathLink) programs, and as a starting place tried to get the demos provided by Wolfram to compile. The instructions were dated, referring ...
0
votes
0answers
46 views

External app link closes when I attempt to use the link to it

I've been using Mathematica 5 and the Radia package. My code has over 50 cells, In Mathematica 5, Radia successfully is initiated at the first cell, and after that, results from it have been used by ...
5
votes
0answers
89 views

Echo server with Mathematica

Consider the following scenario: two wireless notebooks communicating via ad hoc one computer (the client) send packets via TCP protocol without Mathematica the other one is an echo server ...
5
votes
1answer
61 views

How to obtain the value of a single symbol with mathlink

I am trying to write a (C) routine which reads the value (a list) assigned to a single symbol in mathlink. I tried things like ...
1
vote
0answers
62 views

How to simplify writing MathLink code? [closed]

This wonderful question inspired me to ask the analogue for MathLink, which is now known as Wolfram Symbolic Transfer Protocol (WSTP). The basic example addTwo is over complicated and under useful.
12
votes
0answers
85 views

Control Front End in “mathlink” mode

Note: This question was already posted in the Wolfram community. In a terminal math session, we can start a front end (FE) easily by launching it though ...
1
vote
0answers
50 views

Installing feynarts diag [closed]

I'm trying to install this package: http://www.feynarts.de/diag/, I followed the instruction entering ./configure make make install but when I type ...
80
votes
6answers
6k views

Minimal effort method for integrating C++ functions into Mathematica

As of Mathematica 8, what is the minimal effort way to integrate an existing C++ function into Mathematica? I think we have these: MathLink (it was quite long ago I used it last time) communication ...
2
votes
1answer
47 views

Discard an entire (sub)expression on a MathLink link

Suppose that an expression like f[something, 12] was sent to a MathLink link, and we need to read off only the second part of ...
3
votes
2answers
174 views

WSTP hangs up in Mathematica 10.2

I have a problem with WSTP in the newest version of Mathematica. I get the same problem on Ubuntu 14.04 and Mint 17.2. Using the pre-built examples (...
11
votes
2answers
385 views

Connect Frontend to Kernel Started by JVM via JLink

I have a MathKernel started and controlled via JLink from a JVM. The $CommandLine for this kernel is: ...
3
votes
0answers
61 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 ...
1
vote
0answers
70 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 ...
3
votes
0answers
62 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 ...
10
votes
1answer
146 views

Fast way to pass an array of integers to Java using JLink

I am using a package from java to compress a list of integers, this package provide me two methods, one for compress and other one for uncompress. Each of these methods has a version to ...
3
votes
0answers
53 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 ...
13
votes
1answer
145 views

MathLink (WSTP) vs LibraryLink performance

Has anyone benchmarked LibraryLink vs MathLink when passing large arrays? Specifically I would like to know how performance compares when using the following to pass and return a large array: ...
4
votes
0answers
189 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 ...
35
votes
5answers
11k views

How to use Mathematica functions in Python programs?

I'd like to know how can I call Mathematica functions from Python. I appreciate a example, for example, using the Mathematica function Prime. I had search about MathLink but how to use it in Python ...
9
votes
2answers
121 views

Why does this LibraryLink example of LinkObject based passing not work? Bug or user error?

There's an example of LinkObject-based passing in the LibraryLink documentation. Unfortunately the cell in the documentation notebook is corrupted, but to skip ...
7
votes
0answers
99 views

What is the best way to transfer arbitrary-precision reals using WSTP?

I'm developing a Mathematica package, inside of which there is a number-crunching function. It uses a list of arbitrary-precision numbers as input and it takes a lot of time to do its job. So I've ...
5
votes
1answer
122 views

Using mathlink/WSTP with fortran

I would like to access Mathematica functions from within a Fortran program. I am unsure how to start (which is probably related to my lack of up-to-date Fortran knowledge). Is it necessary to write a ...
6
votes
0answers
73 views

How can I wrap a C++ object in WSTP?

I am trying to wrap a sophisticated C/C++ API in Mathematica using WSTP, but can't work out how to return a pointer to a C/C++ data structure. This object was created on the C/C++ side of the wrapper, ...
11
votes
1answer
520 views

WSTP broken by upgrade to 10.0.1?

Bug introduced v10.0.1 and fixed in 10.0.2 Everything was working fine with WSTP (the successor to MathLink) in 10.0.0. But I upgraded to 10.0.1 today and now I can't compile either my programs ...
6
votes
1answer
168 views

MathLink versus WSTP program

What is the difference between MathLink and WSTP programs? Will the use of MathLink protocol be maintained or not?
3
votes
1answer
136 views

Reconnecting to remote kernels through SSH tunnelling

This is a follow up question to How can I connect to a remote machine? and the excellent answer provided by ybeltukov. My system is now configured as described in the answer with my MacBook running ...
3
votes
1answer
79 views

Pass Real32 to Mathlink

I've written a Mathlink program that is called from Mathematica 9. It works very well but currently uses double precision numbers in the C++ function. I've already replaced them with floats in C++ ...
1
vote
0answers
77 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 ...
18
votes
3answers
453 views

Returning multiple results from a LibraryLink function

What is the best way to return multiple inhomogeneous results from a LibraryLink function? Imagine that the result of a single computation is several tensors of different dimensions and several ...
17
votes
2answers
403 views

MathKernel doesn't return all Messages

In Mathematica I run this command: Plot[Sin[x], {x, 1, 15}, GridLines -> error] It generates a Plot with this error message: A GridLines specification ...
2
votes
1answer
70 views

Parallel kernels cannot launch: LinkOpen::linke error [closed]

I have been regularly using parallel kernels on my machine but this morning all I receive is a cryptic error whenever I call any parallel function (LinkOpen::linke). As far as I can see sequential ...
1
vote
0answers
147 views

How to use Wolfram language in an external program with low latency?

Im using Wolfram language on Pi B,and I want to compile a '.m' file (like "test.m" that contains Wolfram functions), in an external program like a C/C++ and then Export the output in an image file ...
15
votes
1answer
368 views

What is the complete list of valid FrontEnd Packet types?

In response to my question How can I get the unchanged Box form of an arbitrary expression? John Fultz answered with a method using the hilariously named ...
11
votes
1answer
837 views

Example program for calling Mathematica from C

I want to call Mathematica from a C program. Suppose I have two numbers x = 2 and y = 3. I want to define ...
0
votes
2answers
68 views

NIntegrate fails when integrating over a list from an external (MathLink) function

NIntegrate fails when integrating over a list from an external (MathLink) function. For simplicity, consider an external function f[x] that returns the list {x,2x}. In Mathematica, the function would ...
4
votes
0answers
80 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 ...
0
votes
1answer
77 views

problems with wstp32 (WSTP / mathlink)

I've been recompiling old mathlink programs in Visual Studio 2013. No major problems so far until I got to a program that is seemingly similar to the others but that fails dramatically in the linking ...
3
votes
0answers
90 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 ...
1
vote
0answers
90 views

Calling a custom function in slave kernel process connected through mathlink [closed]

I am performing a small experiment to check if we can call/execute a custom package function in slave kernel launched from master using mathLink. I have created a dummy application called ...
2
votes
0answers
174 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) ...
3
votes
0answers
161 views

Generating Mathlink executables by CCompilerDriver

I'm trying to generate a MathLink executable by CCompilerDriver package. The MathLink ...
1
vote
1answer
181 views

Read expression from Mathematica via Mathlink C++

This is a simple C++ program to send an expression to the_Mathematica_ Kernel and get its response. ...
5
votes
1answer
86 views

WSTP Callbacks into CDF

Essentially, what I am trying to find out is the limitation of the WSTP/LINK protocols in Enterprise-licensed CDF. Specifically, are any callbacks to the kernel from those protocols allowed in CDF , ...
0
votes
0answers
88 views

Can't get the most basic WSTP demo (addtwo.c) to build and link. Help?

I am trying to use WSTP and started with the addtwo demo. I converted the template file to C using wsprep, then in Visual Studio 2013, added that, the addtwo.c file, the wstp libraries and the header ...