Mathlink bindings for python
C Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Mathlink bindings for Python

Adapted to work with the Raspberry Pi version of Mathematica

  1. Some notes
  • python code is not present in the RPi version but can be found in a desktop installation
  • make sure python-dev and uuid-dev are installed
  1. modify mathlink.c
  • Add #define MLINTERFACE 3 above the #include lines
  1. modify
  • mathematicaversion = "10.0"
  • if('linux2',sys.platform)): setup(name="mathlink", version=pythonlinkversion, ext_modules=[ Extension( "mathlink", ["mathlink.c"], include_dirs = ["/opt/Wolfram/WolframEngine/" + mathematicaversion + "/SystemFiles/Links/MathLink/DeveloperKit/Linux-ARM/CompilerAdditions"], library_dirs = ["/opt/Wolfram/WolframEngine/" + mathematicaversion + "/SystemFiles/Links/MathLink/DeveloperKit/Linux-ARM/CompilerAdditions"], libraries = ["uuid", "ML32i3", "m", "pthread", "rt"] ) ] )
  1. Not sure if this is the best way to obtain the necesssary results, but
  • Copy /opt/Wolfram/WolframEngine/10.0/SystemFiles/Links/Mathlink/DeveloperKit/Linux-ARM/CompilerAdditions/ to /usr/local/lib
  • Run sudo ldconfig
  1. python build and sudo python install should work now

  2. test with

  • python -c "import mathlink"