building NumPy with gcc if Python was built with icc?!?

Hi All, Here's a potentially dumb question: is it possible to build NumPy with gcc, if python was built with icc? Right now, the build is failing in the toolchain check phase, because gcc doesn't know how to handle icc-specific c flags (like -fp-model, prec-sqrt, ...) In our environment we're providing an embedded python that our customers should be able to use and extend with 3rd party modules (like numpy). Problem is that our sw is built using icc, but we don't want to force our customers to do the same and we also don't want to build every possible 3rd party module for our customers. Thanks for your help, Christian This email and any attachments are intended solely for the use of the individual or entity to whom it is addressed and may be confidential and/or privileged. If you are not one of the named recipients or have received this email in error, (i) you should not read, disclose, or copy it, (ii) please notify sender of your receipt by reply email and delete this email and all attachments, (iii) Dassault Systemes does not accept or assume any liability or responsibility for any use of or reliance on this email. For other languages, go to http://www.3ds.com/terms/email-disclaimer

I'm not sure about anyone else, but having been playing around with both gcc and icc, I'm afraid you might be out of luck. Is there any reason why you can't use a Python distribution built with gcc? On Tue, Feb 16, 2016 at 7:39 PM, BERGER Christian <Christian.BERGER@3ds.com> wrote:

In principle this should work (offer may be void on windows which has its own special weirdnesses, but I assume you're not on windows). icc and gcc should both support the same calling conventions and so forth. It sounds like you're just running into an annoying build system configuration issue where python likes to remember the compiler options used to build python, and then when it's time to build extension modules then the extension modules ask distutils what to do and distutils tells them to use these remembered options to build themselves as well. So you want to look into what compiler flag defaults are being exported by your python build, and figure out some way to make it export the ones you want instead of the defaults. I don't think there's anything really numpy specific about this, since it's about cpython's own build system plus stdlib -- I'd try asking on python-list or so. -n On Feb 16, 2016 11:40 AM, "BERGER Christian" <Christian.BERGER@3ds.com> wrote:

On Tue, Feb 16, 2016 at 7:39 PM, BERGER Christian <Christian.BERGER@3ds.com> wrote:
If you are the one providing python, your best bet is to post process your python to strip the info from Intel-specific options. The process is convoluted, but basically: - at configure time, python makes a difference between CFLAGS and OPTS, and will store both in your Makefile - when python is installed, it will parse the Makefile and generate some dict written in the python stdlib as _sysconfigdata.py _sysconfigdata.py is what's used by distutils to build C extensions. This is only valid on Unix/cygwin, if you are on windows, the process is completely different. David

I'm not sure about anyone else, but having been playing around with both gcc and icc, I'm afraid you might be out of luck. Is there any reason why you can't use a Python distribution built with gcc? On Tue, Feb 16, 2016 at 7:39 PM, BERGER Christian <Christian.BERGER@3ds.com> wrote:

In principle this should work (offer may be void on windows which has its own special weirdnesses, but I assume you're not on windows). icc and gcc should both support the same calling conventions and so forth. It sounds like you're just running into an annoying build system configuration issue where python likes to remember the compiler options used to build python, and then when it's time to build extension modules then the extension modules ask distutils what to do and distutils tells them to use these remembered options to build themselves as well. So you want to look into what compiler flag defaults are being exported by your python build, and figure out some way to make it export the ones you want instead of the defaults. I don't think there's anything really numpy specific about this, since it's about cpython's own build system plus stdlib -- I'd try asking on python-list or so. -n On Feb 16, 2016 11:40 AM, "BERGER Christian" <Christian.BERGER@3ds.com> wrote:

On Tue, Feb 16, 2016 at 7:39 PM, BERGER Christian <Christian.BERGER@3ds.com> wrote:
If you are the one providing python, your best bet is to post process your python to strip the info from Intel-specific options. The process is convoluted, but basically: - at configure time, python makes a difference between CFLAGS and OPTS, and will store both in your Makefile - when python is installed, it will parse the Makefile and generate some dict written in the python stdlib as _sysconfigdata.py _sysconfigdata.py is what's used by distutils to build C extensions. This is only valid on Unix/cygwin, if you are on windows, the process is completely different. David
participants (4)
-
BERGER Christian
-
David Cournapeau
-
G Young
-
Nathaniel Smith