473,756 Members | 3,566 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_code cs test_fcntl test_fork1 test_gdbm test_gl
test_grp test_gzip test_imgfile test_ioctl test_largefile
test_linuxaudio dev test_macfs test_macostools test_mhlib test_mpz
test_nis test_normalizat ion test_openpty test_ossaudiode v
test_pep277 test_plistlib test_poll test_posix test_pty test_pwd
test_resource test_scriptpack ages test_signal test_socket_ssl
test_socketserv er test_sunaudiode v 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>pyt hon23
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\li b\test\test_dat etime.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() testCrucialCons tants (test_socket.Ge neralModuleTest s) ... ok
testDefaultTime out (test_socket.Ge neralModuleTest s) ... ok
testGetServByNa me (test_socket.Ge neralModuleTest s) ... ok
testGetSockOpt (test_socket.Ge neralModuleTest s) ... ok
testHostnameRes (test_socket.Ge neralModuleTest s) ... ok
testIPv4toStrin g (test_socket.Ge neralModuleTest s) ... ok
testIPv6toStrin g (test_socket.Ge neralModuleTest s) ... ok
testInterpreter Crash (test_socket.Ge neralModuleTest s) ... ok
testNtoH (test_socket.Ge neralModuleTest s) ... ok
testRefCountGet NameInfo (test_socket.Ge neralModuleTest s) ... ok
testSendAfterCl ose (test_socket.Ge neralModuleTest s) ... ok
testSetSockOpt (test_socket.Ge neralModuleTest s) ... ok
testSockName (test_socket.Ge neralModuleTest s) ... ok
testSocketError (test_socket.Ge neralModuleTest s) ... ok
testStringToIPv 4 (test_socket.Ge neralModuleTest s) ... ok
testStringToIPv 6 (test_socket.Ge neralModuleTest s) ... ok
testFromFd (test_socket.Ba sicTCPTest) ... ok
testOverFlowRec v (test_socket.Ba sicTCPTest) ... ok
testOverFlowRec vFrom (test_socket.Ba sicTCPTest) ... ok
testRecv (test_socket.Ba sicTCPTest) ... ok
testRecvFrom (test_socket.Ba sicTCPTest) ... ok
testSendAll (test_socket.Ba sicTCPTest) ... ok
testShutdown (test_socket.Ba sicTCPTest) ... ok
testTCPTimeout (test_socket.TC PTimeoutTest) ... ok
testTimeoutZero (test_socket.TC PTimeoutTest) ... ok
testExceptionTr ee (test_socket.Te stExceptions) ... ok
testRecvFrom (test_socket.Ba sicUDPTest) ... ok
testSendtoAndRe cv (test_socket.Ba sicUDPTest) ... ok
testTimeoutZero (test_socket.UD PTimeoutTest) ... ok
testUDPTimeout (test_socket.UD PTimeoutTest) ... ok
testAccept (test_socket.No nBlockingTCPTes ts) ... ERROR
ERROR
testConnect (test_socket.No nBlockingTCPTes ts) ... ok
testRecv (test_socket.No nBlockingTCPTes ts) ... ERROR
testSetBlocking (test_socket.No nBlockingTCPTes ts) ... ok
testFullRead (test_socket.Fi leObjectClassTe stCase) ... ok
testReadline (test_socket.Fi leObjectClassTe stCase) ... ok
testSmallRead (test_socket.Fi leObjectClassTe stCase) ... ok
testUnbufferedR ead (test_socket.Fi leObjectClassTe stCase) ... ok
testFullRead (test_socket.Un bufferedFileObj ectClassTestCas e) ... ok
testReadline (test_socket.Un bufferedFileObj ectClassTestCas e) ... ok
testSmallRead (test_socket.Un bufferedFileObj ectClassTestCas e) ... ok
testUnbufferedR ead (test_socket.Un bufferedFileObj ectClassTestCas e) ... ok
testUnbufferedR eadline (test_socket.Un bufferedFileObj ectClassTestCas e) ... ok
testFullRead (test_socket.Li neBufferedFileO bjectClassTestC ase) ... ok
testReadline (test_socket.Li neBufferedFileO bjectClassTestC ase) ... ok
testSmallRead (test_socket.Li neBufferedFileO bjectClassTestC ase) ... ok
testUnbufferedR ead (test_socket.Li neBufferedFileO bjectClassTestC ase) ... ok
testFullRead (test_socket.Sm allBufferedFile ObjectClassTest Case) ... ok
testReadline (test_socket.Sm allBufferedFile ObjectClassTest Case) ... ok
testSmallRead (test_socket.Sm allBufferedFile ObjectClassTest Case) ... ok
testUnbufferedR ead (test_socket.Sm allBufferedFile ObjectClassTest Case) ... ok

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

=============== =============== =============== =============== ==========
ERROR: testAccept (test_socket.No nBlockingTCPTes ts)
----------------------------------------------------------------------
Traceback (most recent call last):
File "E:\PYTHON23\li b\test\test_soc ket.py", line 117, in _tearDown
self.fail(msg)
File "E:\PYTHON234\P YTHON-2.3.4\lib\unitt est.py", line 270, in fail
raise self.failureExc eption, msg
AssertionError: (10061, 'Connection refused')

=============== =============== =============== =============== ==========
ERROR: testRecv (test_socket.No nBlockingTCPTes ts)
----------------------------------------------------------------------
Traceback (most recent call last):
File "E:\PYTHON23\li b\test\test_soc ket.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\li b\test\test_soc ket.py", line 752, in test_main
test_support.ru n_unittest(*tes ts)
File "test_support.p y", line 262, in run_unittest
run_suite(suite , testclass)
File "test_support.p y", line 246, in run_suite
raise TestFailed(msg)
test.test_suppo rt.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_priv ate.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(__MINGW 32__)
/*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 2534
ab***@earth.co. jp (A. B., Khalid) wrote in message news:<8a******* *************** ****@posting.go ogle.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
1566
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 variety of successful software projects, explaining why Python was a good choice. It is used by O'Reilly as a freebie to market its own books, and it's a great way to get the word out about Python and your company or project.
0
1700
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 compiled into native machine code (albeit with a lot of extra effort). For instance, type information is discovered when something is assigned to a variable or an anonymous piece of data is used in a program. Compiling Python bytecode into native...
0
1534
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 that can make it easier to sell technical decision-makers (i.e., your boss) on Python.
29
3452
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. I'm wondering if something of such had been attempted in python, as in compiling X language into .pyc. I do not understand the schematics of .pyc files but I assume that they are the so called python bytecode files. Or is there any...
1
1928
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 status: success, it works fine ---
6
6177
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 itself. Everything you need is available at no costs (except download hassle and installation time). Once your system is set up properly its just a matter of running 'python setup.py build'. No longer waiting for someone else to build binaries and a...
0
1712
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 with Python 2.4.1 on Solaris 2.8. Can anyone help? Thank you. -> python setup.py build creating /home/kzvbq3/linkchecker-3.2/_linkchecker_configdata.py running build running build_py
0
1457
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 want to do, that is, I want the following syntax to be supported in the host language which I am developing: ###################################################### # scripts in the host language
2
2296
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. Ok, so I did ../configure --prefix=/Users/tbrannon/Documents/Python/Swarm/Python-2.5 but during make install I get this:
1
1259
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 too much in favour of java and I have personally worked with both and find that python is heaven in syntax and makes it very easy to do complex things. on speed? I think experts on this list can give better answer, but efficiency and maintainance...
0
9456
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10034
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9872
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9843
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9713
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.