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

Easy installation on mac #13

Closed
edmondja opened this issue Aug 28, 2015 · 23 comments · Fixed by #25
Closed

Easy installation on mac #13

edmondja opened this issue Aug 28, 2015 · 23 comments · Fixed by #25

Comments

@edmondja
Copy link

Hello,

I was wondering if there was an easy way to install FastFM on mac,
because I have followed all the instructions of the updated readme
but only the last command fails :

In my terminal, when I exectue in the FastFM folder 'sudo pip install -e .' , I get :

fastFM/ffm.c:7789:32: warning: unused function '__pyx_f_5numpy_get_array_base' [-Wunused-function]
static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
^
21 warnings generated.
gcc -bundle -undefined dynamic_lookup -L/Users/edmondjacoupeau/anaconda/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.5-x86_64-2.7/fastFM/ffm.o -LfastFM/ -LfastFM-core/bin/ -LfastFM-core/externals/CXSparse/Lib/ -L/usr/lib/ -L/usr/lib/atlas-base/ -L/Users/edmondjacoupeau/anaconda/lib -lm -lfastfm -lcxsparse -lgsl -lgslcblas -lglib-2.0 -o /Users/edmondjacoupeau/fastFM/ffm.so
ld: warning: directory not found for option '-LfastFM-core/bin/'
ld: warning: directory not found for option '-L/usr/lib/atlas-base/'
ld: library not found for -lfastfm
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1


Command "/Users/edmondjacoupeau/anaconda/bin/python -c "import setuptools, tokenize; file='/Users/edmondjacoupeau/fastFM/setup.py'; exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" develop --no-deps" failed with error code 1 in /Users/edmondjacoupeau/fastFM

Do I have forgotten something ?

@ibayer
Copy link
Owner

ibayer commented Aug 29, 2015

Please start from scratch and list all comments you run including output.

ld: warning: directory not found for option '-LfastFM-core/bin/'
ld: warning: directory not found for option '-L/usr/lib/atlas-base

I looks like fastFM/fastFM-core didn't compile and you are missing the atlas library.

@edmondja
Copy link
Author

Hmmm ok thank you.

