GithubHelp home page GithubHelp logo

Installing on Mac OSX about implicit HOT 11 CLOSED

benfred avatar benfred commented on August 18, 2024 6
Installing on Mac OSX

from implicit.

Comments (11)

azmaktr avatar azmaktr commented on August 18, 2024 2
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-x50Fzy/implicit/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-02U13x-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.11-intel-2.7
    creating build/lib.macosx-10.11-intel-2.7/implicit
    copying implicit/__init__.py -> build/lib.macosx-10.11-intel-2.7/implicit
    copying implicit/als.py -> build/lib.macosx-10.11-intel-2.7/implicit
    copying implicit/nearest_neighbours.py -> build/lib.macosx-10.11-intel-2.7/implicit
    copying implicit/recommender_base.py -> build/lib.macosx-10.11-intel-2.7/implicit
    copying implicit/utils.py -> build/lib.macosx-10.11-intel-2.7/implicit
    running build_ext
    building 'implicit._als' extension
    creating build/temp.macosx-10.11-intel-2.7
    creating build/temp.macosx-10.11-intel-2.7/implicit
    g++-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/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c implicit/_als.cpp -o build/temp.macosx-10.11-intel-2.7/implicit/_als.o -Wno-unused-function -Wno-maybe-uninitialized -O3 -ffast-math -fopenmp
    g++-7: warning: x86_64 conflicts with i386 (arch flags ignored)
    g++-7: error: unrecognized command line option '-Wshorten-64-to-32'
    error: command 'g++-7' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-x50Fzy/implicit/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-02U13x-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-x50Fzy/implicit/

I have this error with GCC. Without GCC it works just fine.

from implicit.

benfred avatar benfred commented on August 18, 2024 1

