I tried to compile Python on my Ubuntu 14.04 64 bit by following the 
instructions[1], here are some problems i encountered and how i resolved 
some of them, hope it helps.

Here was the error message when i built the project:

Include/pyport.h:886:2: error: "LONG_BIT definition appears wrong for 
> platform (bad gcc/glibc config?)."
>

then I ran `emconfigure` with several `-m23` flags:

$ CFLAGS='-m32' LDFLAGS='-m32' CXXFLAGS='-m32' emconfigure ./configure 
> --without-threads --without-pymalloc --enable-shared --disable-ipv6
>
 
a new error message was printed after i built the project again:

./Modules/posixmodule.c:6555:1: error: static declaration of 'posix_close' 
> follows non-static declaration
> posix_close(PyObject *self, PyObject *args)
> ^
> /home/pzhang/work/opensource/emsdk_portable/emscripten/master/system/include/libc/unistd.h:38:5:
>  
> note: previous declaration is here
> int posix_close(int, int);
>     ^
> ./Modules/posixmodule.c:8933:25: warning: incompatible pointer types 
> initializing 'PyCFunction' (aka 'PyObject *(*)(PyObject *, PyObject *)') 
> with an
>       expression of type 'int (int, int)' [-Wincompatible-pointer-types]
>     {"close",           posix_close, METH_VARARGS, posix_close__doc__},
>                         ^~~~~~~~~~~
> 1 warning and 1 error generated.
>

then i removed the declaration of `posix_close` function from 
`$EMSCRIPTEN/system/include/libc/unistd.h`, re-compiled the project, the 
error message was gone, and everything else went well by following the 
instructions[1].

and now i can run the python like this:

node a.out.js -S -c "print 'hello world!'"
>

but the output was like:

Calling stub instead of sigaction()
> Calling stub instead of sigaction()
> Calling stub instead of __libc_current_sigrtmin
> Calling stub instead of __libc_current_sigrtmax 

hello world!
>
Calling stub instead of sigaction()
>

and i tried to run the compiled Python interactively by:

node a.out.js -S
>

the command was terminated with these outputs:

Calling stub instead of sigaction()
> Calling stub instead of sigaction()
> Calling stub instead of sigaction()
> Calling stub instead of sigaction()
> Calling stub instead of __libc_current_sigrtmin
> Calling stub instead of __libc_current_sigrtmax
> Python 2.7.5 (default, Mar 19 2015, 18:10:26) 
> [GCC 4.2.1 Compatible Clang 3.4 ] on linux2
> >>> 
> Calling stub instead of sigaction() 
>

How can i run the compiled Python interactively? thanks.

[1] https://github.com/kripken/emscripten/blob/master/tests/python/readme.md

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to