Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 634064

Summary: dev-lang/python builds fail with "-fopenmp" in CFLAGS/CXXFLAGS
Product: Gentoo Linux Reporter: Walter Dnes <waltdnes>
Component: Current packagesAssignee: Python Gentoo Team <python>
Status: CONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://bugs.python.org/issue31769
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Failed dev-lang/python build

Description Walter Dnes 2017-10-12 02:09:41 UTC
Created attachment 498412 [details]
Failed dev-lang/python build

Python build fails (2.7.12 and 3.4.5) when "-fopenmp" is included in CFLAGS/CXXFLAGS. System is 32-bit Gentoo x86. See attachment. As per floppym@gentoo.org on Gentoo-users in posts https://archives.gentoo.org/gentoo-user/message/08ad9212df9ce315fdc80367feff5e2a and https://archives.gentoo.org/gentoo-user/message/129230248ad39bb103e7480d0ec6ea3d

> glibc requires that you pass "-pthread" to gcc to enable
> pthreads. For some reason, configure is mis-detecting this.

Temporary workaround that builds properly...

LDFLAGS="-fopenmp" emerge =dev-lang/python-2.7.12 =dev-lang/python-3.4.5
Comment 1 Mike Gilbert gentoo-dev 2017-10-12 03:14:51 UTC
For reference, the gcc manual says that -fopenmp implies -pthread.

https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/C-Dialect-Options.html#index-fopenmp

When testing whether the compile needs -pthread for pthread support, Python's configure script includes the user's CFLAGS. It probably should not do that.