Python 3.0.1 and mingw

S

smartmobili

I wanted to know if you have some patch to compile python 3.x on mingw
platform because I found some
but doesn't work very well :


make

gcc -o python.exe \
Modules/python.o \
libpython3.0.a -lm
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: can't initialize sys standard
streams
ImportError: No module named encodings.utf_8


I have some questions about posixmodule.c, config.c and makesetup,
I can see in posixmodule that you define a INITFUNC like this :

#if (defined(_MSC_VER) || defined(__WATCOMC__) || defined
(__BORLANDC__)) &&
!defined(__QNX__)
#define INITFUNC PyInit_nt
#define MODNAME "nt"

#elif defined(PYOS_OS2)
#define INITFUNC PyInit_os2
#define MODNAME "os2"

#else
#define INITFUNC PyInit_posix
#define MODNAME "posix"
#endif

So first I tried to add || defined(____MINGW32____) to declare a
PyInit_nt
but after config.c
was still using PyInit_posix. How does makesetup choose to include one
function or another ?
So finally python is using PyInit_posix...


and after any idea why I got the compilation error ?
 
K

Kay Schluehr

I wanted to know if you have some patch to compile python 3.x on mingw
platform because I found some
but doesn't work very well :

make

gcc -o python.exe \
Modules/python.o \
libpython3.0.a -lm
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: can't initialize sys standard
streams
ImportError: No module named encodings.utf_8

I have some questions about posixmodule.c, config.c and makesetup,
I can see in posixmodule that you define a INITFUNC like this :

#if (defined(_MSC_VER) || defined(__WATCOMC__) || defined
(__BORLANDC__)) &&
!defined(__QNX__)
#define INITFUNC PyInit_nt
#define MODNAME "nt"

#elif defined(PYOS_OS2)
#define INITFUNC PyInit_os2
#define MODNAME "os2"

#else
#define INITFUNC PyInit_posix
#define MODNAME "posix"
#endif

So first I tried to add || defined(____MINGW32____) to declare a
PyInit_nt
but after config.c
was still using PyInit_posix. How does makesetup choose to include one
function or another ?
So finally python is using PyInit_posix...

and after any idea why I got the compilation error ?

Why on earth do you want to compile Python 3.0.1?
 
S

smartmobili

I wanted to know if you have some patch to compile python 3.x on mingw
platform because I found some
but doesn't work very well :
    make
gcc   -o python.exe \
Modules/python.o \
libpython3.0.a    -lm
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: can't initialize sys standard
streams
ImportError: No module named encodings.utf_8
I have some questions about posixmodule.c, config.c and makesetup,
I can see in posixmodule that you define a INITFUNC like this :
#if (defined(_MSC_VER) || defined(__WATCOMC__) || defined
(__BORLANDC__)) &&
!defined(__QNX__)
#define INITFUNC PyInit_nt
#define MODNAME "nt"
#elif defined(PYOS_OS2)
#define INITFUNC PyInit_os2
#define MODNAME "os2"
#else
#define INITFUNC PyInit_posix
#define MODNAME "posix"
#endif
So first I tried to add || defined(____MINGW32____) to declare a
PyInit_nt
but after config.c
was still using PyInit_posix. How does makesetup choose to include one
function or another ?
So finally python is using PyInit_posix...
and after any idea why I got the compilation error ?

Why on earth do you want to compile Python 3.0.1?

Because I need python to be able to compile other libraries on mingw
(subcersion, ....).
 
L

lkcl

I wanted to know if you have some patch to compile python 3.x on mingw
platform because I found some
but doesn't work very well :

you should compile a 2.N version.

despite efforts and proof that the efforts passed all but about 8-12
regression tests, the python development core team deemed the 2.5 and
the 2.7 mingw port efforts to be a waste of time.

if you or anyone else disagrees with this, please do say so, on the
python-dev mailing list and also in the bugtracker. at least one
person has already done so:

http://bugs.python.org/issue4954#msg85994



http://bugs.python.org/issue5046 states that i am not allowed to
post "work in progress", despite it being significantly complete, and
despite it being worthwhile to have added in as-is into the standard
python repository.

http://bugs.python.org/issue4954 is where a python2.5 mingw native
_and_ cross-compile was successfully built.

http://bugs.python.org/issue3871 is where roumen continues to provide
the benefits of the continuous work that he is doing. when i last
checked, he wasn't able to do native mingw32 builds but only cross-
compiles, but that may have changed.

the most significant difference between 4954 and 3871 at the time
when my efforts were terminated due to python developer hostility is
that i spent considerable time reducing the size of configure.

firing up a new /bin/sh under MSYS, native, takes 0.7 seconds (and <
0.01 on a gnu/linux box). firing up a new /bin/sh under MSYS, running
under Wine, took _well_ over two seconds.

consequently, running an "unmodified" version of configure would take
well over half an hour.

by cutting most of configure out and going with a pre-prepared
Config.h i was able to reduce that time down to (only) about 10
minutes.

which is just about tolerable.

like all free software projects, there is considerable additional
work to be done: everything is "work in progress", but thanks to the
python developers applying one standard to themselves on what
constitutes "work in progress" and another for contributors, you will
not get the benefit of my input and expertise until you (python users)
can get the python developers to treat my efforts to help users with a
little more respect.

l.
 
G

Gabriel Genellina

I wanted to know if you have some patch to compile python 3.x on mingw
platform because I found some
but doesn't work very well :

you should compile a 2.N version.
[...]
http://bugs.python.org/issue5046 states that i am not allowed to
post "work in progress", despite it being significantly complete, and
despite it being worthwhile to have added in as-is into the standard
python repository.

What you've been told is not to use the Python bug tracker as a blog. You
could write about your progresses in *another* place, and maybe from time
to time post a link here so interested people is aware of it.
by cutting most of configure out and going with a pre-prepared
Config.h i was able to reduce that time down to (only) about 10
minutes.

That's fine, the "official" Windows build uses a hand written config.h too.
like all free software projects, there is considerable additional
work to be done: everything is "work in progress", but thanks to the
python developers applying one standard to themselves on what
constitutes "work in progress" and another for contributors, you will
not get the benefit of my input and expertise until you (python users)
can get the python developers to treat my efforts to help users with a
little more respect.

If you expect your work to be taken seriously, work seriously. Randomly
changing code until some symptom disappears isn't a very good practice,
I'd say. Try to polish the patches a little until you are happy with them,
and only then submit them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top