So I do it again from the begining :

  • I run "git clone --recursive https://github.com/ibayer/fastFM.git" :
    MacBook-Pro-de-Edmond:~ edmondjacoupeau$ git clone --recursive https://github.com/ibayer/fastFM.git
    fatal: destination path 'fastFM' already exists and is not an empty directory.
    MacBook-Pro-de-Edmond:~ edmondjacoupeau$
    MacBook-Pro-de-Edmond:~ edmondjacoupeau$
    (so it seems ok)

  • "pip install -r /fastFM/requirements.txt" :
    MacBook-Pro-de-Edmond:~ edmondjacoupeau$ pip install -r /fastFM/requirements.txt
    You are using pip version 7.1.0, however version 7.1.2 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    Could not open requirements file: [Errno 2] No such file or directory: '/fastFM/requirements.txt'

  • so I launch "pip install -r requirements.txt" from fastFM after doing "cd fastFM" :
    MacBook-Pro-de-Edmond:~ edmondjacoupeau$ cd fastFM
    MacBook-Pro-de-Edmond:fastFM edmondjacoupeau$ pip install -r requirements.txt
    You are using pip version 7.1.0, however version 7.1.2 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    Requirement already satisfied (use --upgrade to upgrade): Cython==0.22 in /Users/edmondjacoupeau/anaconda/lib/python2.7/site-packages (from -r requirements.txt (line 1))
    Requirement already satisfied (use --upgrade to upgrade): numpy==1.9.1 in /Users/edmondjacoupeau/anaconda/lib/python2.7/site-packages (from -r requirements.txt (line 2))
    Requirement already satisfied (use --upgrade to upgrade): pandas==0.15.2 in /Users/edmondjacoupeau/anaconda/lib/python2.7/site-packages (from -r requirements.txt (line 3))
    Requirement already satisfied (use --upgrade to upgrade): scikit-learn==0.16.0 in /Users/edmondjacoupeau/anaconda/lib/python2.7/site-packages (from -r requirements.txt (line 4))
    Requirement already satisfied (use --upgrade to upgrade): scipy==0.15.1 in /Users/edmondjacoupeau/anaconda/lib/python2.7/site-packages (from -r requirements.txt (line 5))
    Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /Users/edmondjacoupeau/anaconda/lib/python2.7/site-packages (from pandas==0.15.2->-r requirements.txt (line 3))
    Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in /Users/edmondjacoupeau/anaconda/lib/python2.7/site-packages (from pandas==0.15.2->-r requirements.txt (line 3))
    Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in /Users/edmondjacoupeau/anaconda/lib/python2.7/site-packages (from python-dateutil->pandas==0.15.2->-r requirements.txt (line 3))
    MacBook-Pro-de-Edmond:fastFM edmondjacoupeau$
    (so it is ok for the python libraries dependencies)

  • "brew install glib gsl argp-standalone":
    MacBook-Pro-de-Edmond:fastFM edmondjacoupeau$ brew install glib gsl argp-standalone
    Warning: glib-2.44.1 already installed
    Warning: gsl-1.16 already installed
    Warning: argp-standalone-1.3 already installed
    MacBook-Pro-de-Edmond:fastFM edmondjacoupeau$
    (so it is ok for the OSX dependencies)

  • "pip install -e fastFM/" after doing "cd ..":
    MacBook-Pro-de-Edmond:fastFM edmondjacoupeau$ cd ..
    MacBook-Pro-de-Edmond:~ edmondjacoupeau$ pip install -e fastFM/
    You are using pip version 7.1.0, however version 7.1.2 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    Obtaining file:///Users/edmondjacoupeau/fastFM
    Installing collected packages: fastFM
    Running setup.py develop for fastFM
    Complete output from command /Users/edmondjacoupeau/anaconda/bin/python -c "import setuptools, tokenize; file='/Users/edmondjacoupeau/fastFM/setup.py'; exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" develop --no-deps:
    running develop
    running egg_info
    writing fastFM.egg-info/PKG-INFO
    writing top-level names to fastFM.egg-info/top_level.txt
    writing dependency_links to fastFM.egg-info/dependency_links.txt
    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'fastFM.egg-info/SOURCES.txt'
    writing manifest file 'fastFM.egg-info/SOURCES.txt'
    running build_ext
    skipping 'fastFM/ffm.c' Cython extension (up-to-date)
    building 'ffm' extension
    gcc -fno-strict-aliasing -I/Users/edmondjacoupeau/anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -IfastFM/ -IfastFM-core/include/ -IfastFM-core/externals/CXSparse/Include/ -I/usr/include/ -I/usr/include/glib-2.0/ -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/Users/edmondjacoupeau/anaconda/lib/python2.7/site-packages/numpy/core/include -I/Users/edmondjacoupeau/anaconda/include/python2.7 -c fastFM/ffm.c -o build/temp.macosx-10.5-x86_64-2.7/fastFM/ffm.o
    error: unable to open output file 'build/temp.macosx-10.5-x86_64-2.7/fastFM/ffm.o': ''
    1 error generated.
    error: command 'gcc' failed with exit status 1


    Command "/Users/edmondjacoupeau/anaconda/bin/python -c "import setuptools, tokenize; file='/Users/edmondjacoupeau/fastFM/setup.py'; exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" develop --no-deps" failed with error code 1 in /Users/edmondjacoupeau/fastFM
    MacBook-Pro-de-Edmond:~ edmondjacoupeau$
    (and I am stuck here)

  • (
    I also try "cd fastFM/; make" but it gives me :
    MacBook-Pro-de-Edmond:~ edmondjacoupeau$ cd fastFM/; make
    ( cd fastFM-core ; /Applications/Xcode.app/Contents/Developer/usr/bin/make lib )
    ( cd src ; /Applications/Xcode.app/Contents/Developer/usr/bin/make lib )
    gcc pkg-config --cflags glib-2.0 -std=c99 -fPIC -g -Wall -O3 -I/include -I./src -I../externals/CXSparse/Include -c -o ffm_random.o ffm_random.c
    /bin/sh: pkg-config: command not found
    In file included from ffm_random.c:4:
    ./fast_fm.h:10:10: fatal error: 'cblas.h' file not found
    #include <cblas.h>
    ^
    1 error generated.
    make[2]: *** [ffm_random.o] Error 1
    make[1]: *** [lib] Error 2
    make: *** [all] Error 2
    MacBook-Pro-de-Edmond:fastFM edmondjacoupeau$
    )

@ibayer
Copy link
Owner

ibayer commented Sep 15, 2015

Hi, sorry for the late response. I would first check if the fastFM-core compiles properly.
Run the following and post output:

  • (cd fastFM/fastFM-core/; make clean; make)
  • (cd fastFM/fastFM-core/src/tests/; make clean; make; make check)

@edmondja
Copy link
Author

Hello,
No problem,
So it seems that there are errors after executing the first command line :

  • "cd fastFM/fastFM-core/; make clean; make" :
    MacBook-Pro-de-Edmond:~ edmondjacoupeau$ cd fastFM/fastFM-core/; make clean; make
    ( cd src ; /Applications/Xcode.app/Contents/Developer/usr/bin/make clean )
    rm -f kmath.o ffm_random.o ffm_als_mcmc.o ffm_utils.o ffm_sgd.o ffm.o cli.o
    rm -f ../bin/libfastfm.a
    rm -f ../bin/fastfm
    ( cd src ; /Applications/Xcode.app/Contents/Developer/usr/bin/make lib )
    gcc pkg-config --cflags glib-2.0 -std=c99 -fPIC -g -Wall -O3 -I/include -I./src -I../externals/CXSparse/Include -c -o kmath.o kmath.c
    /bin/sh: pkg-config: command not found
    kmath.c:23:9: warning: 'M_SQRT2' macro redefined [-Wmacro-redefined]
    #define M_SQRT2 1.41421356237309504880 /-- sqrt(2) */
    ^
    /usr/include/math.h:689:9: note: previous definition is here
    #define M_SQRT2 1.41421356237309504880168872420969808 /
    sqrt(2) /
    ^
    1 warning generated.
    gcc pkg-config --cflags glib-2.0 -std=c99 -fPIC -g -Wall -O3 -I/include -I./src -I../externals/CXSparse/Include -c -o ffm_random.o ffm_random.c
    /bin/sh: pkg-config: command not found
    In file included from ffm_random.c:4:
    ./fast_fm.h:10:10: fatal error: 'cblas.h' file not found
    #include <cblas.h>
    ^
    1 error generated.
    make[1]: *
    * [ffm_random.o] Error 1
    make: *** [lib] Error 2
    MacBook-Pro-de-Edmond:fastFM-core edmondjacoupeau$
  • and as expected, with the second too
    "cd fastFM/fastFM-core/src/tests/; make clean; make; make check" :
    MacBook-Pro-de-Edmond:~ edmondjacoupeau$ cd fastFM/fastFM-core/src/tests/; make clean; make; make check
    rm -f test_ffm_als_mcmc test_ffm_utils test_ffm_sgd test_random ffm_als_mcmc.o ffm_sgd.o
    rm -f .o
    gcc pkg-config --cflags gsl glib-2.0 -std=c99 -g -Wall -O0 -I.. -I../../externals/CXSparse/Include -c -o test_ffm_sgd.o test_ffm_sgd.c
    /bin/sh: pkg-config: command not found
    In file included from test_ffm_sgd.c:1:
    ../fast_fm.h:10:10: fatal error: 'cblas.h' file not found
    #include <cblas.h>
    ^
    1 error generated.
    make: *
    * [test_ffm_sgd.o] Error 1
    gtester test_random --keep-going --verbose
    TEST: test_random... (pid=0)

(gtester:992): GLib-WARNING *: Failed to execute test binary: test_random: L'ex?cution du processus fils ??test_random?? a ?chou? (No such file or directory)
FAIL: test_random
make: *
* [check] Error 1
MacBook-Pro-de-Edmond:tests edmondjacoupeau$

@ibayer
Copy link
Owner

ibayer commented Sep 15, 2015

./fast_fm.h:10:10: fatal error: 'cblas.h' file not found

You are missing the cblas library. Did you install the dependencies?
brew install glib gsl argp-standalone

@edmondja
Copy link
Author

Yes I did, look it says that its already installed :

MacBook-Pro-de-Edmond:~ edmondjacoupeau$ brew install glib gsl argp-standalone
Warning: glib-2.44.1 already installed
Warning: gsl-1.16 already installed
Warning: argp-standalone-1.3 already installed
MacBook-Pro-de-Edmond:~ edmondjacoupeau$

@ibayer
Copy link
Owner

ibayer commented Sep 15, 2015

I run "git clone --recursive https://github.com/ibayer/fastFM.git" :
MacBook-Pro-de-Edmond:~ edmondjacoupeau$ git clone --recursive https://github.com/ibayer/fastFM.git
fatal: destination path 'fastFM' already exists and is not an empty directory.

Delete the fastFM folder and clone again to make sure that you have the latest version.

MacBook-Pro-de-Edmond:~ edmondjacoupeau$
MacBook-Pro-de-Edmond:~ edmondjacoupeau$
(so it seems ok)

@edmondja
Copy link
Author

