question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cython.Build.cythonize does not respect CC or GCC environment variables

See original GitHub issue

Cython.Build.cythonize does not respect the CC and / or GCC environment variables and defaults to the gcc binary. This is especially problematic with conda-build >= 3.0, where the {{ compiler('c') }} requirement installs compilers of the form x86_64-conda_cos6-linux-gnu-cc instead of cc, etc.

I created an example Cython package that fails to build using standard conda-build but passes if I create symlinks from gcc to ${GCC}.

See also: StackOverflow - Set default compiler when using Cython and setuptools to compile multiple extensions

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ostrokachcommented, Aug 7, 2018

Thank you for your help, and sorry for the noise.

This issue is not related to Cython.


For the benefit of others, for whatever reason, this issue only appears when the conda-forge channel is ahead of the defaults channel in the ~/.condarc file…

1reaction
scodercommented, Aug 7, 2018

Again, Cython is not calling the C compiler. It’s done by distutils, which makes use of $CC.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use a different C++ compiler in Cython? - Stack Overflow
Distutils by default uses the CC system environment variable to decide what compiler to use. You can run the python script such that...
Read more >
Source Files and Compilation - Cython's Documentation
One way is to compile it manually with the Cython compiler, e.g.: ... Note that if you are not relying on cythonize or...
Read more >
Python – How to tell distutils to use gcc - iTecNote
this flag is not recognized, because the compiler is clang: ... skipping 'Interface.cpp' Cython extension (up-to-date) building 'Interface' extension cc ...
Read more >
Thread Parallelism in Cython* - Intel
Cython * is a superset of Python* that additionally supports C ... set the proper environment variables and delete all previous build:.
Read more >
27122 (Compile with -march=native) - Sage Trac - SageMath
We try to respect the users choice and do not overwrite the flags if ... but anything else that respects the environment variables...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found