[pypy-dev] how embed pypy into c?
simohayha.bobo at gmail.com
Tue Mar 20 09:45:20 CET 2012
On Tue, Mar 20, 2012 at 3:36 PM, Roberto De Ioris <roberto at unbit.it> wrote:
> > Hi all.
> > I want to embed pypy into c code, but in pypy's directory, i don't find
> any pypy's c api, except in cypext directory.
> > And I want to use stackless' c api too,. but i still have not found any
> stackless api(example stackless_api.h) in pypy.
> > Thanks.
> > --
> Currently you are on your own.
> This is the step i follow:
> 1) patch genc.py to export RPython_StartupCode in addition to
> export_symbols=["pypy_main_startup", "RPython_StartupCode"]))
> and run:
> pypy translate.py -Ojit --shared
> to build libpypy
> 2) add this declaration on top of your code
> #ifdef UWSGI_PYPY
> char *RPython_StartupCode(void);
> #define pypy_asm_stack_bottom() asm volatile ("/* GC_STACK_BOTTOM */" : :
> : \
> 3) instead of Py_Initialize() call
> After that you have an almost working pypy environment.
> A bunch of python c api functions are not implemented (but you will find
> it is pretty easy to add them, even as noop) so be prepared to some
> What kills me is the amount of time taken to rebuild the whole library, so
> i can work on it only on spare time (i am porting both mod_wsgi and uWSGI)
> Roberto De Ioris
> pypy-dev mailing list
> pypy-dev at python.org
I have several problem(because compile pypy is slow ):
1 add "export_symbols=["pypy_main_startup", "RPython_StartupCode"]))" to
genc.py in which line? or top line?
2 this will export stackless c api?
do not fear to be eccentric in opinion, for every opinion now accepted was
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pypy-dev