Need some configure eyeballs and testing

Awhile ago I volunteered to fix the use of OPT within configure. The problem is that OPT is overloaded with two different kinds of things, optimization/debug flags and other flags which are required to get code to compile. The problem is that if there are any flags which need to be set to simply get Python to compile, if you override OPT when running configure or make, you may wipe out compiler flags necessary to simply compile the interpreter.
I finally got a round to finishing that off this morning. I split OPT into two variables, OPT and BASECFLAGS. OPT can be modified, while BASECFLAGS should be left alone. You can pass BASECFLAGS to configure. If it decides you need some other flags they just get tacked on. On the other hand, if you pass OPT to configure, it generally will prevent the configure script from doing anything else to it. (There is one bit of code I didn't understand too well which does set OPT unconditionally on BeOS. I left that alone, but I think it probably needs to be changed.
As they say, "it works for me", however all I've tested it on is MacOSX, and only a Unix build (I still don't know how to do the fancy schmansy Mac builds). The following issues remain:
* For some reason the flags which wind up in BASECFLAGS are getting duplicated on the gcc command line. I'm not sure where this is happening, but Makefile.pre and Makefile both wind up with these definitions:
OPT= -Wno-long-double -no-cpp-precomp -g -Wall -Wstrict-prototypes BASECFLAGS= -Wno-long-double -no-cpp-precomp
I don't merge BASECFLAGS into OPT anywhere, and the echo statements in configure report:
Base CFLAGS: < -Wno-long-double -no-cpp-precomp> OPT: <-g -Wall -Wstrict-prototypes>
* There are three XXX comments in configure.in which could use some investigation. Two are related to condensing two bits of code which seem to overlap a bit. The third is related to Monterey. This small block of code:
# The current (beta) Monterey compiler dies with optimizations case $ac_sys_system in Monterey*) OPT="" ;; esac
unconditionally wipes out OPT, but doesn't say what Monterey is or give any indication that this setting needs to be revisited. Is "Monterey" still in beta test? "cvs annotate" indicates that Trent Mick added this in August 2000, so I assume it's something to do with Win64 (the OS? MSVC?), but it would be nice to know if this is still needed.
I can use some extra eyeballs if you have a few moments to spare. To save bandwidth on the group, I opened a patch at
The uploaded file includes diffs for Makefile.pre.in, configure.in and configure, so you don't need to have a recent version of autoconf to try it out.
I uploaded the context diffs using Internet Explorer on my Mac. I just downloaded it to my Linux laptop using Opera and noticed a bit of corruption (NULs at the start and the end). The file is fine on my Mac. Downloading on the Mac with IE generates an okay file, but Mac+Opera also results in corruption. If you can't get a clean file, let me know and I'll be happy to mail it to you.
I have no idea what caused this but would appreciate some feedback on efforts to download it, even if you don't have time to test it more extensively.
Skip

Skip> The problem is ... The problem is ...
Sorry for this editorial gaff. Didn't get enough sleep last night.
Skip> As they say, "it works for me", however all I've tested it on is Skip> MacOSX, and only a Unix build (I still don't know how to do the Skip> fancy schmansy Mac builds).
I've also tried it out on Mandrake Linux 8.1. Seems to work there as well.
Skip