Here are the results with that command line, the previous one and another one with dependencies :

  • MacBook-Pro-de-Edmond:~ edmondjacoupeau$ git clone --recursive https://github.com/ibayer/fastFM.git
    Cloning into 'fastFM'...
    remote: Counting objects: 653, done.
    remote: Total 653 (delta 0), reused 0 (delta 0), pack-reused 653
    Receiving objects: 100% (653/653), 2.12 MiB | 1.43 MiB/s, done.
    Resolving deltas: 100% (391/391), done.
    Checking connectivity... done.
    Submodule 'fastFM-core' (https://github.com/ibayer/fastFM-core.git) registered for path 'fastFM-core'
    Cloning into 'fastFM-core'...
    remote: Counting objects: 129, done.
    remote: Total 129 (delta 0), reused 0 (delta 0), pack-reused 129
    Receiving objects: 100% (129/129), 57.73 KiB | 0 bytes/s, done.
    Resolving deltas: 100% (61/61), done.
    Checking connectivity... done.
    Submodule path 'fastFM-core': checked out '1ee0288365b4799fb5127006322897a0fd4c3a23'
    Submodule 'externals/CXSparse' (https://github.com/ibayer/CXSparse.git) registered for path 'externals/CXSparse'
    Cloning into 'externals/CXSparse'...
    remote: Counting objects: 137, done.
    remote: Total 137 (delta 0), reused 0 (delta 0), pack-reused 137
    Receiving objects: 100% (137/137), 100.14 KiB | 0 bytes/s, done.
    Resolving deltas: 100% (38/38), done.
    Checking connectivity... done.
    Submodule path 'fastFM-core/externals/CXSparse': checked out '534c2c1ea399f881f84c4cadba6c789bb4033e18'
    MacBook-Pro-de-Edmond:~ edmondjacoupeau$ brew install glib gsl argp-standalone
    Warning: glib-2.44.1 already installed
    Warning: gsl-1.16 already installed
    Warning: argp-standalone-1.3 already installed
  • MacBook-Pro-de-Edmond:~ edmondjacoupeau$ cd fastFM/fastFM-core/; make clean; make
    ( cd src ; /Applications/Xcode.app/Contents/Developer/usr/bin/make clean )
    rm -f kmath.o ffm_random.o ffm_als_mcmc.o ffm_utils.o ffm_sgd.o ffm.o cli.o
    rm -f ../bin/libfastfm.a
    rm -f ../bin/fastfm
    ( cd src ; /Applications/Xcode.app/Contents/Developer/usr/bin/make lib )
    gcc pkg-config --cflags glib-2.0 -std=c99 -fPIC -g -Wall -O3 -I/include -I./src -I../externals/CXSparse/Include -c -o kmath.o kmath.c
    /bin/sh: pkg-config: command not found
    kmath.c:23:9: warning: 'M_SQRT2' macro redefined [-Wmacro-redefined]
    #define M_SQRT2 1.41421356237309504880 /-- sqrt(2) */
    ^
    /usr/include/math.h:689:9: note: previous definition is here
    #define M_SQRT2 1.41421356237309504880168872420969808 /
    sqrt(2) /
    ^
    1 warning generated.
    gcc pkg-config --cflags glib-2.0 -std=c99 -fPIC -g -Wall -O3 -I/include -I./src -I../externals/CXSparse/Include -c -o ffm_random.o ffm_random.c
    /bin/sh: pkg-config: command not found
    In file included from ffm_random.c:4:
    ./fast_fm.h:10:10: fatal error: 'cblas.h' file not found
    #include <cblas.h>
    ^
    1 error generated.
    make[1]: *
    * [ffm_random.o] Error 1
    make: *** [lib] Error 2
  • MacBook-Pro-de-Edmond:~ edmondjacoupeau$ cd fastfm; pip install -r requirements.txt
    You are using pip version 7.1.0, however version 7.1.2 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    Requirement already satisfied (use --upgrade to upgrade): Cython==0.22 in /Users/edmondjacoupeau/anaconda/lib/python2.7/site-packages (from -r requirements.txt (line 1))
    Requirement already satisfied (use --upgrade to upgrade): numpy==1.9.1 in /Users/edmondjacoupeau/anaconda/lib/python2.7/site-packages (from -r requirements.txt (line 2))
    Requirement already satisfied (use --upgrade to upgrade): pandas==0.15.2 in /Users/edmondjacoupeau/anaconda/lib/python2.7/site-packages (from -r requirements.txt (line 3))
    Requirement already satisfied (use --upgrade to upgrade): scikit-learn==0.16.0 in /Users/edmondjacoupeau/anaconda/lib/python2.7/site-packages (from -r requirements.txt (line 4))
    Requirement already satisfied (use --upgrade to upgrade): scipy==0.15.1 in /Users/edmondjacoupeau/anaconda/lib/python2.7/site-packages (from -r requirements.txt (line 5))
    Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /Users/edmondjacoupeau/anaconda/lib/python2.7/site-packages (from pandas==0.15.2->-r requirements.txt (line 3))
    Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in /Users/edmondjacoupeau/anaconda/lib/python2.7/site-packages (from pandas==0.15.2->-r requirements.txt (line 3))
    Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in /Users/edmondjacoupeau/anaconda/lib/python2.7/site-packages (from python-dateutil->pandas==0.15.2->-r requirements.txt (line 3))
    MacBook-Pro-de-Edmond:fastfm edmondjacoupeau$

@ibayer
Copy link
Owner

ibayer commented Sep 17, 2015

./fast_fm.h:10:10: fatal error: 'cblas.h' file not found

Looks to me that you are missing the C library cblas. It's installed together with gsl on linux. Maybe that's not the case on OSX.

@edmondja
Copy link
Author

I tryed to install it like this https://pheiter.wordpress.com/2012/09/04/howto-installing-lapack-and-blas-on-mac-os/,
or correcting the problem like in this post :
BVLC/caffe#617
"
./include/caffe/util/mkl_alternate.hpp:13:10: fatal error: 'cblas.h' file not found
#include <cblas.h>

I found simply running

brew install openblas

fixed it for me.
"

But I still have the same problem, did somebody used fastFM on mac in practice ?

@ibayer
Copy link
Owner

ibayer commented Sep 17, 2015

But I still have the same problem, did somebody used fastFM on mac in practice ?

Yes, a few people use fastFM on mac.
See for example: #13

@edmondja
Copy link
Author

Hmmm ok, then I will to find why do I have this error and wait for somebody who knows why.

@tlikhomanenko
Copy link

Hey! I found solution and installed fastFM on mac:

brew update
brew install openblas pkg-config
brew link --force openblas
brew link --force glib
export CC=gcc # (Try to do all without this command. If it doesn't work try to add it.)
cd fastFM/fastFM-core/; make # (This maybe is not necessary, but I run it to be sure that `glib.h` and `cblas.h` work.)
pip install -e \fastFM

Will wait for your results of this installation =)

@edmondja
Copy link
Author

Hello,

Sorry for the late .
I've tried to execute those commands and here are the results :

  • "brew update" :
    MBP-de-Edmond:~ edmondjacoupeau$ brew update
    Already up-to-date.
  • "brew install openblas pkg-config" :
    MBP-de-Edmond:~ edmondjacoupeau$ brew install openblas pkg-config
    Error: No available formula for openblas
    ==> Searching formulae...
    ==> Searching taps...
  • "brew link --force openblas" :
    MBP-de-Edmond:~ edmondjacoupeau$ brew link --force openblas
    Error: No such keg: /usr/local/Cellar/openblas
  • "brew link --force glib" :
    MBP-de-Edmond:~ edmondjacoupeau$ brew link --force glib
    Warning: Already linked: /usr/local/Cellar/glib/2.46.0
    To relink: brew unlink glib && brew link glib
  • "export CC=gcc #" :
    nothing
  • "brew install openblas pkg-config export CC=gcc #" :
    Same thing
  • "brew link --force openblas export CC=gcc #" :
    Same thing
  • "brew link --force glib export CC=gcc #" :
    MBP-de-Edmond:fastFM-core edmondjacoupeau$ brew link --force glib export CC=gcc #
    Error: No such keg: /usr/local/Cellar/export
  • "cd fastFM/fastFM-core/; make #" :
    MBP-de-Edmond:~ edmondjacoupeau$ cd fastFM/fastFM-core/; make #
    ( cd src ; /Applications/Xcode.app/Contents/Developer/usr/bin/make lib )
    gcc pkg-config --cflags glib-2.0 -std=c99 -fPIC -g -Wall -O3 -I/include -I./src -I../externals/CXSparse/Include -c -o ffm_random.o ffm_random.c
    /bin/sh: pkg-config: command not found
    In file included from ffm_random.c:4:
    ./fast_fm.h:10:10: fatal error: 'cblas.h' file not found
    #include <cblas.h>
    ^
    1 error generated.
    make[1]: *** [ffm_random.o] Error 1
    make: *** [lib] Error 2

Thank you for helping me : ).

