5
$\begingroup$

Is it possible to get the .NET Link working on Raspberry Pi?

I understand that Linux and MacOS versions of Mathematica come with .NET Link running on Mono and now even possibly under new open-source .NET Core:

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

But not RPi:

Needs["NETLink`"] 

produces

... cannot find the package on RPi.

So to get .NET Link working on RPi, can I use approach similar to copying Python files from desktop version to RPi as described in the following link?

$\quad \quad$ How to get Python bindings to work on the Raspberry Pi

$\endgroup$
4
  • 1
    $\begingroup$ .NET/Link is not included in the Raspberry Pi version of Mathematica. $\endgroup$
    – Szabolcs
    Commented Mar 28, 2015 at 13:23
  • 1
    $\begingroup$ The approach used to get Python bindings won't work here. You can copy the windows version of NETLink to the RPi ("can" doesn't necessarily mean "allowed to"); however, InstallNET.exe and the accompanying dll are for Windows, not the RPi, and would need to be recompiled. There is a 'source' directory included in the NETLink file structure, but I don't know enough about the platform to say whether or not you can recompile for the RPi. This is probably a good question for WC. $\endgroup$ Commented Mar 28, 2015 at 16:46
  • 1
    $\begingroup$ @bobthechemist I don't know about about .NET, but I thought that the platform independent Mono/.NET executables also have an .exe extension. The Mac version of .NET/Link also comes with an InstallNET.exe. Perhaps this is not a Windows executable after all. $\endgroup$
    – Szabolcs
    Commented Mar 28, 2015 at 20:51
  • 1
    $\begingroup$ @bobthechemist Well, it turns out copying it does work :) Note to the OP: I guess first thing to do is to just try. $\endgroup$
    – Szabolcs
    Commented Mar 28, 2015 at 21:14

1 Answer 1

6
$\begingroup$

Okay, I tried this and it seems to work.

  1. I copied NETLink from a Mac to /opt/Wolfram/WolframEngine/10.0/SystemFiles/Link.

  2. I installed the full mono package: sudo apt-get install mono-complete

  3. Started wolfram, loaded <<NETLink`, then evaluated InstallNET[]. It seems to work.

I don't know much about .NET though so I can't test in detail.

$\endgroup$
3
  • $\begingroup$ Yup, got this far. I wasn't able to get any of the examples to work properly, however. $\endgroup$ Commented Mar 28, 2015 at 23:10
  • 2
    $\begingroup$ @bobthechemist I'm not sure which examples are Windows specific ... many of them are GUI related. So I only tried LoadNETType["System.GC"]; GC`Collect[];, which seemed like something that should work across platforms. It worked fine. I think if something doesn't work, that's likely because the RPi version of Mono doesn't have it and not because of any limitations of .NET/Link. But I might be wrong, I don't use .NET. $\endgroup$
    – Szabolcs
    Commented Mar 29, 2015 at 0:49
  • $\begingroup$ Good point, I tried the circumference one which didn't seem to work, but I also have insufficient knowledge of .NET to debug further. $\endgroup$ Commented Mar 29, 2015 at 0:54

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.