"Skip" == Skip Montanaro skip@pobox.com writes:
Skip> I uploaded the context diffs using Internet Explorer on my Skip> Mac. I just downloaded it to my Linux laptop using Opera Skip> and noticed a bit of corruption (NULs at the start and the Skip> end). The file is fine on my Mac. Downloading on the Mac Skip> with IE generates an okay file, but Mac+Opera also results Skip> in corruption. If you can't get a clean file, let me know Skip> and I'll be happy to mail it to you.
I got these too, both in opera and with wget. But I edited them out with emacs and the patch applied correctly.
Skip> I can use some extra eyeballs if you have a few moments to Skip> spare. To save bandwidth on the group, I opened a patch at
I compiled your patched CVS under a few systems I have available. I just did the default thing each time (./configure; make; make test). If there is something more strenuous you'd like me to try, I still have the build dirs.
Everything went fairly smoothly: python built on every system, though there were some failed and/or skipped tests on each platform. I have the platform/OS/gcc version below, as well as the 'make test' summary. test_signal hangs on the sun solaris platform; I have no idea what is causing this.
Tomorrow I may get a chance to test it on an old IRIX box. It'll probably take a day to compile though, if I'm lucky.
John Hunter
====================================================================
SunOS ace 5.8 Generic_108528-09 sun4u sparc SUNW,Ultra-5_10
make test runs fine then hangs on test_signal
# ./gcc --version 2.95.3
# ./make --version GNU Make version 3.79.1, by Richard Stallman and Roland McGrath. Built for sparc-sun-solaris2.8
./configure; make ran normally
==================================================================== AMD Athlon XP with RHL 7.1 running kernel 2.4.2
make test
204 tests OK. 1 test failed: test_linuxaudiodev 14 tests skipped: test_al test_bsddb3 test_cd test_cl test_curses test_email_codecs test_gl test_imgfile test_pep277 test_socket_ssl test_socketserver test_sunaudiodev test_winreg test_winsound 1 skip unexpected on linux2: test_bsddb3 make: *** [test] Error 1
[root@cruncher1 src]# uname -a Linux cruncher1.paradise.lost 2.4.2-2 #1 Sun Apr 8 20:41:30 EDT 2001 i686 unknown
[root@cruncher1 src]# gcc --version 2.96
[root@cruncher1 src]# make --version GNU Make version 3.79.1, by Richard Stallman and Roland McGrath. Built for i386-redhat-linux-gnu
[root@cruncher1 /root]# cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 6 model : 6 model name : AMD Athlon(tm) XP 1800+ stepping : 2 cpu MHz : 1541.261 cache size : 256 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow bogomips : 3073.63
====================================================================
Redhat linux 8.0 on Pentium III with gcc 3.2
configure/make were normal
make test terminated on the audiodev test. I am 99.99% sure this is all my fault since I installed the audio modules with -f against my kernel's pleading
test_largefile test_linuxaudiodev make: *** [test] Floating point exception
[root@video src]# gcc --version gcc (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7) Copyright (C) 2002 Free Software Foundation, Inc.
[root@video src]# make --version GNU Make version 3.79.1, by Richard Stallman and Roland McGrath. Built for i386-redhat-linux-gnu
[root@video src]# uname -a Linux video.paradise.lost 2.4.18-14 #1 Wed Sep 4 13:35:50 EDT 2002 i686 i686 i386 GNU/Linux
[root@video src]# cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 8 model name : Pentium III (Coppermine) stepping : 1 cpu MHz : 797.976 cache size : 256 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr sse bogomips : 1586.32
==============================================================================
Pentium III running RHL 7.1 with gcc 3.2
configure/make were normal
make test
204 tests OK. 15 tests skipped: test_al test_bsddb3 test_cd test_cl test_curses test_email_codecs test_gl test_imgfile test_linuxaudiodev test_pep277 test_socket_ssl test_socketserver test_sunaudiodev test_winreg test_winsound 2 skips unexpected on linux2: test_bsddb3 test_linuxaudiodev
mother:~/python/src/cvs/python/dist/src> gcc --version gcc (GCC) 3.2
mother:~/python/src/cvs/python/dist/src> make --version GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.
mother:~/python/src/cvs/python/dist/src> uname -a Linux mother.paradise.lost 2.4.9 #7 Fri Oct 12 15:20:49 CDT 2001 i686
mother:~/python/src/cvs/python/dist/src> cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 8 model name : Pentium III (Coppermine) stepping : 6 cpu MHz : 937.551 cache size : 256 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse bogomips : 1867.77
==============================================================================

