-
Prepend
CFLAGS="-O0"before you runsetup.py:% CFLAGS="-O0" python ./setup.pyThe
-O0will be appended toCFLAGSwhile compiling, therefore will override previous-O2setting. -
Another way is add
-O0toextra_compile_argsinsetup.py:moduleA = Extension('moduleA', ....., include_dirs = ['/usr/include', '/usr/local/include'], extra_compile_args = ["-O0"], ) -
If you want to remove all default flags, use:
% OPT="" python ./setup.py