diff options
| -rw-r--r-- | numpy/core/setup_common.py | 4 | ||||
| -rw-r--r-- | numpy/core/src/multiarray/temp_elide.c | 5 | ||||
| -rw-r--r-- | numpy/linalg/umath_linalg.cpp | 4 |
3 files changed, 12 insertions, 1 deletions
diff --git a/numpy/core/setup_common.py b/numpy/core/setup_common.py index a751acc6f..b948f68cb 100644 --- a/numpy/core/setup_common.py +++ b/numpy/core/setup_common.py @@ -142,7 +142,9 @@ OPTIONAL_HEADERS = [ "immintrin.h", # AVX "features.h", # for glibc version linux "xlocale.h", # see GH#8367 - "dlfcn.h", # dladdr + "dlfcn.h", # dladdr + "execinfo.h", # backtrace + "libunwind.h", # backtrace for LLVM/Clang using libunwind "sys/mman.h", #madvise ] diff --git a/numpy/core/src/multiarray/temp_elide.c b/numpy/core/src/multiarray/temp_elide.c index 34248076c..0bf500ed2 100644 --- a/numpy/core/src/multiarray/temp_elide.c +++ b/numpy/core/src/multiarray/temp_elide.c @@ -82,7 +82,12 @@ #define NPY_MIN_ELIDE_BYTES (32) #endif #include <dlfcn.h> + +#if defined HAVE_EXECINFO_H #include <execinfo.h> +#elif defined HAVE_LIBUNWIND_H +#include <libunwind.h> +#endif /* * linear search pointer in table diff --git a/numpy/linalg/umath_linalg.cpp b/numpy/linalg/umath_linalg.cpp index bbeb37906..bbb4bb896 100644 --- a/numpy/linalg/umath_linalg.cpp +++ b/numpy/linalg/umath_linalg.cpp @@ -50,7 +50,11 @@ using dispatch_scalar = typename std::conditional<std::is_scalar<typ>::value, sc } while (0) #if 0 +#if defined HAVE_EXECINFO_H #include <execinfo.h> +#elif defined HAVE_LIBUNWIND_H +#include <libunwind.h> +#endif void dbg_stack_trace() { |
