Compilation failure due to missing symbol pthread_atfork
See original GitHub issue#10614 introduced usage of pthread_atfork
if the pthread header was found. However this requires adding -lpthread
or -pthread
to the compiler flags so the symbols can be found.
This kinda works on x86 platforms because Python is usually build with pthreads already and the dynamic library contains all the symbols. However on e.g. Power9 libpthread
is a linker script contained a static part which contains e.g. pthread_atfork
which does now not get linked and hence usage fails with
File "/tmp/easybuild-tmp/eb-QqGzOJ/tmp81X11X/lib/python3.7/site-packages/scipy/__init__.py", line 156, in <module>
from . import fft
File "/tmp/easybuild-tmp/eb-QqGzOJ/tmp81X11X/lib/python3.7/site-packages/scipy/fft/__init__.py", line 81, in <module>
from ._helper import next_fast_len
File "/tmp/easybuild-tmp/eb-QqGzOJ/tmp81X11X/lib/python3.7/site-packages/scipy/fft/_helper.py", line 4, in <module>
from . import _pocketfft
File "/tmp/easybuild-tmp/eb-QqGzOJ/tmp81X11X/lib/python3.7/site-packages/scipy/fft/_pocketfft/__init__.py", line 3, in <module>
from .basic import *
File "/tmp/easybuild-tmp/eb-QqGzOJ/tmp81X11X/lib/python3.7/site-packages/scipy/fft/_pocketfft/basic.py", line 8, in <module>
from . import pypocketfft as pfft
ImportError: /tmp/easybuild-tmp/eb-QqGzOJ/tmp81X11X/lib/python3.7/site-packages/scipy/fft/_pocketfft/pypocketfft.cpython-37m-powerpc64le-linux-gnu.so: undefined symbol: pthread_atfork
(at easybuild/tools/run.py:529 in parse_cmd_output)
Proposed solution: Add -pthread
or -lpthread
to the link flags.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:11 (6 by maintainers)
Top Results From Across the Web
undefined symbol: pthread_atfork #2987 - xianyi/OpenBLAS
Hello, I'm using dlib library and when added to dlib support for openblas I'm getting when import dlib: Python 3.5.3 (default, Nov 10...
Read more >pthread_atfork fails to compile when declaring -nostartfiles
Your problem is that the outer wrapper function pthread_atfork seems to have been moved to libpthread_nonshared.a so that it can identify ...
Read more >Library symbol mismatch for pthread_atfork | Ars OpenForum
When we compile against the shared libraries for IPP using 4.8.2 and when certain IPP functions are invoked, we get an undefined reference ......
Read more >Solved: undefined reference to `pthread_atfork
I compile a program and the compiler shows me this error: ... I open the libpthread.log file and search the 'pthread_atfork' symbol.
Read more >[yocto] Python cryptography failing due to undefined symbol
undefined symbol : pthread_atfork. Have tried both the recipe that comes with Rocko and master of meta-openembedded.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That’s find @Flamefire. I think we’ve adequately diagnosed the problem without the log.
@peterbell10 As the logs are gone and recreating them takes a couple hours: Do you still need the logs? IMO my analysis above is complete and #11324 fixes the problem so I don’t know of what help the logs would be.