classification
Title: Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4
Type: compile error Stage:
Components: Build Versions: Python 3.0, Python 2.7, Python 2.6
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: loewis Nosy List: akitada, barry, christian.heimes, jnoller, loewis, mark.dickinson, rpetrov, zvezdan
Priority: release blocker Keywords: patch

Created on 2008-10-25 18:01 by akitada, last changed 2009-09-10 12:50 by zvezdan. This issue is now closed.

Files
File name Uploaded Description Edit
issue4204.diff akitada, 2008-10-28 17:19 A single patch for all three problems w/ Misc/NEWS
Messages (25)
msg75215 - (view) Author: Akira Kitada (akitada) * Date: 2008-10-25 18:00
I was trying to build Python 2.6 on FreeBSD 4.11 and found it failed
to build some of the modules.

"""
Failed to find the necessary bits to build these modules:
_bsddb             _sqlite3           _tkinter
gdbm               linuxaudiodev      spwd
sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for
the module's name.


Failed to build these modules:
_multiprocessing   math               mmap
readline
"""

Because I don't have Berkeley DB, SQLite3 tk, GDBM installed on the
system and running FreeBSD,
there is no wonder it failed to build  _bsddb, _sqlite3, _tkinter,
gdbm, linuxaudiodev, spwd and sunaudiodev.

The problem is it failed to build _multiprocessing, math, mmap and readline.

Here are the outputs of each build failure.

"""
building '_multiprocessing' extension
creating
build/temp.freebsd-4.11-RELEASE-i386-2.6/usr/home/build/dev/Python-2.6/Modules/_multiprocessing
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -DHAVE_SEM_OPEN=1 -DHAVE_FD_TRANSFER=1
-DHAVE_SEM_TIMEDWAIT=1 -IModules/_multiprocessing -I.
-I/usr/home/build/dev/Python-2.6/./
Include -I. -IInclude -I./Include -I/usr/local/include
-I/usr/home/build/dev/Python-2.6/Include
-I/usr/home/build/dev/Python-2.6 -c
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/multiprocessing.c
-o b
uild/temp.freebsd-4.11-RELEASE-i386-2.6/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/multiprocessing.o
In file included from
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/multiprocessing.h:24,
                from
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/multiprocessing.c:9:
/usr/include/arpa/inet.h:89: warning: parameter has incomplete type
/usr/include/arpa/inet.h:92: warning: parameter has incomplete type
/usr/include/arpa/inet.h:96: warning: parameter has incomplete type
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/multiprocessing.c:
In function `multiprocessing_sendfd':
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/multiprocessing.c:102:
storage size of `dummy_iov' isn't known
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/multiprocessing.c:102:
warning: unused variable `dummy_iov'
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/multiprocessing.c:
In function `multiprocessing_recvfd':
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/multiprocessing.c:137:
storage size of `dummy_iov' isn't known
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/multiprocessing.c:137:
warning: unused variable `dummy_iov'
"""

