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

13
votes
3answers
302 views
+100

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 ...
2
votes
0answers
19 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 ...
17
votes
2answers
380 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
37 views

Parallel kernels cannot launch: LinkOpen::linke error

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
112 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 ...
72
votes
5answers
5k 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 ...
13
votes
1answer
338 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
703 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
56 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 ...
1
vote
0answers
47 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
64 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
63 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 ...
0
votes
0answers
53 views

Calling a custom function in slave kernel process connected through mathlink

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 ...
1
vote
0answers
104 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) ...
11
votes
1answer
451 views

WSTP broken by upgrade to 10.0.1?

Bug introduced v10.0.1, fixed 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 (I've ...
3
votes
0answers
138 views

Generating Mathlink executables by CCompilerDriver

I'm trying to generate a MathLink executable by CCompilerDriver package. The MathLink ...
0
votes
0answers
39 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 by using EvaluatePacket have it ...
1
vote
1answer
145 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
80 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 , ...
4
votes
0answers
76 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 ...
0
votes
0answers
50 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 ...
2
votes
0answers
94 views

WSTP (formerly MathLink) problem

I recently set about to re-compile some old (2008-2009) applications that use MathLink in preparation for creating new, modified versions. Mathlink has been deprecated but WSTP seems like a fairly ...
2
votes
1answer
166 views

Cannot launch MathLink from C

I am trying to launch a MathLink from a 64bit C dll that I am building, using the following code: ...
3
votes
1answer
135 views

Convert C program using mathlink to WSTP

I have been using heavily a custom frontend to mathematica based on mathlink. I derived it from http://library.wolfram.com/infocenter/Demos/174/frontend.c?file_id=4692 . I just learned that mathlink ...
9
votes
1answer
264 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: ...
0
votes
1answer
844 views

Error message LNK2019, unresolved external symbol _output referenced in function __tr0

I've successfully compiled the simple addtwo function predefined in Mathematica as per: MathLink dependencies: "LNK2019: unresolved external symbol _MLMain" I am now attempting to write an ...
2
votes
1answer
139 views

MathLink dependencies: “LNK2019: unresolved external symbol _MLMain”

I am trying to compile the MathLink examples included with Mathematica. I am careful to ensure that the libraries are present in the Visual Studio folder as indicated by the installation manual. I am ...
6
votes
1answer
103 views

Tools for MathLink traffic analysis?

I noticed that the documentation for LinkSnooper says that it is "obsolete". I don't have any experience with this tool, but I thought it looked interesting after seeing results it was able to provide ...
0
votes
1answer
59 views

ml32i1m.lib and ml64i3m.lib Files

I have to install a package to use together with MatLab (http://www.mathworks.com/matlabcentral/fileexchange/6044-mathematica-symbolic-toolbox-for-matlab-version-2-0]1) that requires locating files ...
4
votes
1answer
205 views

How can I integrate Open-CV with Mathematica?

I would like to run Open-CV functions from within Mathematica, can anyone figure out how to do this?
2
votes
0answers
119 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 ...
5
votes
0answers
58 views

Any Progress with a Python MathLink? [duplicate]

I just want to asking if there any progress to connect Python with Mathematica Version 10 as Java or C, I mean a MathLink. I've been looking for a alternatives but I couldn't find it. Thanks,
1
vote
1answer
77 views

Mathlink compiling error MLPutReal32Array()

I have some c++ code I wrote in Windows that compiles and runs just fine. I was going to use it on a Linux machine but I am getting the error when I try to compile following the Makefile procedure ...
1
vote
0answers
92 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 ...
9
votes
1answer
120 views

Installing LinkSnooper on Windows

I tried to install LinkSnooper on my Windows 7 computer, as described in the documentation and here. According to the answer of @Todd Gayley, I entered the following string in the field MLOpen: ...
8
votes
1answer
193 views

How to use RunProcess to import external function?

I have a functions written in an external language called GO. How can I quickly load them into the kernel for use as Mathematica functions? The two ways I've tried are with MathLink and LibraryLink ...
2
votes
0answers
132 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 ...
2
votes
0answers
128 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 ...
5
votes
1answer
72 views

Changing MathKernel process priority on the startup

In the built-in Documentation there is an example how it is possible to change the priority of the MathKernel process using NetLink: ...
31
votes
5answers
9k 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 ...
4
votes
1answer
79 views

what's the meaning of “-mathlink” as part of Arg for LinkLaunch?

LinkLaunch["MathKernel -mathlink"] LinkLaunch["MathKernel"] The both code line above can launch a MathKernel. What's the difference of them? what's the meaning of ...
0
votes
0answers
40 views

what's the difference between CreateKernelLink() and CreateKernelLink(String Arg)?

I have a .NET program which will connect to MathKernel. When the program runs, there will be a icon of MathKernel on the taskbar. ...
0
votes
2answers
97 views

Is there anyway to use a named argument in calling mathematica from .NET?

I want to write a .NET program calling Mathematica as a computing engine. But here is a problem that argument a1 is not a constant and its value depends on ...
6
votes
0answers
189 views

MathLink error while calling a custom Mathematica function - MLGet out of sequence

I am trying to call Mathematica 10 from F#. Following the C# sample code found in the Mathematica directory, I have written the following F# code: ...
11
votes
1answer
378 views

Multiplayer game in Mathematica: how to communicate between kernels?

This may have been asked already, but I am considering making a game in Mathematica that two people can play. However, the issue with my idea is that the other player can't view the cards of the first ...
0
votes
0answers
116 views

Data acquisition from NI USB-6008, NI-DAQmx

I want to connect an interface from National Instruments to Mathematica in mac, i already download the driver Ni-DAQmx_Base_3.6 from NI page. How to tell Mathematica to dump data from the interface?
14
votes
1answer
822 views

Is it possible to use C# LINQ from Mathematica using .NET/Link?

Using Mathematica's .NET/Link (NETLink`) package, is it possible to call out to .NET's LINQ facilities for list manipulation and other operations?
2
votes
0answers
131 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 ...
23
votes
4answers
3k views

Efficiently determining if 3D points are within a surface composed of polygons

This is the 2nd part of a previous question which I edited to make into 2 separate questions: Extracting polygons from 3D contour plot surface As an extension of my earlier question involving simple ...