Looks like I messed up on the install script =( will see about fixing tonight

As a short term hack to install, you can go 'cython implicit/_implicit.pyx' to generate the _implicit.c file, and then you should be able to install from source.

from implicit.

benfred avatar benfred commented on August 18, 2024 1

We've tweaked the install script here recently - the compiled _implicit.c file is checked in, and I've changed the setup.py script to not require an openmp compatible compiler (if will just log an warning if it can't find one instead).

I think these issues should be resolved with these changes

from implicit.

titipata avatar titipata commented on August 18, 2024

Hello @benfred, I still got error after doing cython implicit/_implicit.pyx follows by python setup.py install as follows:

...
building 'implicit._implicit' extension
gcc-6 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -I/Users/titipat/anaconda3/include/python3.5m -c implicit/_implicit.c -o build/temp.macosx-10.5-x86_64-3.5/implicit/_implicit.o -fopenmp -ffast-math
gcc-6: error: unrecognized command line option '-Qunused-arguments'; did you mean '-Wunused-argument'?
gcc-6: error: unrecognized command line option '-Qunused-arguments'; did you mean '-Wunused-argument'?
error: command 'gcc-6' failed with exit status 1

(I'm on Mac OSX also)

from implicit.

benfred avatar benfred commented on August 18, 2024

@titipata Can you run this to see what the build flags are in your python install?

python -c 'import sysconfig; print(sysconfig.get_config_var("CFLAGS"))'

It should print out something like:

-fno-strict-aliasing -I/Users/ben/anaconda2/include -arch x86_64  -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes

I think maybe the CFLAGS in your python install are messed up somehow. You can try to fix by tweaking the ' _sysconfigdata.py' file in your python library.

from implicit.

titipata avatar titipata commented on August 18, 2024

@benfred, here is an output when I run following command.

-fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/titipat/anaconda3/include -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -I/Users/titipat/anaconda3/include -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk

Here is output when I run gcc --version (installed with homebrew).

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

I will thoroughly check what's the exact problem that I have.

from implicit.

LanceVan avatar LanceVan commented on August 18, 2024

I guess the problem may sloved after you running brew install gcc --without-multilib.

I try to run pip install implicit with gcc install by brew install gcc, but failed.
OpenMP has conflict with multilib, so you should install gcc by brew install gcc --without-multilib

@benfred

Good luck!

from implicit.

isofer avatar isofer commented on August 18, 2024

Hi @benfred
Thanks for this great package.
I tried to build the package and failed. I'm getting the same error as @titipata.

$ python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to implicit.egg-info/requires.txt
writing implicit.egg-info/PKG-INFO
writing top-level names to implicit.egg-info/top_level.txt
writing dependency_links to implicit.egg-info/dependency_links.txt
reading manifest file 'implicit.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'implicit.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.7-x86_64/egg
running install_lib
running build_py
running build_ext
building 'implicit._als' extension
creating build/temp.macosx-10.7-x86_64-2.7
creating build/temp.macosx-10.7-x86_64-2.7/implicit
g++-6 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -I/Users/imris/anaconda/envs/implicit/include/python2.7 -c implicit/_als.cpp -o build/temp.macosx-10.7-x86_64-2.7/implicit/_als.o -Wno-unused-function -Wno-maybe-uninitialized -O3 -ffast-math -fopenmp
g++-6: error: unrecognized command line option '-Qunused-arguments'; did you mean '-Wunused-argument'?
g++-6: error: unrecognized command line option '-Qunused-arguments'; did you mean '-Wunused-argument'?
error: command 'g++-6' failed with exit status 1

I re-installed gcc using brew install gcc --without-multilib as suggested by @LanceVan, but it didn't solve the problem.

Any suggestions?
Thanks

$ python -c 'import sysconfig; print(sysconfig.get_config_var("CFLAGS"))'
-fno-strict-aliasing -I/Users/imris/anaconda/envs/implicit/include  -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

from implicit.

benfred avatar benfred commented on August 18, 2024

I don't know where those flags could be coming from - there are valid for Clang but not for GCC. =(

I thought that the flags get imported from the sysconfig.get_config_var("CFLAGS") setting in your python distribution - but it doesn't look that for your (the compile flags you printed out aren't included, and the incorrect ones are there instead). Maybe you can add a line to the setup.py file to go like 'import sysconfig; print(sysconfig.get_config_var("CFLAGS"))' just to make sure that this works.

Alternatively, if you uninstall the GCC compiler from brew (or comment out the 'set_gcc' function in setup.py) this should skip trying to find an openmp compiler and go with clang instead - which should work, just be single threaded

from implicit.

dillon-quan avatar dillon-quan commented on August 18, 2024

Hello @benfred, I'm trying to install the library but I am running into a similar error. The first time I tried installing the library I typed the given command line from the documentation "pip install implicit". A window then popped up asking me to if I would like to install gcc for the library in which I clicked install. This eventually gave me an error that came with a bunch of disable code and a gcc error.

I then try to install the library by cloning and I still get the following error stating that a random file is not found. Any thoughts on what I can do to fix this?

EDIT: It seems the way i installed gcc did not cut it. It had to be installed through homebrew.

Thanks

running install
running bdist_egg
running egg_info
writing implicit.egg-info/PKG-INFO
writing dependency_links to implicit.egg-info/dependency_links.txt
writing requirements to implicit.egg-info/requires.txt
writing top-level names to implicit.egg-info/top_level.txt
reading manifest file 'implicit.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*' found under directory 'examples'
writing manifest file 'implicit.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.7-x86_64/egg
running install_lib
running build_py
running build_ext
building 'implicit.bpr' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda/include -arch x86_64 -I/anaconda/include -arch x86_64 -I/anaconda/include/python3.6m -c implicit/bpr.cpp -o build/temp.macosx-10.7-x86_64-3.6/implicit/bpr.o -Wno-unused-function -Wno-maybe-uninitialized -O3 -ffast-math -std=c++11
warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean
'-Wno-uninitialized'? [-Wunknown-warning-option]
implicit/bpr.cpp:534:10: fatal error: 'random' file not found
#include
^
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1

from implicit.

travismsanders687 avatar travismsanders687 commented on August 18, 2024

@oppaquan I was getting this same error. Upgrading my OS (mac) fixed it. Basically my LLVM and clang where not up-to-date.

from implicit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.