"""
building 'cmath' extension
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I/usr/home/build/dev/Python-2.6/./Include -I.
-IInclude -I./Include -I/usr/local/include
-I/usr/home/build/dev/Python-2.6/I
nclude -I/usr/home/build/dev/Python-2.6 -c
/usr/home/build/dev/Python-2.6/Modules/cmathmodule.c -o
build/temp.freebsd-4.11-RELEASE-i386-2.6/usr/home/build/dev/Python-2.6/Modules/cmathmodule.o
/usr/home/build/dev/Python-2.6/Modules/cmathmodule.c: In function
`special_type':
/usr/home/build/dev/Python-2.6/Modules/cmathmodule.c:79: warning:
implicit declaration of function `copysign'
/usr/home/build/dev/Python-2.6/Modules/cmathmodule.c: In function `c_acos':
/usr/home/build/dev/Python-2.6/Modules/cmathmodule.c:152: warning:
implicit declaration of function `asinh'
/usr/home/build/dev/Python-2.6/Modules/cmathmodule.c: In function `c_atanh':
/usr/home/build/dev/Python-2.6/Modules/cmathmodule.c:345: warning:
implicit declaration of function `log1p'
gcc -shared
build/temp.freebsd-4.11-RELEASE-i386-2.6/usr/home/build/dev/Python-2.6/Modules/cmathmodule.o
-L/usr/local/lib -lm -o
build/lib.freebsd-4.11-RELEASE-i386-2.6/cmath.so
building 'math' extension
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I/usr/home/build/dev/Python-2.6/./Include -I.
-IInclude -I./Include -I/usr/local/include
-I/usr/home/build/dev/Python-2.6/I
nclude -I/usr/home/build/dev/Python-2.6 -c
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c -o
build/temp.freebsd-4.11-RELEASE-i386-2.6/usr/home/build/dev/Python-2.6/Modules/mathmodule.o
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c: In function `m_atan2':
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c:118: warning:
implicit declaration of function `copysign'
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c: In function
`math_acosh':
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c:272: `acosh'
undeclared (first use in this function)
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c:272: (Each
undeclared identifier is reported only once
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c:272: for each
function it appears in.)
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c: In function
`math_asinh':
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c:276: `asinh'
undeclared (first use in this function)
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c: In function
`math_atanh':
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c:283: `atanh'
undeclared (first use in this function)
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c: In function
`math_copysign':
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c:288: `copysign'
undeclared (first use in this function)
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c: In function
`math_log1p':
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c:301: `log1p'
undeclared (first use in this function)
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c: In function
`math_ldexp':
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c:666: `copysign'
used prior to declaration
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c:670: `copysign'
used prior to declaration
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c: In function
`math_modf':
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c:699: `copysign'
used prior to declaration
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c: In function `math_pow':
/usr/home/build/dev/Python-2.6/Modules/mathmodule.c:901: `copysign'
used prior to declaration
"""

"""
building 'mmap' extension
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I/usr/home/build/dev/Python-2.6/./Include -I.
-IInclude -I./Include -I/usr/local/include
-I/usr/home/build/dev/Python-2.6/I
nclude -I/usr/home/build/dev/Python-2.6 -c
/usr/home/build/dev/Python-2.6/Modules/mmapmodule.c -o
build/temp.freebsd-4.11-RELEASE-i386-2.6/usr/home/build/dev/Python-2.6/Modules/mmapmodule.o
/usr/home/build/dev/Python-2.6/Modules/mmapmodule.c: In function `initmmap':
/usr/home/build/dev/Python-2.6/Modules/mmapmodule.c:1440: warning:
implicit declaration of function `my_getallocationgranularity'
gcc -shared
build/temp.freebsd-4.11-RELEASE-i386-2.6/usr/home/build/dev/Python-2.6/Modules/mmapmodule.o
-L/usr/local/lib -o build/lib.freebsd-4.11-RELEASE-i386-2.6/mmap.so
*** WARNING: renaming "mmap" since importing it failed:
build/lib.freebsd-4.11-RELEASE-i386-2.6/mmap.so: Undefined symbol
"my_getallocationgranularity"
"""

"""
building 'readline' extension
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I/usr/home/build/dev/Python-2.6/./Include -I.
-IInclude -I./Include -I/usr/local/include
-I/usr/home/build/dev/Python-2.6/I
nclude -I/usr/home/build/dev/Python-2.6 -c
/usr/home/build/dev/Python-2.6/Modules/readline.c -o
build/temp.freebsd-4.11-RELEASE-i386-2.6/usr/home/build/dev/Python-2.6/Modules/readline.o
In file included from /usr/include/readline/readline.h:37,
                from /usr/home/build/dev/Python-2.6/Modules/readline.c:31:
/usr/include/readline/keymaps.h:40: warning: function declaration
isn't a prototype
/usr/include/readline/keymaps.h:41: warning: function declaration
isn't a prototype
/usr/include/readline/keymaps.h:42: warning: function declaration
isn't a prototype
/usr/include/readline/keymaps.h:43: warning: function declaration
isn't a prototype
In file included from /usr/home/build/dev/Python-2.6/Modules/readline.c:31:
/usr/include/readline/readline.h:343: warning: function declaration
isn't a prototype
/usr/home/build/dev/Python-2.6/Modules/readline.c:38: syntax error
before `rl_compentry_func_t'
/usr/home/build/dev/Python-2.6/Modules/readline.c:38: warning:
function declaration isn't a prototype
/usr/home/build/dev/Python-2.6/Modules/readline.c: In function
`set_completion_display_matches_hook':
/usr/home/build/dev/Python-2.6/Modules/readline.c:216:
`rl_compdisp_func_t' undeclared (first use in this function)
/usr/home/build/dev/Python-2.6/Modules/readline.c:216: (Each
undeclared identifier is reported only once
/usr/home/build/dev/Python-2.6/Modules/readline.c:216: for each
function it appears in.)
/usr/home/build/dev/Python-2.6/Modules/readline.c:216: syntax error
before `)'
/usr/home/build/dev/Python-2.6/Modules/readline.c: At top level:
/usr/home/build/dev/Python-2.6/Modules/readline.c:669: warning:
`on_completion_display_matches_hook' defined but not used
"""

