Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 256283 - python 2.5.4-r2 USE=threads - ./libpython2.5.so: undefined reference to `sem_init'
Summary: python 2.5.4-r2 USE=threads - ./libpython2.5.so: undefined reference to `sem_...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High minor (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
: 288929 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-01-25 07:25 UTC by Bernd Martin Wollny
Modified: 2015-02-28 07:54 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
python build log (dev-lang:python-2.5.4-r2:20090125-060851.log,128.11 KB, text/plain)
2009-01-26 08:13 UTC, Bernd Martin Wollny
Details
Build OK (dev-lang:python-2.5.4-r2:20090125-064005.log,507.29 KB, text/plain)
2009-01-26 08:16 UTC, Bernd Martin Wollny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Martin Wollny 2009-01-25 07:25:31 UTC
It seemed that dev-lang/python-2.5.4-r2 don't add -lpthread to the LDFLAGS 

[ebuild   R   ] dev-lang/python-2.5.4-r2  USE="berkdb doc examples gdbm ipv6 ncurses readline sqlite ssl threads tk xml -build -ucs2 -wininst" 0 kB

you can build dev-lang/python-2.5.4-r2 if you set the LDFLAGS



Reproducible: Always

Steps to Reproduce:
emerge dev-lang/python [2.5.4-r2]
Actual Results:  
build fails

Expected Results:  
build python

LDFLAGS="-lpthread" emerge dev-lang/python
solves the problem
Comment 1 Patrick Lauer gentoo-dev 2009-01-25 07:31:30 UTC
So what is the pthreads lib going to do with python? 
Last time I had a look the python interpreter doesn't use it, so it's a no-op as far as I can tell.
Comment 2 Bernd Martin Wollny 2009-01-25 11:06:23 UTC
You can use threads inside of python.
All modern languages supports threads 
see http://www.wellho.net/solutions/python-python-threads-a-first-example.html for a threading example. 

Boost-python supports threads too. 

Comment 3 Patrick Lauer gentoo-dev 2009-01-25 16:03:45 UTC
The CPython interpreter is using "green" threads, which means that it looks like one thread to the rest of the OS. It does not in any way support the pthreads lib out of the box, so I don't see how randomly adding it affects anything.
Comment 4 Bernd Martin Wollny 2009-01-26 08:13:05 UTC
Created attachment 179750 [details]
python build log

Build without LDFLAGS="-pthreaad"
Comment 5 Bernd Martin Wollny 2009-01-26 08:16:55 UTC
Created attachment 179751 [details]
Build OK

this was build with LDFLAGS="-lpthread"
Comment 6 Bernd Martin Wollny 2009-01-26 08:18:23 UTC
Please have a look at the log files. You will see that python is using the pthread library. 

Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2009-01-28 17:57:36 UTC
Please post your `emerge --info' too.
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2009-01-28 18:27:07 UTC
I don't see what could inject the acml stuff. Possibly something in CFLAGS. Meanwhile, this isn't really a major bug. With a stable system, I can compile 2.5.4-r2 fine. Please reopen this bug report with the requested information and any other information that may be key to solving this problem (note: injecting -lFOO flags into LDFLAGS is bad even as a workaround).
Comment 9 Patrizio Bassi 2009-10-17 14:04:35 UTC
*** Bug 288929 has been marked as a duplicate of this bug. ***
Comment 10 Patrizio Bassi 2009-10-17 14:05:19 UTC
for me it fails even after manually adding the pthread flag

can you please reopen?
Comment 11 Patrizio Bassi 2009-10-28 10:05:42 UTC
 Jeroen, Patrik,

for me this is starting to be a very blocking issue as i cannot compile any python version with threads use flag, required by several packages.

Can you reopen? i can take over and provide all info/logs/details you may been.

Thanks
Comment 12 Patrizio Bassi 2009-10-31 11:40:25 UTC
the error is in the configure too....

checking for poll... yes       
checking for pthread_init... no
checking for putenv... yes   


but seems not stopping so not adding the proper flags
Comment 13 A. Wilcox (awilfox) 2015-02-28 07:54:24 UTC
For what it's worth, I just ran in to someone having this issue wtih 2.7.9.  Tracked it down to "-fopenmp" in /etc/portage/make.conf CFLAGS.