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 the remote end (which I want to use to do some calculations on my Windows PC or vice versa).

For local connections it works on both operating system and I can use this Mathlink connection to launch a Kernel:

Needs[ "SubKernels`LinkKernels`"]
kernel = FileNameJoin[{$InstallationDirectory, "MathKernel.exe"}];
link = LinkLaunch[kernel <> " -subkernel -mathlink"]


I have already tried to create MathLinks on one computer (let's say IP: where the kernel is launched with:

(*Computer which creates the remote link*)
kernel = LinkLaunch[First[$CommandLine] <> " -mathlink"];
    LinkWrite[kernel, Unevaluated[$ParentLink = LinkCreate["8000", LinkProtocol -> "TCPIP"];]]

But I cannot access this link when I use:

(*Computer which wants to use the remote link*)
link = LinkConnect["[email protected]", LinkProtocol -> "TCPIP"]
LinkWrite[link, Unevaluated[$ProcessID]]

Somehow I am also missing authentication informations for the computer which wants to connect in my code but I did not get an example which shows me where to state these credentials.

  • 2
    $\begingroup$ I see you were new, when you posted your question. Have you read the FAQ of our site? If an answer helps you, you should upvote it. If it solves your problem, you should accept it. And if you want to discuss details, use the comment-function here or go to chat. Doing nothing might be considered as rude and it's unlikely (at least the same) people help you again. $\endgroup$
    – halirutan
    Commented Oct 28, 2012 at 23:28

1 Answer 1


Unfortunately, I have only a Linux and a Mac combination here to try but maybe I can give some hints. First, you should setup your systems in your local network so you can use ssh without password.

Then you should carefully study Preferences->Parallel->Remove Kernels->Custom launch command. This things is likely to need some adjustment. On my Linux machine it looks like

enter image description here

It's obvios, that the "math" call will not work on my MacOSX machine where Mathematica is installed under /Applications and the terminal can not call it directly. Furthermore, the kernel is call MathKernel. After adjustment I used the following custom launch command

enter image description here

After this it worked instantly (I turned the local parallel kernels off):


  {KernelObject[1, ""], KernelObject[2, ""],
  KernelObject[3, ""],  KernelObject[4, ""]}


  {"MacOSX-x86-64", "MacOSX-x86-64", "MacOSX-x86-64", "MacOSX-x86-64"}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.