Because FreeBSD is not listed on
http://www.python.org/dev/peps/pep-0011/, I suppose it's still a
supported platform.
msg75216 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-10-25 18:45
Even if a certain platform is supported, you can't infer that all
modules will build on it.

Can you propose a patch?
msg75227 - (view) Author: Akira Kitada (akitada) * Date: 2008-10-26 14:20
Attached patch fixes build problem of math and mmap.
Apparently, FreeBSD 4 does not make some math functions available when
_XOPEN_SOURCE is defined and unlike newer FreeBSD, it cannot be fixed 
with __BSD_VISIBLE macro.

As for readline, it just because
FreeBSD's readline does not have erl_compentry_func_t and Python 2.6
started to use it. When I cp Python-2.5.2/Modules/readline.c
Python-2.6/Modules/readline.c, it built successfully.
Probably this is not a good fix. I would be glad if someone suggests me
a better one.

Lastly, multiprocessing.
First I needed a patch like this to get rid of the warnings.

"""
--- Modules/_multiprocessing/multiprocessing.h.orig     Tue Oct 14
14:43:01 2008
+++ Modules/_multiprocessing/multiprocessing.h  Tue Oct 14 14:48:59 2008
@@ -20,7 +20,10 @@
 #  define SEM_VALUE_MAX LONG_MAX
 #else
 #  include <fcntl.h>                 /* O_CREAT and O_EXCL */
+#  include <netinet/in.h>
 #  include <sys/socket.h>
+#  include <arpa/inet.h>
+#  include <sys/uio.h>
 #  include <arpa/inet.h>             /* htonl() and ntohl() */
 #  if HAVE_SEM_OPEN
 #    include <semaphore.h>
"""

With this patch applied, I tried the build again and got the following
error.

"""
running build
running build_ext
INFO: Can't locate Tcl/Tk libs and/or headers
building '_multiprocessing' extension
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -DHAVE_SEM_OPEN=1 -DHAVE_FD_TRANSFER=1
-DHAVE_SEM_TIMEDWAIT=1 -IModules/_multiprocessing -I.
-I/usr/home/build/dev/Python-2.6/./Include -I. -IInclude -I./Include
-I/usr/local/include -I/usr/home/build/dev/Python-2.6/Include
-I/usr/home/build/dev/Python-2.6 -c
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/multiprocessing.c -o
build/temp.freebsd-4.11-RELEASE-i386-2.6/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/multiprocessing.o
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -DHAVE_SEM_OPEN=1 -DHAVE_FD_TRANSFER=1
-DHAVE_SEM_TIMEDWAIT=1 -IModules/_multiprocessing -I.
-I/usr/home/build/dev/Python-2.6/./Include -I. -IInclude -I./Include
-I/usr/local/include -I/usr/home/build/dev/Python-2.6/Include
-I/usr/home/build/dev/Python-2.6 -c
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/socket_connection.c
-o
build/temp.freebsd-4.11-RELEASE-i386-2.6/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/socket_connection.o
In file included from
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/socket_connection.c:190:
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/connection.h: In
function `connection_new':
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/connection.h:51:
warning: unknown conversion type character `z' in format
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/connection.h: In
function `connection_repr':
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/connection.h:401: warning:
unknown conversion type character `z' in format
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -DHAVE_SEM_OPEN=1 -DHAVE_FD_TRANSFER=1
-DHAVE_SEM_TIMEDWAIT=1 -IModules/_multiprocessing -I.
-I/usr/home/build/dev/Python-2.6/./Include -I. -IInclude -I./Include
-I/usr/local/include -I/usr/home/build/dev/Python-2.6/Include
-I/usr/home/build/dev/Python-2.6 -c
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/semaphore.c -o
build/temp.freebsd-4.11-RELEASE-i386-2.6/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/semaphore.o
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/semaphore.c: In
function `semlock_acquire':
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/semaphore.c:314:
warning: implicit declaration of function `sem_timedwait'
gcc -shared
build/temp.freebsd-4.11-RELEASE-i386-2.6/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/multiprocessing.o
build/temp.freebsd-4.11-RELEASE-i386-2.6/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/socket_connection.o
build/temp.freebsd-4.11-RELEASE-i386-2.6/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/semaphore.o
-L/usr/local/lib -o
build/lib.freebsd-4.11-RELEASE-i386-2.6/_multiprocessing.so
*** WARNING: renaming "_multiprocessing" since importing it failed:
build/lib.freebsd-4.11-RELEASE-i386-2.6/_multiprocessing.so: Undefined
symbol "sem_timedwait"
"""

Yes, sem_timedwait is not supported on FreeBSD 4.
I would like to find the replacement for that, 
but I'm not sure how I could solve this at this time.
msg75228 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-10-26 14:30
The setup.py file in the root directory doesn't have a special case for
freebsd4, just for Free BSD 5 to 8. Apparently FreeBSD doesn't support
SEM_TIMEDWAIT at all.

        elif platform in ('freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'):
            # FreeBSD's P1003.1b semaphore support is very experimental
            # and has many known problems. (as of June 2008)
            macros = dict(                  # FreeBSD
                HAVE_SEM_OPEN=0,
                HAVE_SEM_TIMEDWAIT=0,
                HAVE_FD_TRANSFER=1,
                )
            libraries = []
msg75229 - (view) Author: Akira Kitada (akitada) * Date: 2008-10-26 14:45
Thanks Christian,
Now all modules are working.

$ ./python
Python 2.6 (r26:66714, Oct 14 2008, 15:18:41) 
[GCC 2.95.4 20020320 [FreeBSD]] on freebsd4
Type "help", "copyright", "credits" or "license" for more information.
>>> import multiprocessing
>>> import math
>>> import mmap
>>> import readline
>>>
msg75230 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-10-26 14:48
No, you still have to create a patch for the readline module. ;)
msg75233 - (view) Author: Akira Kitada (akitada) * Date: 2008-10-26 16:19
Here's the one.

I tested this patch on FreeBSD 4.11 and 6.3.
Both worked. :)
msg75235 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-10-26 16:44
Can you provide a single patch for all three problems (setup.py,
configure.in and readline.c)? An update for Misc/NEWS is greatly
appreciated, too.

Could you test the patch on the Python 3.0 branch, too? I fear the 3.0
branch suffers from the same issues.
msg75249 - (view) Author: Akira Kitada (akitada) * Date: 2008-10-26 23:40
I will.
Would it be enough to test on trunk and py3k branch?

By the way, trunk seems to have some problem building now.

 ./Parser/asdl_c.py -h ./Include ./Parser/Python.asdl
env: python: No such file or directory
*** Error code 127

Stop in /usr/home/build/dev/python-svn.

Anyway, I'll work on this.
Thanks for the support.
msg75258 - (view) Author: Akira Kitada (akitada) * Date: 2008-10-27 17:28
Attached is the patch containing all fixes.
I tested this on py3k and trunk on FreeBSD 4.11.
The test was done by using unitests in Lib/test.
Because I could not find a test for readline and
multiprocessing's test does not work on systems with HAVE_SEM_OPEN=0,
I skipped test of readline and multiprocessing. 

