From 0e456919e6db50b8b8f65e2cef3fd73b2dd9b37f Mon Sep 17 00:00:00 2001 From: Gordon Mohr Date: Wed, 8 Jan 2020 11:35:48 -0800 Subject: [PATCH] symbols, no-optimizations for segfault debugging --- setup.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index b218eaa5d8..673d5fcf5a 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,14 @@ def make_c_ext(use_cython=False): for module, source in c_extensions.items(): if use_cython: source = source.replace('.c', '.pyx') - yield Extension(module, sources=[source], language='c') + extra_args = [] + extra_args.extend(['-g', '-O0']) + yield Extension( + module, + sources=[source], + language='c', + extra_compile_args=extra_args, + ) def make_cpp_ext(use_cython=False): @@ -63,7 +70,7 @@ def make_cpp_ext(use_cython=False): extra_args.append('-std=c++11') elif system == 'Darwin': extra_args.extend(['-stdlib=libc++', '-std=c++11']) - + extra_args.extend(['-g', '-O0']) for module, source in cpp_extensions.items(): if use_cython: source = source.replace('.cpp', '.pyx')