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

35
votes
1answer
1k views

Transferring a large amount of data in parallel calculations

This question is inspired by one of @whuber's answers Consider the following code: ...
66
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 ...
30
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 ...
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 ...
24
votes
3answers
1k views

Calling IronPython code from Mathematica

I'd like to call some IronPython code from Mathematica using .NET/Link. The problem is that the code lives in .py files, yet from Mathematica I can only load .NET assemblies which are DLLs. So it ...
15
votes
2answers
331 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 ...
9
votes
1answer
368 views

Passing back “NaN`” and “Inf`” to C via MathLink

In the "usual" double representation of floating point numbers in C there is a NaN and an ...
12
votes
1answer
868 views

How to run mathlink external commands in parallel?

I have an external function called increment (for the sake of illustration) that I call from Mathematica using MathLink. I.e., ...
14
votes
5answers
1k views

Connecting to and disconnecting from a continuously running kernel, on demand

I realized that there are lots of advantages to driving C/C++/FORTRAN code directly from Mathematica as LibraryLink functions (instead of running them from the command line or a shell script, as I ...
8
votes
1answer
1k views

Using Mathlink with the cernlib FORTRAN package MINUIT

I could successfully use Mathlink to call a simple fortran subroutine. However, when I went to a realistic problem, I failed. To be specific, I want to fit a set of data with some function using the ...
11
votes
1answer
670 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 ...
11
votes
1answer
372 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 ...
9
votes
2answers
373 views

Is it possible to set a timeout for LinkWrite[]?

This came up in relation to this answer Is it possible to set a timeout for LinkWrite? LinkWrite seems to block until the sent ...
11
votes
1answer
328 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 ...
9
votes
3answers
274 views

Using LinkSnooper for monitoring the communication with an installable MathLink program

How can I monitor the communication between an installable MathLink program and the kernel? Can LinkSnooper do this?
12
votes
1answer
315 views

using MathLink for communication with external program from my C program without Mathematica

I have a compiled program with MathLink. I want to use it from other C program, without Mathematica being involved at all. If i create my program with MathLink and connect to this external program, ...
11
votes
1answer
2k views

Write C/C++ programs calling Mathematica functions

I need to write a C/C++ program and call some functions in Mathematica especially those like Solve or NDSolve. The problem is ...
9
votes
1answer
113 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: ...
9
votes
1answer
291 views

Suppress Mathematica Kernel taskbar tab when using .NETLink

Is there a possibility to suppress the Mathematica Kernel taskbar tab when accessing it through .NETLink on Windows?
2
votes
1answer
125 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 ...
17
votes
1answer
661 views

Calling Mathematica from Visual Studio - example

I am trying to set up a connection between Visual Studio 10 and Mathematica 8.0 on a Windows system. I found several sources of information on the Wolfram website, but I get entirely lost. Most of the ...
8
votes
1answer
186 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 ...
11
votes
2answers
605 views

Correct way to handle mysterious NaN` result from MathLink function

I have a Mathematica expression that is mapped onto an external C function via MathLink. The external function passes a ...
9
votes
1answer
404 views

Running .NET/Link on Mono (On MacOS or any UNIX or Linux Distro)

Has anyone have any luck running .NET/Link on Mono? When I run .NET/Link to call Mathematica from within a Mono program, this is the error message I receive. ...
8
votes
2answers
253 views

Type conversion: LibraryLink mint vs. MathLink integer type

Assume the following situation: I have a WolframLibrary function which gets as parameter an integer tensor (which is for simplicity of rank 1) and the function should return an integer list through ...
9
votes
3answers
15k views

MathLink linking error after OS X 10.9 (Mavericks) upgrade

After macosx 10.9 mavericks upgrade i have a compilation problem, you can see below. Even the examples given in ...
4
votes
2answers
417 views

Cannot call custom function loaded from script using C/C++ MathLink

I am using MathLink with C/C++ on a Unix system in order to call a Mathematica (version 9) function and get the result. The function I need to call is a personal function of mine ...
3
votes
2answers
461 views

MathLink and CDF

So far I have read that some things are not supported in CDFs. Istvan-zachar mentioned very useful things in his post. Unfortunately he mentioned that MathLink operations, including J/Link and ...
6
votes
1answer
135 views

LinkSnooper troubles on Windows

I'm trying to get LinkSnooper up and working on a Windows 7 machine to monitor the interaction between the Mathematica front end and MathLink. I'm facing great troubles following the instructions ...
6
votes
1answer
389 views

Using “Raw MathLink Connections” to create a “Kernel Object”

Mathematica 8.0.0: I am stuck trying to get a Mathematica Mathlink connection from my Windows computer working that should connects to Linux over network (or vice versa) and then launches a Kernel on ...
1
vote
2answers
213 views

MathLink Graphical Output (Plots) to File

In a custom Mathematica frontend based on MathLink I try to make use of plots produced in Notebooks. The idea is to write them to files whenever they get produced. According to C-code snippets I ...
11
votes
1answer
449 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 ...
10
votes
3answers
277 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 ...
7
votes
1answer
965 views

How do you get high resolution plots in applications using the Mathematica MathService?

This is for Mac users only using MathService (MathService it seems, given that it was created back in 2004, is a power pc code and requires Rosetta to run on Intel). If I type a plot command in ...
3
votes
0answers
137 views

Generating Mathlink executables by CCompilerDriver

I'm trying to generate a MathLink executable by CCompilerDriver package. The MathLink ...
6
votes
0answers
176 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: ...
3
votes
1answer
822 views

MathLink compile errors

Don't you just love it when your computer is working fine, you work with some good examples, everything is wonderful and your relationship with your computer is the best? I do. But what happens when ...
2
votes
1answer
126 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 ...
2
votes
0answers
125 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
1answer
155 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: ...