Below is the result.
Unfortunately, test_math.py failed one of its test.
(Which was succeeded on FreeBSD 6.3)

## test_math.py w/ py3k ##

$ ./python Lib/test/test_math.py 
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
bash-3.2$ ./python Lib/test/test_math.py 
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) ... FAIL
test_exceptions (__main__.MathTests) ... ok
test_testfile (__main__.MathTests) ... ok
test_trunc (__main__.MathTests) ... ok
Doctest: ieee754.txt ... ok

======================================================================
FAIL: testTanh (__main__.MathTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_math.py", line 764, in testTanh
    math.copysign(1., -0.))
AssertionError: 1.0 != -1.0

----------------------------------------------------------------------
Ran 39 tests in 2.623s

FAILED (failures=1)
Traceback (most recent call last):
  File "Lib/test/test_math.py", line 891, in <module>
    test_main()
  File "Lib/test/test_math.py", line 888, in test_main
    run_unittest(suite)
  File "/usr/home/build/dev/py3k/Lib/test/support.py", line 698, in
run_unittest
    _run_suite(suite)
  File "/usr/home/build/dev/py3k/Lib/test/support.py", line 681, in
_run_suite
    raise TestFailed(err)
test.support.TestFailed: Traceback (most recent call last):
  File "Lib/test/test_math.py", line 764, in testTanh
    math.copysign(1., -0.))
AssertionError: 1.0 != -1.0


## test_mmap.py w/ py3k ##

$ ./python Lib/test/test_        
Display all 328 possibilities? (y or n)
bash-3.2$ ./python Lib/test/test_mmap.py 
test_access_parameter (__main__.MmapTests) ... ok
test_anonymous (__main__.MmapTests) ... ok
test_bad_file_desc (__main__.MmapTests) ... ok
test_basic (__main__.MmapTests) ... ok
test_double_close (__main__.MmapTests) ... ok
test_entire_file (__main__.MmapTests) ... ok
test_error (__main__.MmapTests) ... ok
test_extended_getslice (__main__.MmapTests) ... ok
test_extended_set_del_slice (__main__.MmapTests) ... ok
test_find_end (__main__.MmapTests) ... ok
test_move (__main__.MmapTests) ... ok
test_offset (__main__.MmapTests) ... ok
test_prot_readonly (__main__.MmapTests) ... ok
test_rfind (__main__.MmapTests) ... ok
test_subclass (__main__.MmapTests) ... ok
test_tougher_find (__main__.MmapTests) ... ok

----------------------------------------------------------------------
Ran 16 tests in 0.084s

OK

## test_math.py w/ python-trunk ##
$ ./python Lib/test/test_math.py 
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
bash-3.2$ ./python Lib/test/test_math.py 
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) ... FAIL
test_exceptions (__main__.MathTests) ... ok
test_testfile (__main__.MathTests) ... ok
test_trunc (__main__.MathTests) ... ok
Doctest: ieee754.txt ... ok

======================================================================
FAIL: testTanh (__main__.MathTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_math.py", line 768, in testTanh
    math.copysign(1., -0.))
AssertionError: 1.0 != -1.0

----------------------------------------------------------------------
Ran 39 tests in 2.374s

FAILED (failures=1)
Traceback (most recent call last):
  File "Lib/test/test_math.py", line 894, in <module>
    test_main()
  File "Lib/test/test_math.py", line 891, in test_main
    run_unittest(suite)
  File "/usr/home/build/dev/python-svn/Lib/test/test_support.py", line
710, in run_unittest
    _run_suite(suite)
  File "/usr/home/build/dev/python-svn/Lib/test/test_support.py", line
693, in _run_suite
    raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
  File "Lib/test/test_math.py", line 768, in testTanh
    math.copysign(1., -0.))
AssertionError: 1.0 != -1.0