@tlikhomanenko
Copy link

Replace

brew install openblas pkg-config

with

brew install pkg-config
brew install openblas

and repeat all.

@edmondja
Copy link
Author

Understood, here are the results :

  • "brew install pkg-config" :
    MBP-de-Edmond:~ edmondjacoupeau$ brew install pkg-config
    ==> Downloading https://homebrew.bintray.com/bottles/pkg-config-0.28.el_capitan.
    ######################################################################## 100,0%
    ==> Pouring pkg-config-0.28.el_capitan.bottle.2.tar.gz
    🍺 /usr/local/Cellar/pkg-config/0.28: 10 files, 600K
  • "brew install openblas" :
    MBP-de-Edmond:~ edmondjacoupeau$ brew install openblas
    Error: No available formula for openblas
    ==> Searching formulae...
    ==> Searching taps...
    homebrew/science/openblas
  • "brew install openblas pkg-config" :
    MBP-de-Edmond:~ edmondjacoupeau$ brew install openblas pkg-config
    Error: No available formula for openblas
    ==> Searching formulae...
    ==> Searching taps...
    homebrew/science/openblas
  • "brew link --force openblas" :
    MBP-de-Edmond:~ edmondjacoupeau$ brew link --force openblas
    Error: No such keg: /usr/local/Cellar/openblas
  • "brew link --force glib" :
    MBP-de-Edmond:~ edmondjacoupeau$ brew link --force glib
    Warning: Already linked: /usr/local/Cellar/glib/2.46.0
    To relink: brew unlink glib && brew link glib
  • "export CC=gcc"
    nothing
  • "cd fastFM/fastFM-core/; make #" :
    MBP-de-Edmond:~ edmondjacoupeau$ cd fastFM/fastFM-core/; make #
    ( cd src ; /Applications/Xcode.app/Contents/Developer/usr/bin/make lib )
    gcc pkg-config --cflags glib-2.0 -std=c99 -fPIC -g -Wall -O3 -I/include -I./src -I../externals/CXSparse/Include -c -o ffm_random.o ffm_random.c
    In file included from ffm_random.c:4:
    ./fast_fm.h:10:10: fatal error: 'cblas.h' file not found
    #include <cblas.h>
    ^
    1 error generated.
    make[1]: *** [ffm_random.o] Error 1
    make: *** [lib] Error 2
  • "brew link --force openblas export CC=gcc" :
    MBP-de-Edmond:fastFM edmondjacoupeau$ brew link --force openblas export CC=gcc
    Error: No such keg: /usr/local/Cellar/openblas
  • "brew link --force glib export CC=gcc #" :
    "MBP-de-Edmond:fastFM edmondjacoupeau$ brew link --force glib export CC=gcc #
    Error: No such keg: /usr/local/Cellar/export
  • "brew install openblas pkg-config export CC=gcc #" :
    MBP-de-Edmond:fastFM edmondjacoupeau$ brew install openblas pkg-config export CC=gcc #
    Error: No available formula for openblas
    ==> Searching formulae...
    ==> Searching taps...

@tlikhomanenko
Copy link

What mac os version do you have?

@tlikhomanenko
Copy link

Try to do

brew untap homebrew/science;
brew update;
brew tap homebrew/science
brew install openblas

@edmondja
Copy link
Author

