[SciPy-Dev] How to compile Scipy without optimisations -O0?

Matti Picus matti.picus at gmail.com
Tue Sep 29 02:43:37 EDT 2020


On 9/29/20 1:15 AM, Blair Azzopardi wrote:
> On Sun, 27 Sep 2020 at 21:49, Ralf Gommers <ralf.gommers at gmail.com 
> <mailto:ralf.gommers at gmail.com>> wrote:
>
>
>     On Sun, Sep 27, 2020 at 6:26 PM Blair Azzopardi <blairuk at gmail.com
>     <mailto:blairuk at gmail.com>> wrote:
>
>
>         Short of sifting through the numpy distutils package and
>         hacking the flags in, I was wondering if there's a recommended
>         way to do this in Scipy? I'm sure I'm just being daft.
>
>
>     No you got it, this is just badly designed - editing the flags in
>     numpy.distutils is the best we have unfortunately.
>
>
> Thanks.
>
> Eventually I resorted to creating a wrapper around gcc, ie
>
> >> ~/bin/cc_no_opt
> #!/bin/bash
> declare -a new_args
> for i in "${@:1}"
> do new_args+=("$i")
> done
> new_args+=("-g" "-O0")
> gcc ${new_args[@]}
>
> Then calling:
>
> CC=~/bin/cc_no_opt python setup.py build_ext --inplace



In NumPy, I can do (on Ubuntu) ``CFLAGS='-O0 -g' gdb --args runtests.py 
...`` to get a debug build. That doesn't work on SciPy?

Matti



More information about the SciPy-Dev mailing list