> ./python Python 2.6.1 (r261:67515, Dec 9 2008, 12:30:26) [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, 12:30:26) [C]' >>> struct.calcsize('P') 4 >>> ^D > ./python Lib/test/test_math.py # 32-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 3.211s OK > ./python Lib/test/test_math.py # 32-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) ... FAIL testLog10 (__main__.MathTests) ... FAIL 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 ====================================================================== FAIL: testLog (__main__.MathTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_math.py", line 515, in testLog self.assertRaises(ValueError, math.log, NINF) AssertionError: ValueError not raised ====================================================================== FAIL: testLog10 (__main__.MathTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_math.py", line 537, in testLog10 self.assertRaises(ValueError, math.log10, NINF) AssertionError: ValueError not raised ---------------------------------------------------------------------- Ran 39 tests in 3.162s FAILED (failures=2) Traceback (most recent call last): File "Lib/test/test_math.py", line 894, in test_main() File "Lib/test/test_math.py", line 891, in test_main run_unittest(suite) File "/home2/jean/tools/Python-2.6.1/Lib/test/test_support.py", line 710, in run_unittest _run_suite(suite) File "/home2/jean/tools/Python-2.6.1/Lib/test/test_support.py", line 693, in _run_suite raise TestFailed(err) test.test_support.TestFailed: errors occurred; run in verbose mode for details 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 building 'math' extension cc -KPIC -xtarget=native -DNDEBUG -xO5 -I. -I/home2/jean/tools/Python-2.6.1/./Include -I/home2/jean/tools/include -I. -IInclude -I./Include -I/home2/jean/tools/Python-2.6.1/Include -I/home2/jean/tools/Python-2.6.1 -c /home2/jean/tools/Python-2.6.1/Modules/mathmodule.c -o build/temp.solaris-2.10-i86pc-2.6/home2/jean/tools/Python-2.6.1/Modules/mathmodule.o "/home2/jean/tools/Python-2.6.1/Modules/mathmodule.c", line 149: warning: implicit function declaration: finite cc -xtarget=native -G build/temp.solaris-2.10-i86pc-2.6/home2/jean/tools/Python-2.6.1/Modules/mathmodule.o -L/home2/jean/tools/lib -lm -lpython2.6 -o build/lib.solaris-2.10-i86pc-2.6/math.so building '_curses' extension cc -KPIC -xtarget=native -DNDEBUG -xO5 -I. -I/home2/jean/tools/Python-2.6.1/./Include -I/home2/jean/tools/include -I. -IInclude -I./Include -I/home2/jean/tools/Python-2.6.1/Include -I/home2/jean/tools/Python-2.6.1 -c /home2/jean/tools/Python-2.6.1/Modules/_cursesmodule.c -o build/temp.solaris-2.10-i86pc-2.6/home2/jean/tools/Python-2.6.1/Modules/_cursesmodule.o "/usr/include/curses.h", line 122: warning: macro redefined: ERR "/home2/jean/tools/Python-2.6.1/Modules/_cursesmodule.c", line 708: warning: implicit function declaration: mvwchgat "/home2/jean/tools/Python-2.6.1/Modules/_cursesmodule.c", line 712: warning: implicit function declaration: wchgat cc -xtarget=native -G build/temp.solaris-2.10-i86pc-2.6/home2/jean/tools/Python-2.6.1/Modules/_cursesmodule.o -L/home2/jean/tools/lib -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 wchgat: referenced symbol not found building '_curses_panel' extension cc -KPIC -xtarget=native -DNDEBUG -xO5 -I. -I/home2/jean/tools/Python-2.6.1/./Include -I/home2/jean/tools/include -I. -IInclude -I./Include -I/home2/jean/tools/Python-2.6.1/Include -I/home2/jean/tools/Python-2.6.1 -c /home2/jean/tools/Python-2.6.1/Modules/_curses_panel.c -o build/temp.solaris-2.10-i86pc-2.6/home2/jean/tools/Python-2.6.1/Modules/_curses_panel.o "/usr/include/curses.h", line 122: warning: macro redefined: ERR cc -xtarget=native -G build/temp.solaris-2.10-i86pc-2.6/home2/jean/tools/Python-2.6.1/Modules/_curses_panel.o -L/home2/jean/tools/lib -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 '_tkinter' extension I. -I/home2/jean/tools/Python-2.6.1/./Include -I/home2/jean/tools/include -I. -IInclude -I./Include -I/home2/jean/tools/Python-2.6.1/Include -I/home2/jean/tools/Python-2.6.1 -c /home2/jean/tools/Python-2.6.1/Modules/_tkinter.c -o build/temp.solaris-2.10-i86pc-2.6/home2/jean/tools/Python-2.6.1/Modules/_tkinter.o cc -KPIC -xtarget=native -DNDEBUG -xO5 -DWITH_APPINIT=1 -I/usr/openwin/include -I. -I/home2/jean/tools/Python-2.6.1/./Include -I/home2/jean/tools/include -I. -IInclude -I./Include -I/home2/jean/tools/Python-2.6.1/Include -I/home2/jean/tools/Python-2.6.1 -c /home2/jean/tools/Python-2.6.1/Modules/tkappinit.c -o build/temp.solaris-2.10-i86pc-2.6/home2/jean/tools/Python-2.6.1/Modules/tkappinit.o cc -xtarget=native -G build/temp.solaris-2.10-i86pc-2.6/home2/jean/tools/Python-2.6.1/Modules/_tkinter.o build/temp.solaris-2.10-i86pc-2.6/home2/jean/tools/Python-2.6.1/Modules/tkappinit.o -L/usr/openwin/lib -L/home2/jean/tools/lib -ltk8.4 -ltcl8.4 -lX11 -lpython2.6 -o build/lib.solaris-2.10-i86pc-2.6/_tkinter.so *** WARNING: renaming "_tkinter" since importing it failed: ld.so.1: python: fatal: libtk8.4.so: open failed: No such file or directory building '_ctypes' extension cc -KPIC -xtarget=native -DNDEBUG -xO5 -I. -I/home2/jean/tools/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/Python-2.6.1/Modules/_ctypes/libffi/src -I/home2/jean/tools/include -I. -IInclude -I./Include -I/home2/jean/tools/Python-2.6.1/Include -I/home2/jean/tools/Python-2.6.1 -c /home2/jean/tools/Python-2.6.1/Modules/_ctypes/_ctypes.c -o build/temp.solaris-2.10-i86pc-2.6/home2/jean/tool--More--s/Python-2.6.1/Modules/_ctypes/_ctypes.o "build/temp.solaris-2.10-i86pc-2.6/libffi/include/ffitarget.h", line 67: undefined symbol: FFI_DEFAULT_ABI "build/temp.solaris-2.10-i86pc-2.6/libffi/include/ffitarget.h", line 68: non-constant enumerator value "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/Python-2.6.1/Modules/_ctypes/_ctypes.c", line 187: cannot recover from previous errors cc: acomp failed for /home2/jean/tools/Python-2.6.1/Modules/_ctypes/_ctypes.c Failed to find the necessary bits to build these modules: _bsddb _hashlib _sqlite3 _ssl bsddb185 gdbm 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 _tkinter running build_scripts