title: Python+Numpy modules in free pascal
body: <p>Developing a module (.pyd) for Python in free pascal is fairly easy, see <a href="http://wiki.freepascal.org/Developing_Python_Modules_with_Pascal" rel="nofollow">Developing Python Modules with Pascal</a>. But if I want to interface with numpy, this is not that easy.
  When using C to interface with numpy, you have to add <code>#include &lt;numpy/arrayobject.h&gt;</code> to the code, and also call <code>import_array();</code> in the initialization function.</p>
  
  <p>Is there a way to interface with numpy in pascal?</p>
  
  <p><strong>EDIT1</strong></p>
  
  <p>As mentioned in the comments under @wilberforce answer, the <code>import_array</code> function which is defined in the header files just imports multiarray.pyd module into the current interpreter and does some checking. It is easily translated into pascal and it works.</p>
  
  <p>The numpy C-API functions are not present initially in pythonXX.dll, so they can't be linked statically. Static or dynamic linking with multiarray.pyd is not working for me.</p>
  
  <p>So the updated question is: Is there a way to access the C-API functions embedded in multiarray.pyd from code which is not C?</p>