I have El Capitan, do you want me to downgrade to help us to fix it ?

  • MBP-de-Edmond:~ edmondjacoupeau$ brew untap homebrew/science;
    Error: No available tap homebrew/science.
  • MBP-de-Edmond:~ edmondjacoupeau$ brew update;
    Updated Homebrew from 0deba434 to 2c7a9b57.
    ==> Updated Formulae
    ssdb
  • MBP-de-Edmond:~ edmondjacoupeau$ brew tap homebrew/science
    ==> Tapping homebrew/science
    Cloning into '/usr/local/Library/Taps/homebrew/homebrew-science'...
    remote: Counting objects: 565, done.
    remote: Compressing objects: 100% (563/563), done.
    remote: Total 565 (delta 2), reused 77 (delta 1), pack-reused 0
    Receiving objects: 100% (565/565), 448.96 KiB | 0 bytes/s, done.
    Resolving deltas: 100% (2/2), done.
    Checking connectivity... done.
    Tapped 559 formulae (586 files, 3,0M)
  • MBP-de-Edmond:~ edmondjacoupeau$ brew install openblas
    ==> Installing openblas from homebrew/homebrew-science
    ==> Installing dependencies for homebrew/science/openblas: gmp, mpfr, lib
    ==> Installing homebrew/science/openblas dependency: gmp
    ==> Downloading https://homebrew.bintray.com/bottles/gmp-6.0.0a.el_capitan.bottl
    ######################################################################## 100,0%
    ==> Pouring gmp-6.0.0a.el_capitan.bottle.tar.gz
    🍺 /usr/local/Cellar/gmp/6.0.0a: 15 files, 3,2M
    ==> Installing homebrew/science/openblas dependency: mpfr
    ==> Downloading https://homebrew.bintray.com/bottles/mpfr-3.1.3.el_capitan.bottl
    ######################################################################## 100,0%
    ==> Pouring mpfr-3.1.3.el_capitan.bottle.tar.gz
    🍺 /usr/local/Cellar/mpfr/3.1.3: 24 files, 3,6M
    ==> Installing homebrew/science/openblas dependency: libmpc
    ==> Downloading https://homebrew.bintray.com/bottles/libmpc-1.0.3.el_capitan.bot
    ######################################################################## 100,0%
    ==> Pouring libmpc-1.0.3.el_capitan.bottle.tar.gz
    🍺 /usr/local/Cellar/libmpc/1.0.3: 10 files, 380K
    ==> Installing homebrew/science/openblas dependency: isl
    ==> Downloading https://homebrew.bintray.com/bottles/isl-0.14.1.el_capitan.bottl
    ######################################################################## 100,0%
    ==> Pouring isl-0.14.1.el_capitan.bottle.3.tar.gz
    🍺 /usr/local/Cellar/isl/0.14.1: 68 files, 3,2M
    ==> Installing homebrew/science/openblas dependency: gcc
    ==> Downloading https://homebrew.bintray.com/bottles/gcc-5.2.0.el_capitan.bottle
    ######################################################################## 100,0%
    ==> Pouring gcc-5.2.0.el_capitan.bottle.2.tar.gz
    ==> Caveats
    GCC has been built with multilib support. Notably, OpenMP may not work:
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60670
    If you need OpenMP support you may want to
    brew reinstall gcc --without-multilib
    ==> Summary
    🍺 /usr/local/Cellar/gcc/5.2.0: 1353 files, 248M
    ==> Installing homebrew/science/openblas
    ==> Using Homebrew-provided fortran compiler.
    This may be changed by setting the FC environment variable.
    ==> Downloading https://github.com/xianyi/OpenBLAS/archive/v0.2.14.tar.gz
    ==> Downloading from https://codeload.github.com/xianyi/OpenBLAS/tar.gz/v0.2.14
    ######################################################################## 100,0%
    ==> make FC=/usr/local/bin/gfortran libs netlib shared
    Last 15 lines from /Users/edmondjacoupeau/Library/Logs/Homebrew/openblas/01.make:
    printf("#define DLOCAL_BUFFER_SIZE\t%ld\n", (DGEMM_DEFAULT_Q * DGEMM_DEFAULT_UNROLL_N * 2 * 1 * sizeof(double)));
    ^
    getarch_2nd.c:69:50: error: use of undeclared identifier 'CGEMM_DEFAULT_Q'
    printf("#define CLOCAL_BUFFER_SIZE\t%ld\n", (CGEMM_DEFAULT_Q * CGEMM_DEFAULT_UNROLL_N * 4 * 2 * sizeof(float)));
    ^
    getarch_2nd.c:69:68: error: use of undeclared identifier 'CGEMM_DEFAULT_UNROLL_N'
    printf("#define CLOCAL_BUFFER_SIZE\t%ld\n", (CGEMM_DEFAULT_Q * CGEMM_DEFAULT_UNROLL_N * 4 * 2 * sizeof(float)));
    ^
    getarch_2nd.c:70:50: error: use of undeclared identifier 'ZGEMM_DEFAULT_Q'
    printf("#define ZLOCAL_BUFFER_SIZE\t%ld\n", (ZGEMM_DEFAULT_Q * ZGEMM_DEFAULT_UNROLL_N * 2 * 2 * sizeof(double)));
    ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    make: *** [getarch_2nd] Error 1
    Makefile:131: *** OpenBLAS: Detecting CPU failed. Please set TARGET explicitly, e.g. make TARGET=your_cpu_target. Please read README for the detail.. Stop.
    Warning: It appears you have MacPorts or Fink installed.
    Software installed with other package managers causes known problems for
    Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.

READ THIS: https://git.io/brew-troubleshooting
If reporting this issue please do so at (not Homebrew/homebrew):
https://github.com/homebrew/homebrew-science/issues

