In case anybody else has this problem, the solution is to add "-O" in extra_compile_args, which will override the "-O3" normally used. This is done in the setup.py file.