Mailing List Archive

Debugging native cython module with visual studio toolchain
>
> Hi,
>
> We developed a Python module that interfaces with native code via Cython.
>
> We currently build on Windows with Visual Studio Toolchain.
>
> We encounter the following issues when trying to build a debug version:
>
> 1) 3rd party modules installed via PIP are Release mode, but Visual Studio
>> toolchain doesn't allow to mix Debug and Release libs. To workaround this
>> issue, we build our module in "Release" mode, with debug symbols enabled,
>> and with compiled optimization disabled (essentially a hack).
>
> 2) To build our module we currently use the following hack:
>
> step 1: run python.exe setup.py build --compiler=msvc
>
> step 2: extract the output
>
> step 3: change /Ox to /Od (disable compiler optimization)
>
> add /Zi flag to compiler flags (enable debug symbols)
>
> add /DEBUG flag to linker flags
>
>
>> Please advise what is the best solution?
>
>
--
https://mail.python.org/mailman/listinfo/python-list
Re: Debugging native cython module with visual studio toolchain [ In reply to ]
I can happily say I haven't used a Microsoft compiler/linker in decades,
but:
1) Maybe clang-cl will do what you want?
2) Maybe it'd be easier to put debugging print's/printf's/cout <<'s in your
code?

HTH

On Sat, Nov 14, 2020 at 1:55 PM Jeff <jmoguill2@gmail.com> wrote:

> >
> > Hi,
> >
> > We developed a Python module that interfaces with native code via Cython.
> >
> > We currently build on Windows with Visual Studio Toolchain.
> >
> > We encounter the following issues when trying to build a debug version:
> >
> > 1) 3rd party modules installed via PIP are Release mode, but Visual
> Studio
> >> toolchain doesn't allow to mix Debug and Release libs. To workaround
> this
> >> issue, we build our module in "Release" mode, with debug symbols
> enabled,
> >> and with compiled optimization disabled (essentially a hack).
> >
> > 2) To build our module we currently use the following hack:
> >
> > step 1: run python.exe setup.py build --compiler=msvc
> >
> > step 2: extract the output
> >
> > step 3: change /Ox to /Od (disable compiler optimization)
> >
> > add /Zi flag to compiler flags (enable debug symbols)
> >
> > add /DEBUG flag to linker flags
> >
> >
> >> Please advise what is the best solution?
> >
> >
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
https://mail.python.org/mailman/listinfo/python-list