Warning:

  • MBP-de-Edmond:~ edmondjacoupeau$ brew install pkg-config
    Warning: pkg-config-0.28 already installed
  • MBP-de-Edmond:fastFM-core edmondjacoupeau$ brew install openblas pkg-config export CC=gcc #
    Error: No available formula for export
    ==> Searching formulae...
    iphotoexport
    ==> Searching taps...

@edubecks
Copy link

@edmondja I followed the guide here

brew install gcc brew install pkg-config brew install glib gsl argp-standalone brew install openblas brew link --force openblas brew link --force glib

I didn't need export CC=gcc

@edmondja
Copy link
Author

edmondja commented Dec 1, 2015

Hello,

Ok i tryed :

MacBook-Pro-de-Edmond:~ edmondjacoupeau$ brew install gcc brew install pkg-config brew install glib gsl argp-standalone brew install openblas brew link --force openblas brew link --force glib
Error: No available formula with the name "brew"
==> Searching for similarly named formulae...
These similarly named formulae were found:
brew-gem
brew-pip
homebrew/science/a5
homebrew/science/abacas
homebrew/science/abinit
homebrew/science/abyss
homebrew/science/abyss-explorer
homebrew/science/ace-corrector
homebrew/science/adam
homebrew/science/adol-c
homebrew/science/alembic
homebrew/science/alglib
homebrew/science/allpaths-lg
homebrew/science/alpscore
homebrew/science/amos
homebrew/science/analysis
homebrew/science/andi
homebrew/science/ann
homebrew/science/bamhash
...
homebrew/science/xrmc
homebrew/science/xylib
homebrew/science/yaggo
homebrew/science/yaha
homebrew/science/yass
homebrew/science/yeppp
homebrew/science/zoltan
nodebrew
To install one of them, run (for example):
brew install brew-gem
==> Searching taps...
These formulae were found in taps:
homebrew/completions/brew-cask-completion homebrew/php/phpbrew
homebrew/emacs/homebrew-mode Caskroom/cask/brewtarget
homebrew/php/brew-php-switcher Caskroom/cask/cakebrew
To install one of them, run (for example):
brew install homebrew/completions/brew-cask-completion

And this gives me a little error (i think because my version is too recent) :
MacBook-Pro-de-Edmond:~ edmondjacoupeau$ brew install glib gsl argp-standalone
Warning: gsl-1.16 already installed
Warning: argp-standalone-1.3 already installed
Error: glib-2.46.0 already installed
To install this version, first brew unlink glib

But FastFM still refuses to install :
MacBook-Pro-de-Edmond:~ edmondjacoupeau$ pip install -e fastFM/
Obtaining file:///Users/edmondjacoupeau/fastFM
Installing collected packages: fastFM
Running setup.py develop for fastFM
Complete output from command /Users/edmondjacoupeau/anaconda/bin/python3 -c "import setuptools, tokenize; file='/Users/edmondjacoupeau/fastFM/setup.py'; exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" develop --no-deps:
running develop
running egg_info
writing top-level names to fastFM.egg-info/top_level.txt
writing fastFM.egg-info/PKG-INFO
writing dependency_links to fastFM.egg-info/dependency_links.txt
warning: manifest_maker: standard file '-c' not found

reading manifest file 'fastFM.egg-info/SOURCES.txt'
writing manifest file 'fastFM.egg-info/SOURCES.txt'
running build_ext
skipping 'fastFM/ffm.c' Cython extension (up-to-date)
building 'ffm' extension
gcc -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/edmondjacoupeau/anaconda/include -arch x86_64 -IfastFM/ -IfastFM-core/include/ -IfastFM-core/externals/CXSparse/Include/ -I/usr/include/ -I/usr/include/glib-2.0/ -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/Users/edmondjacoupeau/anaconda/lib/python3.5/site-packages/numpy/core/include -I/Users/edmondjacoupeau/anaconda/include/python3.5m -c fastFM/ffm.c -o build/temp.macosx-10.5-x86_64-3.5/fastFM/ffm.o
In file included from fastFM/ffm.c:252:
In file included from /Users/edmondjacoupeau/anaconda/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /Users/edmondjacoupeau/anaconda/lib/python3.5/site-packages/numpy/core/include/numpy/ndarrayobject.h:18:
In file included from /Users/edmondjacoupeau/anaconda/lib/python3.5/site-packages/numpy/core/include/numpy/ndarraytypes.h:1781:
/Users/edmondjacoupeau/anaconda/lib/python3.5/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: "Using deprecated NumPy API, disable it by "          "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it by " \
 ^
fastFM/ffm.c:7041:134: warning: code will never be executed [-Wunreachable-code]
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                                                                                                                     ^~~~~~~
fastFM/ffm.c:8177:134: warning: code will never be executed [-Wunreachable-code]
    __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                                                                                                                     ^~~~~~~
fastFM/ffm.c:10014:138: warning: code will never be executed [-Wunreachable-code]
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                                                                                                                         ^~~~~~~
fastFM/ffm.c:10007:137: warning: code will never be executed [-Wunreachable-code]
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                                                                                                                        ^~~~~~~
fastFM/ffm.c:13359:138: warning: code will never be executed [-Wunreachable-code]
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                                                                                                                         ^~~~~~~
fastFM/ffm.c:13352:137: warning: code will never be executed [-Wunreachable-code]
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                                                                                                                        ^~~~~~~
fastFM/ffm.c:13928:138: warning: code will never be executed [-Wunreachable-code]
        __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                                                                                                                         ^~~~~~~
