Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS X clang compiler look up. #795

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

estobbart
Copy link

OS X Version 10.9.5 with XCode w/ command line tools installed.

$ pip install uwsgi
build/uwsgi/uwsgiconfig.py", line 692, in __init__
    gcc_major = int(gcc_version.split('.')[0])
AttributeError: 'NoneType' object has no attribute 'split'
...
uwsgi/uwsgiconfig.py", line 695, in __init__
    raise Exception("you need a C compiler to build uWSGI")

@xrmx
Copy link
Collaborator

xrmx commented Dec 18, 2014

Since clang is default is default since a few (xcode 4.2 afaik) on mac os x, wouldn't be saner to go straight with clang / llvm-something on darwin instead? FYI On linux clang 3.5.0 reports 4.2.1 with -dumpversion.

@unbit
Copy link
Owner

unbit commented Dec 18, 2014

@xrmx the problem is that we "should" try to use the same compiler used to build python, and often this is not available on the system

@estobbart
Copy link
Author

@gformich
Copy link

Any status on this PR? Wondering if there is a plan to fix compilation on OS X.

Thank you

@estobbart
Copy link
Author

Some additional info on the problem..

>>> os.environ.get('CC', sysconfig.get_config_var('CC'))`
gcc-4.2
>>> spcall('llvm-gcc-4.2 -dumpversion')
None

Results in a compiler not found error, when it's really compiler version unknown.

>>> spcall('llvm-gcc -dumpversion')
4.2.1

The split fixes the dumpversion.

@unbit
Copy link
Owner

unbit commented May 19, 2015

Currently on OSX the best thing you can do is forcing a specific compiler with CC=xxx. Personally i always use

CC=clang make

but others users could prefer others compilers

@hhstore
Copy link

hhstore commented Jan 14, 2016

my Mac happens similar error. i find a way fix it.

my Mac env:

  • os: osx 10.11.2
  • py2: python2.7
    • pip2
    • virtualenv
  • py3: python3.4
    • pip3
    • virtualenv

when i install uwsgi, it is really weird. pip2 is OK, but pip3 happens error!

  • that is really weird, i do not know, why pip2 is OK, but pip3 is not work!
pip2 install uwsgi   # it is OK !

pip3 install uwsgi   # happens error !

How to fix it? for pip3 (python3.4)

# use this command. it works for me.
CC=gcc pip3 install uwsgi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants