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

Not able to install for Mac os High Sierra #1

Open
Alluxia-F opened this issue Jan 12, 2018 · 12 comments
Open

Not able to install for Mac os High Sierra #1

Alluxia-F opened this issue Jan 12, 2018 · 12 comments

Comments

@Alluxia-F
Copy link

Tried to use: pip install word batch but failed building wheel for py-lz4framed.

I do have python 3.6 installed under anaconda package.
The computer os: Mac os high sierra.

Does the library only work in linux operation system?

Thank you!

@anttttti
Copy link
Owner

It's been developed on Linux so far. There's only a couple of dependencies like py-lz4framed, but those might not compile on Mac/Windows.

The py-lz4framed library is only used for compression of feature cache files. If your use doesn't require this, it should be easy to disable the relevant parts from the source code and setup.py.

I've fixed the python2/python3 and spark/non-spark compatibilities, but the OS differences would need a look. There would need to be more tests added if other OS are expected to work. Additions are welcome. :)

@errx
Copy link

errx commented Jan 12, 2018

CC=gcc-7 CXX=g++-7 python setup.py install
compiling with gcc works for me (gcc is installed via brew)

@ffedericoni
Copy link

it doesn't work for me. I get this error message:
g++ -bundle -undefined dynamic_lookup -L/Users/fabriziofedericoni/anaconda/lib -L/Users/fabriziofedericoni/anaconda/lib -arch x86_64 build/temp.macosx-10.7-x86_64-3.6/wordbatch/extractors/extractors.o build/temp.macosx-10.7-x86_64-3.6/wordbatch/extractors/MurmurHash3.o -L/Users/fabriziofedericoni/anaconda/lib -o build/lib.macosx-10.7-x86_64-3.6/wordbatch/extractors/extractors.cpython-36m-darwin.so -fopenmp
clang: error: unsupported option '-fopenmp'
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
error: command 'g++' failed with exit status 1

How do I get Openmp?

@errx
Copy link

errx commented Jan 15, 2018

probably on your system g++ is an alias for clang

(try to install real gcc brew install gcc)

@ffedericoni
Copy link

I have gcc/g++ installed by brew, but indeed PIP was using clang.
I had to run

export CC=gcc-7
export CXX=g++-7

and then it worked. Setting the CC/CXX variables without export wasn't working .

Thanks.

@Alluxia-F
Copy link
Author

With the following steps, wordbatch installed on my Mac. Special thanks to @ffedericoni and @anttttti

  1. brew install gcc
  2. export CC=gcc-7
  3. export CXX=g++-7

@ymwdalex
Copy link

ymwdalex commented Jan 23, 2018

@anttttti I got this error when set CC=gcc-7 and CXX=g++-7. Do you have any clue to fix this? Thanks!

running install
running bdist_egg
running egg_info
writing requirements to Wordbatch.egg-info/requires.txt
writing Wordbatch.egg-info/PKG-INFO
writing top-level names to Wordbatch.egg-info/top_level.txt
writing dependency_links to Wordbatch.egg-info/dependency_links.txt
reading manifest file 'Wordbatch.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'Wordbatch.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.12-intel/egg
running install_lib
running build_py
running build_ext
skipping 'wordbatch/extractors/extractors.c' Cython extension (up-to-date)
building 'wordbatch.extractors.extractors' extension
gcc-7 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -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 i386 -arch x86_64 -pipe -I/Users/zhesun/.virtualenvs/venv2/lib/python2.7/site-packages/numpy/core/include -I. -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c wordbatch/extractors/extractors.c -o build/temp.macosx-10.12-intel-2.7/wordbatch/extractors/extractors.o -O3 -ffast-math
gcc-7: warning: x86_64 conflicts with i386 (arch flags ignored)
gcc-7: error: unrecognized command line option '-Wshorten-64-to-32'
error: command 'gcc-7' failed with exit status 1

@rachelqhuang
Copy link

I had the same issue. Then I tried
brew install gcc
export CC=gcc-7
export CXX=g++=-7

After those steps, I installed wordbatch again using pip3 install wordbatch. It seems to work now.
Thanks!

@anttttti
Copy link
Owner

Installation instructions will need an update. Just installed on a clean AWS Ubuntu 16.04 instance. Needed to call these before I could do pip install:

sudo apt-get update
sudo install gcc
sudo apt-get install --reinstall build-essential

@eejan
Copy link

eejan commented Mar 7, 2018

Please be carefully, if you are running anaconda, python are local. so, please do NOT use sudo.

brew install gcc # optional only if you don't have gcc-7
export CC=gcc-7
export CXX=g++=-7
pip install wordbatch

I used
"sudo pip install wordbatch" and it failed hundred of times.

@marvinxu-free
Copy link

i have install wordbatch on my mac according to @ffedericoni , while in my code, it can not found WordHash and FM_FTRL, this is the error message:

ImportError: dlopen(/Users/chaoxu/.pyenv/versions/anaconda3-5.1.0/lib/python3.6/site-packages/Wordbatch-1.3.5-py3.6-macosx-10.7-x86_64.egg/wordbatch/models/ftrl.cpython-36m-darwin.so, 2): Symbol not found: _GOMP_parallel Referenced from: /Users/chaoxu/.pyenv/versions/anaconda3-5.1.0/lib/python3.6/site-packages/Wordbatch-1.3.5-py3.6-macosx-10.7-x86_64.egg/wordbatch/models/ftrl.cpython-36m-darwin.so Expected in: flat namespace in /Users/chaoxu/.pyenv/versions/anaconda3-5.1.0/lib/python3.6/site-packages/Wordbatch-1.3.5-py3.6-macosx-10.7-x86_64.egg/wordbatch/models/ftrl.cpython-36m-darwin.so PyDev console: using IPython 6.2.1

what can i do to resolve this problem?

@anttttti
Copy link
Owner

It seems latest version of MacOS (Monterey) doesn't get the gcc-7 links right. Doing this resolves the compilation issues with clang not supporting OpenMP and gcc not found for compilation:
ln -s /usr/local/bin/gcc-7 /usr/local/bin/gcc

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

No branches or pull requests

8 participants