Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #11428 > unrolled thread

overriding default compile flags when building python extensions

Started byDrew Parsons <dparsons@debian.org>
First post2019-05-03 13:50 +0200
Last post2019-05-03 16:40 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.debian.maint.python


Contents

  overriding default compile flags when building python extensions Drew Parsons <dparsons@debian.org> - 2019-05-03 13:50 +0200
    Re: overriding default compile flags when building python extensions Ansgar <ansgar@debian.org> - 2019-05-03 14:10 +0200
    Re: overriding default compile flags when building python extensions Drew Parsons <dparsons@debian.org> - 2019-05-03 16:40 +0200

#11428 — overriding default compile flags when building python extensions

FromDrew Parsons <dparsons@debian.org>
Date2019-05-03 13:50 +0200
Subjectoverriding default compile flags when building python extensions
Message-ID<xTERr-6ns-3@gated-at.bofh.it>
Dear Debian Python community,

how does one control or override the default flags used by setup.py 
(setuptools module) when compiling a C extension for a python module?

The intention is to switch off -g in pygalmesh, because of memory 
constraints on 32 bit systems when compiling against CGAL, see 
Bug#928140, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=928140

A failed build, e.g. i386 at 
https://buildd.debian.org/status/fetch.php?pkg=pygalmesh&arch=i386&ver=0.3.1-1&stamp=1556128605&raw=0
shows -g is used twice.  The second usage comes from CFLAGS in 
dpkg-buildflags, which I can control.

The first -g is the problem (in "-DNDEBUG -g -fwrapv -O2 -Wall").  The 
advice from the internet (stackoverflow) is exceedingly poor on this 
question, in most cases addressing how to add flags, not how to change 
the existing default flags. Alternatives like
   OPT="" python3 ./setup.py
simply do not work.

The default in question appears to be the OPT variable defined in 
/usr/lib/python3.7/config-3.7m-x86_64-linux-gnu/Makefile

But how to override it?

Upstream (Nico) suggests instead to build with CC=clang++.  Is this a 
good alternative for Debian python modules?

Drew

[toc] | [next] | [standalone]


#11429

FromAnsgar <ansgar@debian.org>
Date2019-05-03 14:10 +0200
Message-ID<xTFaN-6JL-1@gated-at.bofh.it>
In reply to#11428
On Fri, 2019-05-03 at 19:49 +0800, Drew Parsons wrote:
> The first -g is the problem (in "-DNDEBUG -g -fwrapv -O2 -Wall").  The 
> advice from the internet (stackoverflow) is exceedingly poor on this 
> question, in most cases addressing how to add flags, not how to change 
> the existing default flags. Alternatives like
>    OPT="" python3 ./setup.py
> simply do not work.

Not sure about setup.py, but `-g0` (after `-g`) should also disable
debug information:

+---
| Level 0 produces no debug information at all.  Thus, -g0 negates -g.
+---

Ansgar

[toc] | [prev] | [next] | [standalone]


#11431

FromDrew Parsons <dparsons@debian.org>
Date2019-05-03 16:40 +0200
Message-ID<xTHvX-82q-3@gated-at.bofh.it>
In reply to#11428
Ansgar wrote:
> On Fri, 2019-05-03 at 19:49 +0800, Drew Parsons wrote:
> > The first -g is the problem (in "-DNDEBUG -g -fwrapv -O2 -Wall").
> 
> Not sure about setup.py, but `-g0` (after `-g`) should also disable
> debug information:
> 
> +---
> | Level 0 produces no debug information at all.  Thus, -g0 negates -g.
> +---


Thanks Ansgar. Weird (dangerous, even) if the flags can't be controlled 
directly.
But I can try the -g0 trick and see if it solves the problem.

Drew

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.maint.python


csiph-web