## test_mmap.py w/ python-trunk ##
$ ./python Lib/test/test_mmap.py 
test_access_parameter (__main__.MmapTests) ... ok
test_anonymous (__main__.MmapTests) ... ok
test_bad_file_desc (__main__.MmapTests) ... ok
test_basic (__main__.MmapTests) ... ok
test_double_close (__main__.MmapTests) ... ok
test_entire_file (__main__.MmapTests) ... ok
test_error (__main__.MmapTests) ... ok
test_extended_getslice (__main__.MmapTests) ... ok
test_extended_set_del_slice (__main__.MmapTests) ... ok
test_find_end (__main__.MmapTests) ... ok
test_move (__main__.MmapTests) ... ok
test_offset (__main__.MmapTests) ... ok
test_prot_readonly (__main__.MmapTests) ... ok
test_rfind (__main__.MmapTests) ... ok
test_subclass (__main__.MmapTests) ... ok
test_tougher_find (__main__.MmapTests) ... ok

----------------------------------------------------------------------
Ran 16 tests in 0.094s

OK
msg75259 - (view) Author: Jesse Noller (jnoller) * (Python committer) Date: 2008-10-27 17:38
Please see issue3770 for details on the multiprocessing library, SEM_OPEN 
and freebsd. The short answer is that FreeBSD support for MP is not 
available.
msg75261 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-10-27 20:26
The test_math failure may well be due to a libm bug:  tanh(-0.0)
might be incorrectly (judging by the BSD man pages) dropping the negative 
sign from the negative zero.

In the output of ./configure, there should be a line that looks like:

checking whether tanh preserves the sign of zero... yes

I'm guessing that on your machine you get a "no" instead of a "yes"
there, indicating that tanh(-0.0) is 0.0 instead of -0.0 on your
platform.  Is this the case?
msg75262 - (view) Author: Roumen Petrov (rpetrov) * Date: 2008-10-27 20:53
about changes in configure.in(issue4204.diff) - it seems to me that we
could unify all darwin platforms.
msg75266 - (view) Author: Akira Kitada (akitada) * Date: 2008-10-27 22:38
Here's the output of configure.
Just as Mark said, it looks this is due to a libm bug.

"""
$ grep tanh config.log
configure:22062: checking whether tanh preserves the sign of zero
|        and tanh(-0.) == -0. */
|       atan2(tanh(-0.), -1.) == atan2(-0., -1.)) exit(0);
configure:22261: checking for atanh
ac_cv_func_atanh=yes
ac_cv_tanh_preserves_zero_sign=no
"""
msg75268 - (view) Author: Akira Kitada (akitada) * Date: 2008-10-27 23:28
Roumen,
in Darwin, there is a macro called _DARWIN_C_SOURCE,
which re-enables things disabled by _XOPEN_SOURCE or the like.
(At least on OS X 10.5.5)
msg75275 - (view) Author: Roumen Petrov (rpetrov) * Date: 2008-10-28 10:29
The patch issue4204.diff split cases for "FreeBSD/4.8* | Darwin/6* )".
Please look 10-15 lines below in same case statement
msg75293 - (view) Author: Akira Kitada (akitada) * Date: 2008-10-28 17:19
Thank you for pointing that out, Roumen!
I didn't realize that.
I updated the patch again.
msg75299 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-10-28 18:17
The patch looks fine to me.
msg75421 - (view) Author: Akira Kitada (akitada) * Date: 2008-10-31 17:02
Christian,
Thank you for the review.
Let me know if there is anything I could help with this.
msg75483 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2008-11-04 00:13
Christian, if you like the patch go ahead and land it.
msg75484 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-11-04 00:17
I don't fully grasp the details of the configure.in change. I don't have
the means to test the change on Mac and BSD. How should we pursue it?
The rest is fine with me.
msg75485 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-11-04 00:28
Martin, can you please review the configure.in change? Barry and I
agreed that you a most probably the best person for the job. :]
msg75505 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-11-04 20:47
Thanks for the patch. Committed as r67098, r67099, and r67100.
msg82619 - (view) Author: Zvezdan Petkovic (zvezdan) * Date: 2009-02-23 05:55
Part of this patch committed in -r 67098 breaks Mac OS X 10.5,
because the completion_matches() function is already declared in 
/usr/include/readline/readline.h and the new declaration conflicts with 
it.

If the lack of this declaration is a problem for FreeBSD, then it will 
have to be conditionally declared for FreeBSD platform, and perhaps 
specific version of FreeBSD 4.x.

Something along the lines of:
#ifdef __FreeBSD__
/* perhaps a specific FreeBSD version condition here 4.x? */
extern char **completion_matches(char *, CPFunction *);
#endif

I have a patch of an off-by-one out-of-bounds error in readline.c, that 
enables building Python with Mac OS X native readline/editline 
emulation.  There's no need for an external GNU readline port 
installation (unless one wants some features that editline perhaps 
doesn't have).

That patch worked fine with Python 2.4 ad 2.5, but when I tried it with 
Python 2.6.1 the build failed because of the conflicting declaration 
introduced with this tracker issue.  When the line

    extern char **completion_matches(char *, CPFunction *);

is commented out, the readline module compiles and works OK.
(Well, line 558 in setup.py needs to be uncommented to look like this:

        if platform == 'darwin' and os.uname()[2] < '9.':

to allow the use of Mac OS X readline/editline library)

I can submit the readline.c patch for Mac OS X in a separate tracker 
issue, but the changes done in this issue should be fixed separately in 
my opinion.

Please advise how to proceed.
msg92482 - (view) Author: Zvezdan Petkovic (zvezdan) * Date: 2009-09-10 12:50
I worked around the issue mentioned in msg82619.
The readline patch (issue 6877) is not adversely affected by the patch 
applied in this issue.  This issue can remain closed AFAIC.
History
Date User Action Args
2009-09-10 12:50:26zvezdansetmessages: + msg92482
2009-02-23 05:55:25zvezdansetnosy: + zvezdan
messages: + msg82619
2008-11-04 20:47:46loewissetstatus: open -> closed
messages: + msg75505
2008-11-04 00:28:30christian.heimessetassignee: barry -> loewis
messages: + msg75485
2008-11-04 00:17:13christian.heimessetmessages: + msg75484
2008-11-04 00:13:56barrysetmessages: + msg75483
2008-10-31 17:02:38akitadasetmessages: + msg75421
2008-10-28 18:17:55christian.heimessetassignee: barry
resolution: accepted
messages: + msg75299
2008-10-28 17:19:51akitadasetfiles: + issue4204.diff
messages: + msg75293
2008-10-28 17:16:01akitadasetfiles: - issue4204.diff
2008-10-28 17:15:54akitadasetfiles: - Modules_readline.c.diff
2008-10-28 17:15:43akitadasetfiles: - configure.in.diff
2008-10-28 10:29:45rpetrovsetmessages: + msg75275
2008-10-27 23:28:29akitadasetmessages: + msg75268
2008-10-27 22:38:22akitadasetmessages: + msg75266
2008-10-27 20:53:25rpetrovsetnosy: + rpetrov
messages: + msg75262
2008-10-27 20:26:45mark.dickinsonsetnosy: + mark.dickinson
messages: + msg75261
2008-10-27 17:38:00jnollersetmessages: + msg75259
2008-10-27 17:28:22akitadasetfiles: + issue4204.diff
messages: + msg75258
2008-10-27 13:32:54jnollersetnosy: + jnoller
2008-10-26 23:40:23akitadasetmessages: + msg75249
2008-10-26 16:44:22christian.heimessetpriority: release blocker
nosy: + barry
messages: + msg75235
versions: + Python 3.0, Python 2.7
2008-10-26 16:19:25akitadasetfiles: + Modules_readline.c.diff
messages: + msg75233
2008-10-26 14:48:39christian.heimessetmessages: + msg75230
2008-10-26 14:45:45akitadasetmessages: + msg75229
2008-10-26 14:30:36christian.heimessetnosy: + christian.heimes
messages: + msg75228
2008-10-26 14:20:38akitadasetfiles: + configure.in.diff
keywords: + patch
messages: + msg75227
components: + Build
2008-10-25 18:45:05loewissetnosy: + loewis
messages: + msg75216
2008-10-25 18:01:02akitadacreate