473,320 Members | 1,794 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Success Natively Compiling Python-2.3.4 in Mingw?

Hello all.

After a search on Google it would seem that the users of
Mingw have not had good results in compiling the python
sources natively. See at least:

[1] http://uucode.com/texts/python-mingw/python-mingw.html
Having said that, kindly allow me to report that Mingw32 can
now compile python-2.3.4 sources natively. Both Mingw make files
and DEV-C++ project files can now compile the python sources.
There is surely more to be done to remove even more rough
edges; but the results are very promising.

The compiled python is, for now, renamed to python23 so as to keep
my clean working copy of Python-2.1 unaffected.
+---------------------------------------------------------------+
My system:
+---------------------------------------------------------------+
+ Win98
+ Mingw v. 3.2
+ DEV-C++ v. 4.9.8.5
+ MYSYS v. 1.0.9
+---------------------------------------------------------------+
For file sizes, here is the list:
+---------------------------------------------------------------+
PYTHON23 EXE 11,776 20/06/04 19:24 python23.exe
PYTHONW EXE 12,800 20/06/04 19:29 pythonw.exe
PYTHON23 DLL 1,224,704 20/06/04 20:05 python23.dll
W9XPOPEN EXE 12,288 19/06/04 8:07 w9xpopen.exe
+---------------------------------------------------------------+
Running python23 from MSYS:
+---------------------------------------------------------------+
$ python23 -i
Python 2.3.4 (#0, Jun 20 2004, 04:00:28) [Mingw 32 bit (AMD)] on win32
Type "help", "copyright", "credits" or "license" for more information.
1+2 3

+---------------------------------------------------------------+
Summary of regrtest.main() output:
+---------------------------------------------------------------+
204 tests OK.
1 test failed:
test_datetime
50 tests skipped:
test_aepack test_al test_bsddb test_bsddb185 test_bsddb3 test_bz2
test_cd test_cl test_commands test_crypt test_curses test_dbm
test_dl test_email_codecs test_fcntl test_fork1 test_gdbm test_gl
test_grp test_gzip test_imgfile test_ioctl test_largefile
test_linuxaudiodev test_macfs test_macostools test_mhlib test_mpz
test_nis test_normalization test_openpty test_ossaudiodev
test_pep277 test_plistlib test_poll test_posix test_pty test_pwd
test_resource test_scriptpackages test_signal test_socket_ssl
test_socketserver test_sunaudiodev test_timeout test_timing
test_urllibnet test_zipfile test_zipimport test_zlib
6 skips unexpected on win32:
test_bz2 test_zipfile test_bsddb test_zipimport test_gzip
test_zlib
+---------------------------------------------------------------+
More on test_datetime:
+---------------------------------------------------------------+
E:\Python23>python23
Python 2.3.4 (#0, Jun 20 2004, 04:00:28) [Mingw 32 bit (AMD)] on win32
Type "help", "copyright", "credits" or "license" for more information. from test import test_datetime Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "E:\PYTHON23\lib\test\test_datetime.py", line 2821, in ?
Eastern = USTimeZone(-5, "Eastern", "EST", "EDT")
TypeError: cannot create 'USTimeZone' instances

+---------------------------------------------------------------+
A closer inspection of test test_socket:
+---------------------------------------------------------------+
$ /e/python23/python23.exe -i
Python 2.3.4 (#0, Jun 20 2004, 04:00:28) [Mingw 32 bit (AMD)] on win32
Type "help", "copyright", "credits" or "license" for more information. import test_socket as t
t.test_main() testCrucialConstants (test_socket.GeneralModuleTests) ... ok
testDefaultTimeout (test_socket.GeneralModuleTests) ... ok
testGetServByName (test_socket.GeneralModuleTests) ... ok
testGetSockOpt (test_socket.GeneralModuleTests) ... ok
testHostnameRes (test_socket.GeneralModuleTests) ... ok
testIPv4toString (test_socket.GeneralModuleTests) ... ok
testIPv6toString (test_socket.GeneralModuleTests) ... ok
testInterpreterCrash (test_socket.GeneralModuleTests) ... ok
testNtoH (test_socket.GeneralModuleTests) ... ok
testRefCountGetNameInfo (test_socket.GeneralModuleTests) ... ok
testSendAfterClose (test_socket.GeneralModuleTests) ... ok
testSetSockOpt (test_socket.GeneralModuleTests) ... ok
testSockName (test_socket.GeneralModuleTests) ... ok
testSocketError (test_socket.GeneralModuleTests) ... ok
testStringToIPv4 (test_socket.GeneralModuleTests) ... ok
testStringToIPv6 (test_socket.GeneralModuleTests) ... ok
testFromFd (test_socket.BasicTCPTest) ... ok
testOverFlowRecv (test_socket.BasicTCPTest) ... ok
testOverFlowRecvFrom (test_socket.BasicTCPTest) ... ok
testRecv (test_socket.BasicTCPTest) ... ok
testRecvFrom (test_socket.BasicTCPTest) ... ok
testSendAll (test_socket.BasicTCPTest) ... ok
testShutdown (test_socket.BasicTCPTest) ... ok
testTCPTimeout (test_socket.TCPTimeoutTest) ... ok
testTimeoutZero (test_socket.TCPTimeoutTest) ... ok
testExceptionTree (test_socket.TestExceptions) ... ok
testRecvFrom (test_socket.BasicUDPTest) ... ok
testSendtoAndRecv (test_socket.BasicUDPTest) ... ok
testTimeoutZero (test_socket.UDPTimeoutTest) ... ok
testUDPTimeout (test_socket.UDPTimeoutTest) ... ok
testAccept (test_socket.NonBlockingTCPTests) ... ERROR
ERROR
testConnect (test_socket.NonBlockingTCPTests) ... ok
testRecv (test_socket.NonBlockingTCPTests) ... ERROR
testSetBlocking (test_socket.NonBlockingTCPTests) ... ok
testFullRead (test_socket.FileObjectClassTestCase) ... ok
testReadline (test_socket.FileObjectClassTestCase) ... ok
testSmallRead (test_socket.FileObjectClassTestCase) ... ok
testUnbufferedRead (test_socket.FileObjectClassTestCase) ... ok
testFullRead (test_socket.UnbufferedFileObjectClassTestCase) ... ok
testReadline (test_socket.UnbufferedFileObjectClassTestCase) ... ok
testSmallRead (test_socket.UnbufferedFileObjectClassTestCase) ... ok
testUnbufferedRead (test_socket.UnbufferedFileObjectClassTestCase) ... ok
testUnbufferedReadline (test_socket.UnbufferedFileObjectClassTestCase) ... ok
testFullRead (test_socket.LineBufferedFileObjectClassTestCase) ... ok
testReadline (test_socket.LineBufferedFileObjectClassTestCase) ... ok
testSmallRead (test_socket.LineBufferedFileObjectClassTestCase) ... ok
testUnbufferedRead (test_socket.LineBufferedFileObjectClassTestCase) ... ok
testFullRead (test_socket.SmallBufferedFileObjectClassTestCase) ... ok
testReadline (test_socket.SmallBufferedFileObjectClassTestCase) ... ok
testSmallRead (test_socket.SmallBufferedFileObjectClassTestCase) ... ok
testUnbufferedRead (test_socket.SmallBufferedFileObjectClassTestCase) ... ok

================================================== ====================
ERROR: testAccept (test_socket.NonBlockingTCPTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "E:\PYTHON23\lib\test\test_socket.py", line 543, in testAccept
read, write, err = select.select([self.serv], [], [])
ValueError: filedescriptor out of range in select()

================================================== ====================
ERROR: testAccept (test_socket.NonBlockingTCPTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "E:\PYTHON23\lib\test\test_socket.py", line 117, in _tearDown
self.fail(msg)
File "E:\PYTHON234\PYTHON-2.3.4\lib\unittest.py", line 270, in fail
raise self.failureException, msg
AssertionError: (10061, 'Connection refused')

================================================== ====================
ERROR: testRecv (test_socket.NonBlockingTCPTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "E:\PYTHON23\lib\test\test_socket.py", line 571, in testRecv
read, write, err = select.select([conn], [], [])
ValueError: filedescriptor out of range in select()

----------------------------------------------------------------------
Ran 51 tests in 14.340s

FAILED (errors=3)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "E:\PYTHON23\lib\test\test_socket.py", line 752, in test_main
test_support.run_unittest(*tests)
File "test_support.py", line 262, in run_unittest
run_suite(suite, testclass)
File "test_support.py", line 246, in run_suite
raise TestFailed(msg)
test.test_support.TestFailed: errors occurred; run in verbose mode for details

+---------------------------------------------------------------+
Test test_socket passes or fails?
+---------------------------------------------------------------+
Why regrtest.main() is reporting that test_socket passes, when
test_socket itself reports that it fails is beyond me. Mind you,
however, that the socket module itself can run the simple echo
client/server(s) that were modified by me and which came with
python21 without problems.
+---------------------------------------------------------------+
Summary of changes:
+---------------------------------------------------------------+
Number of files changed in source Python-2.3.4.tar.bz2: 10
+---------------------------------------------------------------+
Overview of all changes which number 16:
+---------------------------------------------------------------+
[1] 3 changes in socketmodule.c
[2] 1 change in socketmodule.h
(The test fails or passes?)
[3] 2 changes in posixmodule.c
[4] 1 change in _csv.c
[5] 5 changes in datetimemodule.c
(test_datetime.py is the (only?) test that fails;
Note that the module appears loadable, however.
And seems able to run some of its methods; after all
test_calendar passes).
[6] 1 change in _winreg.c
[7] 1 change in ../PC/pyconfig.h
[8] Not using python_nt.rc
(Using pythoncore_private.rc, & python_mingw.rc instead).
[9] 1 change in dynload_win.c
[10] 1 change in thread_pthread.c (This file is ignored, I think).
+---------------------------------------------------------------+
Sources are guarded:
+---------------------------------------------------------------+
Most changes guard the original source and are in the form of:
/* My addition/change */
/* Comment...*/
#if defined(__MINGW32__)
/*define or do something*/
#else
original python source code here
#endif
+---------------------------------------------------------------+
Last words:
+---------------------------------------------------------------+
If someone can kindly verify that the failed tests are not
serious (they don't seem to be; I even don't have the datetime
module in my current Python-2.1) or can be fixed, or if many people
are interested in documentation of the source changes, then I'll
be more than happy to share them.

Peace

--
Q. The purpose of life?

[A]: "I created the jinn and humankind only that they might
worship Me." (Translation, Qur'an, 51:56)

[b]: "Let us hear the conclusion of the whole matter:
Fear God, and keep his commandments: for this is the
whole duty of man." (KJV, Ecclesiastes 12:13)
Jul 18 '05 #1
1 2498
ab***@earth.co.jp (A. B., Khalid) wrote in message news:<8a**************************@posting.google. com>...
Hello all.
If someone can kindly verify that the failed tests are not
serious (they don't seem to be; I even don't have the datetime
module in my current Python-2.1) or can be fixed, or if many people
are interested in documentation of the source changes, then I'll
be more than happy to share them.

Peace


Providing patches for a working mingw compilation would be great.

Carl
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Stephan Deibel | last post by:
Hi, O'Reilly Associates has agreed to print a second volume of Python Success Stories and I am looking for contributors of new stories. This booklet will showcase Python in the context of a...
0
by: Johnathan Doe | last post by:
I've been thinking about what the issues would be in compiling Python into native machine code, and since type information is important in Python, it seems possible that Python code can be...
0
by: Stephan Deibel | last post by:
Hi, I just wanted to let y'all know that the Python Success Stories collection has nine new additions: http://www.pythonology.com/success These 28 stories include significant testimonials...
29
by: Maurice LING | last post by:
Hi, I remembered reading a MSc thesis about compiling Perl to Java bytecodes (as in java class files). At least, it seems that someone had compiled scheme to java class files quite successfully....
1
by: Matej Kenda | last post by:
Hi all, This message is to let you know that I have successfully compiled the latest sources from the 2.3 branch on the abovementioned OS using the HP ansiC compiler version 5.50. Final...
6
by: Martin Bless | last post by:
The good news: Along with Python-2.4 comes really good news to Windows users. Yes, you now CAN build extension modules yourself using the SAME C++ compiler and linker Python is built with...
0
by: mmarkzon | last post by:
I have been struggling compiling linkchecker from http://linkchecker.sourceforge.net/. The last thing I get is "error: command 'gcc' failed with exit status 1" which is not very helpful. This is...
0
by: phoolimin | last post by:
Dear all, I am trying to embed python into another scripting language, to do this I need to solve a number of problems on importing or compiling python script. First let me state what exactly I...
2
by: metaperl | last post by:
I've tried both Python 2.4.4 and Python 2.5. I'm trying to build from source and install under a local directory Swarm since OpenSwarm requires builds of Postgres and Python under it's control. ...
1
by: krishnakant Mane | last post by:
hello all. actually I have been recently appointed as a technology consulltent at a huge company. and I have couple more such projects in the pypeline. unfortunately the officials out here are...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.