fastFM/ffm.c:13921:137: warning: code will never be executed [-Wunreachable-code]
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                                                                                                                        ^~~~~~~
In file included from fastFM/ffm.c:252:
In file included from /Users/edmondjacoupeau/anaconda/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /Users/edmondjacoupeau/anaconda/lib/python3.5/site-packages/numpy/core/include/numpy/ndarrayobject.h:27:
/Users/edmondjacoupeau/anaconda/lib/python3.5/site-packages/numpy/core/include/numpy/__multiarray_api.h:1634:1: warning: unused function '_import_array' [-Wunused-function]
_import_array(void)
^
fastFM/ffm.c:23115:32: warning: unused function '__Pyx_PyUnicode_FromString' [-Wunused-function]
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
                               ^
fastFM/ffm.c:23255:33: warning: unused function '__Pyx_PyInt_FromSize_t' [-Wunused-function]
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
                                ^
fastFM/ffm.c:20919:32: warning: unused function '__Pyx_GetItemInt_List_Fast' [-Wunused-function]
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                               ^
fastFM/ffm.c:20933:32: warning: unused function '__Pyx_GetItemInt_Tuple_Fast' [-Wunused-function]
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                               ^
fastFM/ffm.c:21293:1: warning: unused function '__pyx_add_acquisition_count_locked' [-Wunused-function]
__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
^
fastFM/ffm.c:21303:1: warning: unused function '__pyx_sub_acquisition_count_locked' [-Wunused-function]
__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
^
fastFM/ffm.c:21381:26: warning: unused function '__Pyx_PyBytes_Equals' [-Wunused-function]
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
                         ^
fastFM/ffm.c:22404:48: warning: unused function '__pyx_t_float_complex_from_parts' [-Wunused-function]
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
                                               ^
fastFM/ffm.c:22524:49: warning: unused function '__pyx_t_double_complex_from_parts' [-Wunused-function]
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
                                                ^
fastFM/ffm.c:22799:27: warning: function '__Pyx_PyInt_As_char' is not needed and will not be emitted [-Wunneeded-internal-declaration]
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
                          ^
fastFM/ffm.c:22894:27: warning: function '__Pyx_PyInt_As_long' is not needed and will not be emitted [-Wunneeded-internal-declaration]
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
                          ^
fastFM/ffm.c:6734:32: warning: unused function '__pyx_f_5numpy_PyArray_MultiIterNew1' [-Wunused-function]
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
                               ^
fastFM/ffm.c:6784:32: warning: unused function '__pyx_f_5numpy_PyArray_MultiIterNew2' [-Wunused-function]
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
                               ^
fastFM/ffm.c:6834:32: warning: unused function '__pyx_f_5numpy_PyArray_MultiIterNew3' [-Wunused-function]
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
                               ^
fastFM/ffm.c:6884:32: warning: unused function '__pyx_f_5numpy_PyArray_MultiIterNew4' [-Wunused-function]
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
                               ^
fastFM/ffm.c:6934:32: warning: unused function '__pyx_f_5numpy_PyArray_MultiIterNew5' [-Wunused-function]
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
                               ^
fastFM/ffm.c:7701:27: warning: unused function '__pyx_f_5numpy_set_array_base' [-Wunused-function]
static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
                          ^
fastFM/ffm.c:7789:32: warning: unused function '__pyx_f_5numpy_get_array_base' [-Wunused-function]
static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
                               ^
28 warnings generated.
gcc -bundle -undefined dynamic_lookup -L/Users/edmondjacoupeau/anaconda/lib -arch x86_64 build/temp.macosx-10.5-x86_64-3.5/fastFM/ffm.o -LfastFM/ -LfastFM-core/bin/ -LfastFM-core/externals/CXSparse/Lib/ -L/usr/lib/ -L/usr/lib/atlas-base/ -L/Users/edmondjacoupeau/anaconda/lib -lm -lfastfm -lcxsparse -lgsl -lgslcblas -lglib-2.0 -o /Users/edmondjacoupeau/fastFM/ffm.cpython-35m-darwin.so
ld: warning: directory not found for option '-LfastFM-core/bin/'
ld: warning: directory not found for option '-L/usr/lib/atlas-base/'
ld: library not found for -lfastfm
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1

----------------------------------------

Command "/Users/edmondjacoupeau/anaconda/bin/python3 -c "import setuptools, tokenize; file='/Users/edmondjacoupeau/fastFM/setup.py'; exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" develop --no-deps" failed with error code 1 in /Users/edmondjacoupeau/fastFM

Thank you.

@ibayer ibayer mentioned this issue Jan 10, 2016
3 tasks
@ibayer
Copy link
Owner

ibayer commented Jan 11, 2016

All external dependencies have been removed and Travis CI has been enabled to make sure the OSX build works. Please have a look at the updated README.

@edmondja
Copy link
Author

Factorization Machines works now perfectly on El Capitan !
Thank you very much Immanuel, and thanks to all the contributors !

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 a pull request may close this issue.

4 participants