3

I am trying to compile a python module using a compiler other than 'gcc', specifically 'icc' (for efficiency reasons).

I tried forcing the compilation setting 'cc' to 'clang' but still that did not work as my extension was built using GCC.

Anyway, looking at this post https://bugs.python.org/issue35244, I guess the hopes of doing this using distutils are small.

So, as suggested in the aforementioned post, I looked into using 'setuptools'.

https://wiki.python.org/moin/ExtensionTutorial

How would you force the compilation of the example module to be carried out using a different compiler other than gcc?

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
PintoDoido
  • 1,011
  • 16
  • 35
  • Why do you need `icc` and `clang`? If you are not building an extension for PyPI. I can explain how to build and load python extensions without a setup.py -- this method allows you to build using custom compiler extensions too, but it will not be nice to upload something like this to PyPI. It is totally fine for local projects. – Szabolcs Dombi Mar 20 '19 at 12:13
  • I updated my question: I need icc for efficiency reasons – PintoDoido Mar 20 '19 at 12:57
  • 2
    What is the output of `CC="icc" python setup.py build_ext --verbose`? – hoefling Mar 30 '19 at 23:36

0 Answers0