title: Compiling trivial python program to javascript using cython and emscripten on mac
body: <p><strong>I am trying to generate javascript from python using cython and emscripten.</strong></p>
  
  <p><code>hello.py</code>: </p>
  
  <pre><code>print 'Hello world.'
  </code></pre>
  
  <p>Then I compile this to c using cython</p>
  
  <pre><code>&gt;&gt;&gt; cython --embed hello.py -v
  </code></pre>
  
  <p>This generates a <code>hello.c</code> file which I compile with</p>
  
  <pre><code>&gt;&gt;&gt; gcc hello.c -I/usr/include/python2.7/ -lpython2.7
  </code></pre>
  
  <p>This works for gcc or clang.
  When I execute <code>./a.out</code> I get the expected output</p>
  
  <pre><code>&gt;&gt;&gt; ./a.out
  &gt;&gt;&gt; Hello world
  </code></pre>
  
  <p>next I want to compile <code>hello.c</code> to javascript using emscripten</p>
  
  <pre><code>&gt;&gt;&gt; emcc hello.c -I/usr/include/python2.7/ -lpython2.7
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>&gt;&gt;&gt; WARNING  emcc: -I or -L of an absolute path encountered. 
  &gt;&gt;&gt; If this is to a local system header/library, it may cause problems 
  &gt;&gt;&gt; (local system files make sense for compiling natively on your system, 
  &gt;&gt;&gt; but not necessarily to JavaScript)
  &gt;&gt;&gt; clang: warning: argument unused during compilation: '-nostdinc++'
  </code></pre>
  
  <p>It still generates a <code>a.out.js</code> file which I try to run in node.js</p>
  
  <pre><code>&gt;&gt;&gt; node a.out.js
  </code></pre>
  
  <p>I get a reference error </p>
  
  <pre><code>&gt;&gt;&gt; ReferenceError: _Py_SetProgramName is not defined
  </code></pre>
  
  <p>I tried changing the generated javscript a little bit, but basically I think all the <code>_Py_</code> functions are not defined.</p>
  
  <p>Does anyone have any experience with this, or any suggested fixes?</p>