John> I compiled your patched CVS under a few systems I have available. John> I just did the default thing each time (./configure; make; make John> test). If there is something more strenuous you'd like me to try, John> I still have the build dirs.
Thanks, that's an excellent start.
On most of the more popular systems, like Linux, I anticipate no problems. In the Makefile generated by configure you should two variables initialized, OPT and BASECFLAGS. On my Mac I see something like:
OPT= -DNDEBUG -g BASECFLAGS= -Wno-long-double -no-cpp-precomp
depending on how I initialize OPT in configure's environment.
The BASECFLAGS are supposed to be the flags which are absolutely required to build Python. On my Mandrake Linux system, BASECFLAGS are always empty. The only bits in OPT would be stuff to affect optimization and debugging. I was free to fiddle with OPT at any time and in any way I wanted.
On my Mac though, the -Wno-long-double -no-cpp-precomp are absolutely required to get things to build properly. Before I made these changes, fiddling with OPT during configure or make would blow them away and my build would fail if I wasn't careful to include those two crucial flags in OPT.
When you're looking at the output of building on a particular system, the most important thing to look for is if OPT contains anything besides optimization or debugging stuff. If so, you would probably not have been able to casually modify OPT. Now, you should be able to.
John> Everything went fairly smoothly: python built on every system,
Comparing the old OPT with the new OPT+BASECFLAGS Makefile variables should give you a good idea if I got things right (if they add up to the same flags before and after, you're golden).
I figured out why I was getting the flag duplication I mentioned in my earlier note. I simply forgot to run autoconf after my last change to configure.in. I will upload a new patch in a few minutes.
John> Tomorrow I may get a chance to test it on an old IRIX box. It'll John> probably take a day to compile though, if I'm lucky.
This should be an interesting build. Something like
1. configure 2. note the value of OPT in the generated Makefile 3. apply the patch 4. note the combined values of OPT & BASECFLAGS in the generated Makefile 5. build if there's still some time left in the day ;-)
If someone has access to other unusual platforms (BeOS, AIX, SCO) that would be helpful as well.
Skip

"Skip" == Skip Montanaro skip@pobox.com writes:
Skip> Comparing the old OPT with the new OPT+BASECFLAGS Makefile Skip> variables should give you a good idea if I got things right Skip> (if they add up to the same flags before and after, you're Skip> golden).
OK, now I have a better idea of what you need.
On the SunOS 5.8 sparc SUNW,Ultra-5_10 platform with gcc 2.95.3, the two flags add up.
Patched:
OPT= -DNDEBUG -g -O3 -Wall -Wstrict-prototypes BASECFLAGS=
Un-patched:
OPT= -DNDEBUG -g -O3 -Wall -Wstrict-prototypes
I'll let you know if I have any luck on the IRIX box. May god have mercy on my soul.
John Hunter

"Skip" == Skip Montanaro skip@pobox.com writes:
John> Tomorrow I may get a chance to test it on an old IRIX box. John> It'll probably take a day to compile though, if I'm lucky.
Skip> This should be an interesting build. Something like
godot:~/python/dist/src % uname -a IRIX godot 6.5 04191225 IP22
godot:/usr/local/bin % cc -version MIPSpro Compilers: Version 7.30
unpatched:
OPT= -DNDEBUG -O -OPT:Olimit=0
patched:
OPT= -OPT:Olimit=0 -DNDEBUG -O BASECFLAGS= -OPT:Olimit=0
(can't make it now -- the damned compiler license has expired. I'm downloading an IRIX 6.5 gcc binary now)
John Hunter

John> unpatched:
John> OPT= -DNDEBUG -O -OPT:Olimit=0
John> patched:
John> OPT= -OPT:Olimit=0 -DNDEBUG -O John> BASECFLAGS= -OPT:Olimit=0
Thanks, this looks good.
Skip

Skip Montanaro skip@pobox.com writes:
John> OPT= -OPT:Olimit=0 -DNDEBUG -O John> BASECFLAGS= -OPT:Olimit=0
Thanks, this looks good.
Why is it good that -OPT:Olimit=0 gets duplicated?
Regards, Martin

"Martin" == Martin v Loewis martin@v.loewis.de writes:
Martin> Skip Montanaro skip@pobox.com writes: John> OPT= -OPT:Olimit=0 -DNDEBUG -O John> BASECFLAGS= -OPT:Olimit=0 >> >> Thanks, this looks good.
Martin> Why is it good that -OPT:Olimit=0 gets duplicated?
It actually doesn't anymore. I had forgotten to run autoconf after fixing that problem. John was almost certainly still using the first patch I uploaded instead of the second one.
Skip

On Wed, Nov 20 2002 Skip Montanaro wrote:
John> unpatched: John> OPT= -DNDEBUG -O -OPT:Olimit=0 John> patched: John> OPT= -OPT:Olimit=0 -DNDEBUG -O John> BASECFLAGS= -OPT:Olimit=0
Thanks, this looks good.
Do you really want -DNDEBUG in OPT? It doesn't strike me as an optimization setting, so I would think it belongs in BASECFLAGS.
-- Sjoerd Mullender sjoerd@acm.org

John> OPT= -OPT:Olimit=0 -DNDEBUG -O John> BASECFLAGS= -OPT:Olimit=0
Sjoerd> Do you really want -DNDEBUG in OPT? It doesn't strike me as an Sjoerd> optimization setting, so I would think it belongs in BASECFLAGS.
I view it as a tossup. My intent was with BASECFLAGS was that if you messed with it you would likely break the build. Deleting OPT shouldn't have that effect. It might well compile differently, but it should still build.
Skip

On Tuesday, Nov 19, 2002, at 20:02 Europe/Amsterdam, Skip Montanaro wrote:
I uploaded the context diffs using Internet Explorer on my Mac. I just downloaded it to my Linux laptop using Opera and noticed a bit of corruption (NULs at the start and the end). The file is fine on my Mac.
My guess is that IE is uploading the file as MacBinary or AppleSingle format or some such.
Repeat after me: IE is evil! IE is evil! IE is evil! OmniWeb is good! OmniWeb is good! Chimera is pretty cool too! Chimera is pretty cool too! -- - Jack Jansen Jack.Jansen@oratrix.com http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman -
participants (5)
-
Jack Jansen
-
John Hunter
-
martin@v.loewis.de
-
Sjoerd Mullender
-
Skip Montanaro