./python Python 2.6.1 (r261:67515, Dec 9 2008, 13:06:41) [C] on sunos5 Type "help", "copyright", "credits" or "license" for more information. >>> import sys, struct >>> sys.version '2.6.1 (r261:67515, Dec 9 2008, 13:06:41) [C]' >>> struct.calcsize('P') 8 >>> ^D > ./python Lib/test/test_math.py # 64-bit WITH the patch testAcos (__main__.MathTests) ... ok testAcosh (__main__.MathTests) ... ok testAsin (__main__.MathTests) ... ok testAsinh (__main__.MathTests) ... ok testAtan (__main__.MathTests) ... ok testAtan2 (__main__.MathTests) ... ok testAtanh (__main__.MathTests) ... ok testCeil (__main__.MathTests) ... ok testConstants (__main__.MathTests) ... ok testCopysign (__main__.MathTests) ... ok testCos (__main__.MathTests) ... ok testCosh (__main__.MathTests) ... ok testDegrees (__main__.MathTests) ... ok testExp (__main__.MathTests) ... ok testFabs (__main__.MathTests) ... ok testFactorial (__main__.MathTests) ... ok testFloor (__main__.MathTests) ... ok testFmod (__main__.MathTests) ... ok testFrexp (__main__.MathTests) ... ok testFsum (__main__.MathTests) ... ok testHypot (__main__.MathTests) ... ok testIsinf (__main__.MathTests) ... ok testIsnan (__main__.MathTests) ... ok testLdexp (__main__.MathTests) ... ok testLog (__main__.MathTests) ... ok testLog10 (__main__.MathTests) ... ok testLog1p (__main__.MathTests) ... ok testModf (__main__.MathTests) ... ok testPow (__main__.MathTests) ... ok testRadians (__main__.MathTests) ... ok testSin (__main__.MathTests) ... ok testSinh (__main__.MathTests) ... ok testSqrt (__main__.MathTests) ... ok testTan (__main__.MathTests) ... ok testTanh (__main__.MathTests) ... ok test_exceptions (__main__.MathTests) ... ok test_testfile (__main__.MathTests) ... ok test_trunc (__main__.MathTests) ... ok Doctest: ieee754.txt ... ok ---------------------------------------------------------------------- Ran 39 tests in 2.341s OK > ./python Lib/test/test_math.py # 64-bit WITHOUT the patch testAcos (__main__.MathTests) ... ok testAcosh (__main__.MathTests) ... ok testAsin (__main__.MathTests) ... ok testAsinh (__main__.MathTests) ... ok testAtan (__main__.MathTests) ... ok testAtan2 (__main__.MathTests) ... ok testAtanh (__main__.MathTests) ... ok testCeil (__main__.MathTests) ... ok testConstants (__main__.MathTests) ... ok testCopysign (__main__.MathTests) ... ok testCos (__main__.MathTests) ... ok testCosh (__main__.MathTests) ... ok testDegrees (__main__.MathTests) ... ok testExp (__main__.MathTests) ... ok testFabs (__main__.MathTests) ... ok testFactorial (__main__.MathTests) ... ok testFloor (__main__.MathTests) ... ok testFmod (__main__.MathTests) ... ok testFrexp (__main__.MathTests) ... ok testFsum (__main__.MathTests) ... ok testHypot (__main__.MathTests) ... ok testIsinf (__main__.MathTests) ... ok testIsnan (__main__.MathTests) ... ok testLdexp (__main__.MathTests) ... ok testLog (__main__.MathTests) ... ok testLog10 (__main__.MathTests) ... ok testLog1p (__main__.MathTests) ... ok testModf (__main__.MathTests) ... ok testPow (__main__.MathTests) ... ok testRadians (__main__.MathTests) ... ok testSin (__main__.MathTests) ... ok testSinh (__main__.MathTests) ... ok testSqrt (__main__.MathTests) ... ok testTan (__main__.MathTests) ... ok testTanh (__main__.MathTests) ... ok test_exceptions (__main__.MathTests) ... ok test_testfile (__main__.MathTests) ... ok test_trunc (__main__.MathTests) ... ok Doctest: ieee754.txt ... ok ---------------------------------------------------------------------- Ran 39 tests in 2.365s OK Application of the patcH: > cp Modules/mathmodule{,ORIG}.c > patch -i math_log.patch Modules/mathmodule.c Looks like a unified context diff. done > diff Modules/mathmodule{,ORIG}.c 140,191d139 < Various platforms (Solaris, OpenBSD) do nonstandard things for log(0), < log(-ve), log(NaN). Here are wrappers for log and log10 that deal with < special values directly, passing positive non-special values through to < the system log/log10. < */ < < static double < m_log(double x) < { < if (Py_IS_FINITE(x)) { < if (x > 0.0) < return log(x); < errno = EDOM; < if (x == 0.0) < return -Py_HUGE_VAL; /* log(0) = -inf */ < else < return Py_NAN; /* log(-ve) = nan */ < } < else if (Py_IS_NAN(x)) < return x; /* log(nan) = nan */ < else if (x > 0.0) < return x; /* log(inf) = inf */ < else { < errno = EDOM; < return Py_NAN; /* log(-inf) = nan */ < } < } < < static double < m_log10(double x) < { < if (Py_IS_FINITE(x)) { < if (x > 0.0) < return log10(x); < errno = EDOM; < if (x == 0.0) < return -Py_HUGE_VAL; /* log10(0) = -inf */ < else < return Py_NAN; /* log10(-ve) = nan */ < } < else if (Py_IS_NAN(x)) < return x; /* log10(nan) = nan */ < else if (x > 0.0) < return x; /* log10(inf) = inf */ < else { < errno = EDOM; < return Py_NAN; /* log10(-inf) = nan */ < } < } < < < /* 813c761 < num = loghelper(arg, m_log, "log"); --- > num = loghelper(arg, log, "log"); 817c765 < den = loghelper(base, m_log, "log"); --- > den = loghelper(base, log, "log"); 836c784 < return loghelper(arg, m_log10, "log10"); --- > return loghelper(arg, log10, "log10"); 842d789 < > make > & log.make_patch > more log.make_patch running build running build_ext INFO: Can't locate Tcl/Tk libs and/or headers building 'crypt' extension cc -xtarget=native64 -G build/temp.solaris-2.10-i86pc-2.6/home2/jean/tools/64/Python-2.6.1/Modules/cryptmodule.o -lcrypt -lpython2.6 -o build/lib.solaris-2.10-i86pc-2.6/crypt.so ld: fatal: file /usr/lib/libcrypt.so: wrong ELF class: ELFCLASS32 ld: fatal: File processing errors. No output written to build/lib.solaris-2.10-i86pc-2.6/crypt.so building '_curses' extension cc -KPIC -xtarget=native64 -DNDEBUG -xO5 -I. -I/home2/jean/tools/64/Python-2.6.1/./Include -I. -IInclude -I./Include -I/home2/jean/tools/64/Python-2.6.1/Include -I/home2/jean/tools/64/Python-2.6.1 -c /home2/jean/tools/64/Python-2.6.1/Modules/_cursesmodule.c -o build/temp.solaris-2.10-i86pc-2.6/home2/jean/tools/64/Python-2.6.1/Modules/_cursesmodule.o "/usr/include/curses.h", line 122: warning: macro redefined: ERR "/home2/jean/tools/64/Python-2.6.1/Modules/_cursesmodule.c", line 708: warning: implicit function declaration: mvwchgat "/home2/jean/tools/64/Python-2.6.1/Modules/_cursesmodule.c", line 712: warning: implicit function declaration: wchgat thon-2.6.1/Modules/_cursesmodule.o -lcurses -ltermcap -lpython2.6 -o build/lib.solaris-2.10-i86pc-2.6/_curses.so *** WARNING: renaming "_curses" since importing it failed: ld.so.1: python: fatal: relocation error: file build/lib.solaris-2.10-i86pc-2.6/_curses.so: symbol mvwchgat: referenced symbol not found building '_curses_panel' extension cc -KPIC -xtarget=native64 -DNDEBUG -xO5 -I. -I/home2/jean/tools/64/Python-2.6.1/./Include -I. -IInclude -I./Include -I/home2/jean/tools/64/Python-2.6.1/Include -I/home2/jean/tools/64/Python-2.6.1 -c /home2/jean/tools/64/Python-2.6.1/Modules/_curses_panel.c -o build/temp.solaris-2.10-i86pc-2.6/home2/jean/tools/64/Python-2.6.1/Modules/_curses_panel.o "/usr/include/curses.h", line 122: warning: macro redefined: ERR cc -xtarget=native64 -G build/temp.solaris-2.10-i86pc-2.6/home2/jean/tools/64/Python-2.6.1/Modules/_curses_panel.o -lpanel -lcurses -ltermcap -lpython2.6 -o build/lib.solaris-2.10-i86pc-2.6/_curses_panel.so *** WARNING: renaming "_curses_panel" since importing it failed: No module named _curses building 'bz2' extension cc -xtarget=native64 -G build/temp.solaris-2.10-i86pc-2.6/home2/jean/tools/64/Python-2.6.1/Modules/bz2module.o -lbz2 -lpython2.6 -o build/lib.solaris-2.10-i86pc-2.6/bz2.so ld: fatal: file /usr/lib/libbz2.so: wrong ELF class: ELFCLASS32 ld: fatal: File processing errors. No output written to build/lib.solaris-2.10-i86pc-2.6/bz2.so building '_ctypes' extension cc -KPIC -xtarget=native64 -DNDEBUG -xO5 -I. -I/home2/jean/tools/64/Python-2.6.1/./Include -Ibuild/temp.solaris-2.10-i86pc-2.6/libffi/include -Ibuild/temp.solaris-2.10-i86pc-2.6/libffi -I/home2/jean/tools/64/Python-2.6.1/Modules/_ctypes/libffi/src -I. -IInclude -I./Include -I/home2/jean/tools/64/Python-2.6.1/Include -I/home2/jean/tools/64/Python-2.6.1 -c /home2/jean/tools/64/Python-2.6.1/Modules/_ctypes/_ctypes.c -o build/temp.solaris-2.10-i86pc-2.6/home2/jean/tools/64/Python-2.6.1/Modules/_ctypes/_ctypes.o "build/temp.solaris-2.10-i86pc-2.6/libffi/include/ffi.h", line 257: syntax error before or at: __attribute__ "build/temp.solaris-2.10-i86pc-2.6/libffi/include/ffi.h", line 257: warning: old-style declaration or incorrect type for: __attribute__ "build/temp.solaris-2.10-i86pc-2.6/libffi/include/ffi.h", line 257: warning: syntax error: empty declaration "/home2/jean/tools/64/Python-2.6.1/Modules/_ctypes/_ctypes.c", line 187: cannot recover from previous errors cc: acomp failed for /home2/jean/tools/64/Python-2.6.1/Modules/_ctypes/_ctypes.c Failed to find the necessary bits to build these modules: _bsddb _hashlib _sqlite3 _ssl _tkinter bsddb185 dl gdbm imageop linuxaudiodev ossaudiodev readline To find the necessary bits, look in setup.py in detect_modules() for the module's name. Failed to build these modules: _ctypes _curses _curses_panel bz2 crypt running build_scripts