ibayer / fastFM

fastFM: A Library for Factorization Machines
http://ibayer.github.io/fastFM
Other
1.08k stars 204 forks source link

Compilation error on macOS 11.2 ARM #162

Closed louisabraham closed 3 years ago

louisabraham commented 3 years ago

Hi, I tried to install both from PyPI and by running the setup script from the cloned repository. I don't think there is something wrong with my Cython / clang installation as i'm able to compile other modules.

Here is what I get:

  ERROR: Command errored out with exit status 1:
   command: /Users/louisabraham/.pyenv/versions/3.8.8/bin/python3.8 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4h/6ffv5m955b1__zndw3khds6r0000gn/T/pip-install-agv1hwl1/fastfm_e059b9d826e74fea937f8077eba82471/setup.py'"'"'; __file__='"'"'/private/var/folders/4h/6ffv5m955b1__zndw3khds6r0000gn/T/pip-install-agv1hwl1/fastfm_e059b9d826e74fea937f8077eba82471/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/4h/6ffv5m955b1__zndw3khds6r0000gn/T/pip-wheel-8_05tv55
       cwd: /private/var/folders/4h/6ffv5m955b1__zndw3khds6r0000gn/T/pip-install-agv1hwl1/fastfm_e059b9d826e74fea937f8077eba82471/
  Complete output (172 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-11.2-x86_64-3.8
  creating build/lib.macosx-11.2-x86_64-3.8/fastFM
  copying fastFM/sgd.py -> build/lib.macosx-11.2-x86_64-3.8/fastFM
  copying fastFM/datasets.py -> build/lib.macosx-11.2-x86_64-3.8/fastFM
  copying fastFM/__init__.py -> build/lib.macosx-11.2-x86_64-3.8/fastFM
  copying fastFM/als.py -> build/lib.macosx-11.2-x86_64-3.8/fastFM
  copying fastFM/mcmc.py -> build/lib.macosx-11.2-x86_64-3.8/fastFM
  copying fastFM/bpr.py -> build/lib.macosx-11.2-x86_64-3.8/fastFM
  copying fastFM/utils.py -> build/lib.macosx-11.2-x86_64-3.8/fastFM
  copying fastFM/base.py -> build/lib.macosx-11.2-x86_64-3.8/fastFM
  copying fastFM/validation.py -> build/lib.macosx-11.2-x86_64-3.8/fastFM
  running build_ext
  skipping 'fastFM/ffm.c' Cython extension (up-to-date)
  building 'ffm' extension
  creating build/temp.macosx-11.2-x86_64-3.8
  creating build/temp.macosx-11.2-x86_64-3.8/fastFM
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/tcl-tk/include -I/usr/local/opt/readline/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/tcl-tk/include -I/usr/local/opt/readline/include -IfastFM/ -IfastFM-core/include/ -IfastFM-core/externals/CXSparse/Include/ -I/Users/louisabraham/.pyenv/versions/3.8.8/lib/python3.8/site-packages/numpy/core/include -I/Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8 -c fastFM/ffm.c -o build/temp.macosx-11.2-x86_64-3.8/fastFM/ffm.o
  In file included from fastFM/ffm.c:528:
  In file included from /Users/louisabraham/.pyenv/versions/3.8.8/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:4:
  In file included from /Users/louisabraham/.pyenv/versions/3.8.8/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
  In file included from /Users/louisabraham/.pyenv/versions/3.8.8/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1944:
  /Users/louisabraham/.pyenv/versions/3.8.8/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with "          "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
  #warning "Using deprecated NumPy API, disable it with " \
   ^
  fastFM/ffm.c:23491:26: warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
    __pyx_type___pyx_array.tp_print = 0;
                           ^
  /Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here
      Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
      ^
  /Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                       ^
  fastFM/ffm.c:23496:32: warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
    __pyx_type___pyx_MemviewEnum.tp_print = 0;
                                 ^
  /Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here
      Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
      ^
  /Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                       ^
  fastFM/ffm.c:23508:31: warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
    __pyx_type___pyx_memoryview.tp_print = 0;
                                ^
  /Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here
      Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
      ^
  /Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                       ^
  fastFM/ffm.c:23518:36: warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
    __pyx_type___pyx_memoryviewslice.tp_print = 0;
                                     ^
  /Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here
      Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
      ^
  /Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                       ^
  fastFM/ffm.c:25496:21: error: no member named 'exc_type' in 'struct _ts'
      *type = tstate->exc_type;
              ~~~~~~  ^
  fastFM/ffm.c:25497:22: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
      *value = tstate->exc_value;
                       ^~~~~~~~~
                       curexc_value
  /Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8/cpython/pystate.h:80:15: note: 'curexc_value' declared here
      PyObject *curexc_value;
                ^
  fastFM/ffm.c:25498:19: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
      *tb = tstate->exc_traceback;
                    ^~~~~~~~~~~~~
                    curexc_traceback
  /Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8/cpython/pystate.h:81:15: note: 'curexc_traceback' declared here
      PyObject *curexc_traceback;
                ^
  fastFM/ffm.c:25505:24: error: no member named 'exc_type' in 'struct _ts'
      tmp_type = tstate->exc_type;
                 ~~~~~~  ^
  fastFM/ffm.c:25506:25: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
      tmp_value = tstate->exc_value;
                          ^~~~~~~~~
                          curexc_value
  /Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8/cpython/pystate.h:80:15: note: 'curexc_value' declared here
      PyObject *curexc_value;
                ^
  fastFM/ffm.c:25507:22: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
      tmp_tb = tstate->exc_traceback;
                       ^~~~~~~~~~~~~
                       curexc_traceback
  /Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8/cpython/pystate.h:81:15: note: 'curexc_traceback' declared here
      PyObject *curexc_traceback;
                ^
  fastFM/ffm.c:25508:13: error: no member named 'exc_type' in 'struct _ts'
      tstate->exc_type = type;
      ~~~~~~  ^
  fastFM/ffm.c:25509:13: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
      tstate->exc_value = value;
              ^~~~~~~~~
              curexc_value
  /Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8/cpython/pystate.h:80:15: note: 'curexc_value' declared here
      PyObject *curexc_value;
                ^
  fastFM/ffm.c:25510:13: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
      tstate->exc_traceback = tb;
              ^~~~~~~~~~~~~
              curexc_traceback
  /Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8/cpython/pystate.h:81:15: note: 'curexc_traceback' declared here
      PyObject *curexc_traceback;
                ^
  fastFM/ffm.c:25580:24: error: no member named 'exc_type' in 'struct _ts'
      tmp_type = tstate->exc_type;
                 ~~~~~~  ^
  fastFM/ffm.c:25581:25: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
      tmp_value = tstate->exc_value;
                          ^~~~~~~~~
                          curexc_value
  /Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8/cpython/pystate.h:80:15: note: 'curexc_value' declared here
      PyObject *curexc_value;
                ^
  fastFM/ffm.c:25582:22: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
      tmp_tb = tstate->exc_traceback;
                       ^~~~~~~~~~~~~
                       curexc_traceback
  /Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8/cpython/pystate.h:81:15: note: 'curexc_traceback' declared here
      PyObject *curexc_traceback;
                ^
  fastFM/ffm.c:25583:13: error: no member named 'exc_type' in 'struct _ts'
      tstate->exc_type = local_type;
      ~~~~~~  ^
  fastFM/ffm.c:25584:13: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
      tstate->exc_value = local_value;
              ^~~~~~~~~
              curexc_value
  /Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8/cpython/pystate.h:80:15: note: 'curexc_value' declared here
      PyObject *curexc_value;
                ^
  fastFM/ffm.c:25585:13: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
      tstate->exc_traceback = local_tb;
              ^~~~~~~~~~~~~
              curexc_traceback
  /Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8/cpython/pystate.h:81:15: note: 'curexc_traceback' declared here
      PyObject *curexc_traceback;
                ^
  fastFM/ffm.c:25822:24: error: no member named 'exc_type' in 'struct _ts'
      tmp_type = tstate->exc_type;
                 ~~~~~~  ^
  fastFM/ffm.c:25823:25: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
      tmp_value = tstate->exc_value;
                          ^~~~~~~~~
                          curexc_value
  /Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8/cpython/pystate.h:80:15: note: 'curexc_value' declared here
      PyObject *curexc_value;
                ^
  fastFM/ffm.c:25824:22: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
      tmp_tb = tstate->exc_traceback;
                       ^~~~~~~~~~~~~
                       curexc_traceback
  /Users/louisabraham/.pyenv/versions/3.8.8/include/python3.8/cpython/pystate.h:81:15: note: 'curexc_traceback' declared here
      PyObject *curexc_traceback;
                ^
  fastFM/ffm.c:25825:13: error: no member named 'exc_type' in 'struct _ts'
      tstate->exc_type = *type;
      ~~~~~~  ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  5 warnings and 20 errors generated.
  error: command 'clang' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for fastFM
louisabraham commented 3 years ago

The problem might be caused by Python 3.8 instead (https://github.com/ibayer/fastFM/issues/153).

Should I install it with a later or an older version? In any way I think you should make use of the python_requires option.

kevin1kevin1k commented 3 years ago

I had the same problem with Python 3.8, and solved by switching to Python 3.6

louisabraham commented 3 years ago

Ok, closing this as a duplicate of #153