Set optimization level for build_ext ??
Hey, trying to use valgrind with some libraries generated via native python's extension capabilities (not boost) so, by default I see gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fPIC -I/usr/include/python2.4 .... (my files) I want -O0 not -O2 so valgrind can find line numbers more correctly... I tried using "extra_complie_args" but that appends -O0 to the same line, still has -O2 ... not sure if -O0 over-rides the -O2 from earlier in the invocation or if it is ignored in favor of -O2 it looks like gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fPIC -I/usr/include/python2.4 -c memrid.cpp -o build/temp.linux-i686-2.4/memrid.o -O0 can anyone help me to be sure that I'm using NO optimization when this is compiled (ie: how to turn it on/off?) thanks, -mike
Michael Wieher wrote:
Hey,
trying to use valgrind with some libraries generated via native python's extension capabilities (not boost)
so, by default I see
can anyone help me to be sure that I'm using NO optimization when this is compiled (ie: how to turn it on/off?)
This is neither a Python question nor a C++ question. I'm not telling you to get lost, but you might get better results in a GCC forum. -- Dave Abrahams BoostPro Computing http://www.boostpro.com
This is neither a Python question nor a C++ question. I'm not telling you to get lost, but you might get better results in a GCC forum.
No... maybe you're not familiar with the tool I'm trying to use. But you're WAY off. This belongs here. I think? This is the SIG for Python/C++ integration? so, for questions relating to things described on this (and related) page(s) http://www.python.org/doc/ext/intro.html I should ask here? even if it is NOT boost-related, it is DIRECTLY related to integrating C++ into Python. I'm sorry that I'm not using your software... Or, where? Obviously you didn't really read too closely, since what I'm actually talking about a binary created by the distutils module (a python module) that is directly importable into C++. that has NOTHING to do with GCC. At all, ever. My issue is the level of control distutils gives me when creating these library.so files. distutils allows one to create my-custom-library.so from C++ files that are importable into Python. I know I can do all this with boost, but at the moment I'm not trying to, I'm trying to use the built-in functionality that python provides via its (3rd time I say this) distutils module to create the library.so from C++ to be imported into python. If this list is for boost-only questions, then can anyone please point me to a place I can ask questions about Python's distutils, C++ integration. On Mon, Jun 30, 2008 at 12:27 PM, David Abrahams <dave@boostpro.com> wrote:
Michael Wieher wrote:
Hey,
trying to use valgrind with some libraries generated via native python's extension capabilities (not boost)
so, by default I see
can anyone help me to be sure that I'm using NO optimization when this is compiled (ie: how to turn it on/off?)
This is neither a Python question nor a C++ question. I'm not telling you to get lost, but you might get better results in a GCC forum.
-- Dave Abrahams BoostPro Computing http://www.boostpro.com _______________________________________________ C++-sig mailing list C++-sig@python.org http://mail.python.org/mailman/listinfo/c++-sig
Michael Wieher wrote:
This is neither a Python question nor a C++ question. I'm not telling you to get lost, but you might get better results in a GCC forum.
No... maybe you're not familiar with the tool I'm trying to use. But you're WAY off. This belongs here. I think? This is the SIG for Python/C++ integration? so, for questions relating to things described on this (and related) page(s)
http://www.python.org/doc/ext/intro.html
I should ask here? even if it is NOT boost-related, it is DIRECTLY related to integrating C++ into Python. I'm sorry that I'm not using your software...
It has nothing to do with my software. Your command-line used "gcc," which AFAIK will not do C++ compilation unless you use the variant called "g++"
Or, where? Obviously you didn't really read too closely, since what I'm actually talking about a binary created by the distutils module (a python module) that is directly importable into C++. that has NOTHING to do with GCC. At all, ever. My issue is the level of control distutils gives me when creating these library.so files.
distutils allows one to create my-custom-library.so from C++ files that are importable into Python.
I know I can do all this with boost, but at the moment I'm not trying to, I'm trying to use the built-in functionality that python provides via its (3rd time I say this) distutils module to create the library.so from C++ to be imported into python. If this list is for boost-only questions, then can anyone please point me to a place I can ask questions about Python's distutils, C++ integration.
It's not strictly a boost-only list, but few people here are doing this kind of thing with distutils. I suggest you find a distutils-related list if you want to ask where people know the answers. -- Dave Abrahams BoostPro Computing http://www.boostpro.com
Michael Wieher wrote:
My issue is the level of control distutils gives me when creating these library.so files.
distutils allows one to create my-custom-library.so from C++ files that are importable into Python.
I have found distutils to be lacking substantially support for non-trivial features. In particular, for python extension building I completely abandoned the idea of using the standard build_ext command. (In my own project I have replaced build_ext by my own version...) AFAIK distutils isn't developed (or even maintained) any more, so you may have little luck finding answers to your questions on any list. The simplest way to figure out why distutils behaves the way it does, and how to work around its limitations, may be by reading the distutils code. Good luck, Stefan -- ...ich hab' noch einen Koffer in Berlin...
Michael Wieher wrote:
Hey,
trying to use valgrind with some libraries generated via native python's extension capabilities (not boost)
so, by default I see
[...] where do you see that ? What exactly are you doing ? As David points out, this doesn't appear to be related neither to Python nor C++. As your subject line suggests, it may be a problem with boost.python's build system. If no-one on this list is able to help you with that, you may have better luck asking in the boost.build list (boost-build@lists.boost.org), or on IRC ( irc://irc.freenode.net/boost) Good luck, Stefan -- ...ich hab' noch einen Koffer in Berlin...
On Mon, Jun 30, 2008 at 6:55 PM, Michael Wieher <michael.wieher@gmail.com> wrote:
can anyone help me to be sure that I'm using NO optimization when this is compiled (ie: how to turn it on/off?)
I gave up on distutils a while ago, but I did at some point figure out how to exert some control over the compile flags. Two files that *may* demonstrate what you want: http://rdkit.svn.sourceforge.net/viewvc/rdkit/trunk/Python/RDBuild.py?revision=1&view=markup and http://rdkit.svn.sourceforge.net/viewvc/rdkit/trunk/Code/ChemicalFeatures/Wrap/setup.py?revision=1&view=markup Good luck, -greg
participants (4)
-
David Abrahams -
Greg Landrum -
Michael Wieher -
Stefan Seefeld