Skip to content

BUG: LLVM 15 libcxx: _ZNSt3__122__libcpp_verbose_abortEPKcz: symbol not found #23122

@RinCat

Description

@RinCat

Describe the issue:

When build numpy with LLVM 15 clang/clang++ and libcxx, it somehow include a symbol from libcxx in the file https://github.com/numpy/numpy/blob/main/numpy/core/src/npysort/binsearch.cpp

readelf -s --wide work/numpy-1.24.0-python3_10/temp.linux-x86_64-3.10/numpy/core/src/npysort/binsearch.o
94: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND _ZNSt3__122__libcpp_verbose_abortEPKcz

The symbol _ZNSt3__122__libcpp_verbose_abortEPKcz is used for abort a program with a special verbose information.
https://libcxx.llvm.org/UsingLibcxx.html#id7
https://reviews.llvm.org/D130562

I don't know why this symbol was added, the code of that cpp don't seem to be relevant.

The numpy can be loaded if using LD_PRELOAD=/usr/lib/libc++.so.1 python

Reproduce the code example:

import numpy

Error message:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/numpy/core/__init__.py", line 23, in <module>
    from . import multiarray
  File "/usr/lib/python3.10/site-packages/numpy/core/multiarray.py", line 10, in <module>
    from . import overrides
  File "/usr/lib/python3.10/site-packages/numpy/core/overrides.py", line 6, in <module>
    from numpy.core._multiarray_umath import (
ImportError: Error relocating /usr/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-x86_64-linux-gnu.so: _ZNSt3__122__libcpp_verbose_abortEPKcz: symbol not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.10/site-packages/numpy/__init__.py", line 141, in <module>
    from . import core
  File "/usr/lib/python3.10/site-packages/numpy/core/__init__.py", line 49, in <module>
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.10 from "/usr/lib/python-exec/python3.10/python"
  * The NumPy version is: "1.24.0"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: Error relocating /usr/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-x86_64-linux-gnu.so: _ZNSt3__122__libcpp_verbose_abortEPKcz: symbol not found

Runtime information:

1.24.0
3.10.9 (main, Jan 28 2023, 16:07:29) [Clang 15.0.7 ]
WARNING: `threadpoolctl` not found in system! Install it by `pip install threadpoolctl`. Once installed, try `np.show_runtime` again for more detailed build information
[{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
                      'found': ['SSSE3',
                                'SSE41',
                                'POPCNT',
                                'SSE42',
                                'AVX',
                                'F16C',
                                'FMA3',
                                'AVX2'],
                      'not_found': ['AVX512F',
                                    'AVX512CD',
                                    'AVX512_KNL',
                                    'AVX512_SKX',
                                    'AVX512_CLX',
                                    'AVX512_CNL',
                                    'AVX512_ICL']}}]
None

Context for the issue:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions