maciejkula / glove-python

Toy Python implementation of http://www-nlp.stanford.edu/projects/glove/
Apache License 2.0
1.25k stars 319 forks source link

OSX install error "gcc-4.9: error: unrecognized command line option '-Wshorten-64-to-32'" #30

Closed paul-english closed 9 years ago

paul-english commented 9 years ago

Here's the output of this one,

> python setup.py install
running install
running bdist_egg
running egg_info
writing pbr to glove.egg-info/pbr.json
writing requirements to glove.egg-info/requires.txt
writing glove.egg-info/PKG-INFO
writing top-level names to glove.egg-info/top_level.txt
writing dependency_links to glove.egg-info/dependency_links.txt
reading manifest file 'glove.egg-info/SOURCES.txt'
writing manifest file 'glove.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.10-intel/egg
running install_lib
running build_py
running build_ext
building 'glove.glove_cython' extension
gcc-4.9 -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c glove/glove_cython.c -o build/temp.macosx-10.10-intel-2.7/glove/glove_cython.o -fopenmp
gcc-4.9: error: unrecognized command line option '-Wshorten-64-to-32'
error: command 'gcc-4.9' failed with exit status 1

Trying to use llvm-gcc results in missing a -lgomp library which I assume is related to the -fopenmp flag in the setup file.

I think cython introduces the shorten-64-to-32 flag based on my python version, I may have to use a different version of that.

paul-english commented 9 years ago

Update: I was using a virtualenv that somehow got the OSX installed version of python rather than the one installed from brew. Cython saw this clang compiled version of python and generated the gcc flags from that. Recreating my venv with the brew installed python solved my issue here.