Title: multiprocessing does not compile on systems which do not define sem_timedwait
Type: compile error Stage: resolved
Components: Extension Modules Versions: Python 3.1, Python 2.6
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: jnoller Nosy List: aniou, asksol, brasse, dave.peckham, henry.precheur, iandekit, jnoller, sable, skrah, srid
Priority: normal Keywords:

Created on 2008-09-16 05:10 by henry.precheur, last changed 2013-01-17 12:40 by skrah. This issue is now closed.

File name Uploaded Description Edit
aix-patch brasse, 2008-10-07 12:05 Patching multiprocessing.
EKIT.PATCH3 iandekit, 2009-09-23 05:38 cope with missing sem_timedwait() on Solaris9
EKIT.PATCH2 iandekit, 2009-09-23 05:42 CMSG_SPACE/CMESG_LEN macros
Messages (9)
msg73291 - (view) Author: Henry Precheur (henry.precheur) Date: 2008-09-16 05:10
Compiling `multiprocessing` on OpenBSD fails. `iovec` is not declared.

Adding the following line to multiprocessing.c solves the problem:
#include <sys/uio.h>

But right after I got:
./python:build/lib.openbsd-4.4-amd64-2.6/ undefined
symbol 'sem_timedwait'

It looks like multiprocessing is using a function that is not defined in
OpenBSD and very likely on other BSD's (FreeBSD & NetBSD don't have a
man page for this function)

According to this page, some other systems don't have this function:
msg74427 - (view) Author: Mattias Brändström (brasse) Date: 2008-10-07 07:40
When trying to build Python 2.6 on AIX 5.2 the following error message:

 The steps I have taken prior to this are:
  1. export PATH=/usr/bin/:/usr/vacpp/bin/
  2. ./configure --with-gcc=xlc_r --with-cxx=xlC_r --disable-ipv6
  3. make

./Modules/ld_so_aix xlc_r -bI:Modules/python.exp build/temp.aix-5.2-
Modules/_multiprocessing/socket_connection.o build/temp.aix-5.2-
2.6/home/mabr/Python-2.6/Modules/_multiprocessing/semaphore.o -
L/usr/local/lib -o build/lib.aix-5.2-2.6/
ld: 0711-317 ERROR: Undefined symbol: .sem_timedwait
ld: 0711-317 ERROR: Undefined symbol: .CMSG_SPACE
ld: 0711-317 ERROR: Undefined symbol: .CMSG_LEN
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more 
*** WARNING: renaming "_multiprocessing" since importing it failed: No 
such file or directory
error: No such file or directory
make: The error code from the last command is 1.
msg74439 - (view) Author: Mattias Brändström (brasse) Date: 2008-10-07 12:05
Here is a small patch that lets me build on AIX 5.2.
msg75217 - (view) Author: Piotr Meyer (aniou) Date: 2008-10-25 18:55
I confirm build failure on NetBSD 4.0.1 (latest stable) - but
NetBSD-current is - probably - also affected:

*** WARNING: renaming "_multiprocessing" since importing it failed:
build/lib.netbsd-4.0.1-i386-2.6/ Undefined PLT
symbol "sem_timedwait" (symnum = 20)

system: NetBSD 4.0.1 (i386)
Python version: 2.6
msg93024 - (view) Author: Ian Donaldson (iandekit) Date: 2009-09-23 05:38
Similarly, compile fails on Solaris 9 due to lack of sem_timedwait()
so here is a patch for that.  Solaris 10 was the first Solaris
to have this function so the patch adapts for that case.
msg93025 - (view) Author: Ian Donaldson (iandekit) Date: 2009-09-23 05:42
Similar to aix-patch, I enclose what I did for compilation
on Solaris 9, using macros from Solaris 10's headers.

These differ slightly to the aix ones, but I don't know if the
difference matters.  (alignment related)
msg116024 - (view) Author: Sébastien Sablé (sable) Date: 2010-09-10 15:54
For info: I have no problem compiling _multiprocessing and passing the unittest test_multiprocessing with py3k rev84631 on AIX 6.1 with xlc_r compiler without the patch proposed here.

I don't know if this is due to some updates in Python (3.2alpha2+) or AIX (6.1).
msg120226 - (view) Author: Ask Solem (asksol) (Python committer) Date: 2010-11-02 14:44
What is the status of this issue?  There are several platform listed here, which I unfortunately don't have access to.
msg180127 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2013-01-17 12:40
On OpenBSD 5.2 this is fixed. The AIX buildbot looks okay and I doubt
that anyone will commit something for Solaris 9.
Date User Action Args
2013-01-17 12:40:00skrahsetstatus: open -> closed

nosy: + skrah
messages: + msg180127

resolution: out of date
stage: test needed -> resolved
2010-11-02 14:44:03asksolsetnosy: + asksol
messages: + msg120226
2010-09-10 15:54:12sablesetnosy: + sable
messages: + msg116024
2010-01-12 01:41:34sridsetnosy: + srid
2009-09-23 05:42:13iandekitsetfiles: + EKIT.PATCH2

messages: + msg93025
2009-09-23 05:38:36iandekitsetfiles: + EKIT.PATCH3
nosy: + iandekit
messages: + msg93024

2009-05-17 02:42:18ajaksu2setstage: test needed
versions: + Python 3.1, - Python 3.0
2008-10-25 18:55:45aniousetnosy: + aniou
messages: + msg75217
2008-10-12 15:39:32dave.peckhamsetnosy: + dave.peckham
2008-10-07 12:05:42brassesetfiles: + aix-patch
messages: + msg74439
2008-10-07 07:40:22brassesetnosy: + brasse
messages: + msg74427
2008-10-06 15:04:54jnollersettitle: multiprocessing does not compile on *BSD and potentialy other systems -> multiprocessing does not compile on systems which do not define sem_timedwait
2008-10-06 15:02:28jnollersetpriority: normal
assignee: jnoller
nosy: + jnoller
2008-09-16 05:10:02henry.precheurcreate