ibayer / fastFM

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

ubuntu 16.04: installation by pip - problem with cython #82

Closed mglowacki100 closed 7 years ago

mglowacki100 commented 7 years ago

I've tried to install fastFM by pip, but I've got error from Cython:

 sudo -H pip install fastFM
Collecting fastFM
  Using cached fastFM-0.2.6.tar.gz
Requirement already satisfied: numpy in /usr/local/lib/python2.7/dist-packages (from fastFM)
Requirement already satisfied: scikit-learn in /usr/local/lib/python2.7/dist-packages (from fastFM)
Requirement already satisfied: scipy in /usr/local/lib/python2.7/dist-packages (from fastFM)
Building wheels for collected packages: fastFM
  Running setup.py bdist_wheel for fastFM ... error
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-bekvHl/fastFM/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpzTr2wHpip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/fastFM
  copying fastFM/datasets.py -> build/lib.linux-x86_64-2.7/fastFM
  copying fastFM/utils.py -> build/lib.linux-x86_64-2.7/fastFM
  copying fastFM/sgd.py -> build/lib.linux-x86_64-2.7/fastFM
  copying fastFM/bpr.py -> build/lib.linux-x86_64-2.7/fastFM
  copying fastFM/__init__.py -> build/lib.linux-x86_64-2.7/fastFM
  copying fastFM/als.py -> build/lib.linux-x86_64-2.7/fastFM
  copying fastFM/base.py -> build/lib.linux-x86_64-2.7/fastFM
  copying fastFM/mcmc.py -> build/lib.linux-x86_64-2.7/fastFM
  copying fastFM/validation.py -> build/lib.linux-x86_64-2.7/fastFM
  copying fastFM/transform_.py -> build/lib.linux-x86_64-2.7/fastFM
  running build_ext
  cythoning fastFM/ffm.pyx to fastFM/ffm.c

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  # Author: Immanuel Bayer
  # License: BSD 3 clause

  cimport cffm
         ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:4:8: 'cffm.pxd' not found

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  # Author: Immanuel Bayer
  # License: BSD 3 clause

  cimport cffm
  from cffm cimport cs_di, ffm_param
  ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:5:0: 'cffm/cs_di.pxd' not found

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  # Author: Immanuel Bayer
  # License: BSD 3 clause

  cimport cffm
  from cffm cimport cs_di, ffm_param
  ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:5:0: 'cffm/ffm_param.pxd' not found

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      free(<void *> pt)

  # Create a CsMatrix object and return as a capsule
  def CsMatrix(X not None):
      cdef cffm.cs_di *p
          ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:23:9: 'cs_di' is not a type identifier

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  # Create a FFMParam object and return as a capsule
  def FFMParam(fm):
      map_flags = {'classification': 10,
                   'regression': 20,
                   'ranking': 30}
      cdef cffm.ffm_param *p
          ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:57:9: 'ffm_param' is not a type identifier

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  import numpy as np

  # Destructor for cleaning up CsMatrix objects
  cdef del_CsMatrix(object obj):
      pt = <cffm.cs_di *> PyCapsule_GetPointer(obj, "CsMatrix")
           ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:17:10: 'cs_di' is not a type identifier

  Error compiling Cython file:
  ------------------------------------------------------------
  ...

  # Create a CsMatrix object and return as a capsule
  def CsMatrix(X not None):
      cdef cffm.cs_di *p
      p = <cffm.cs_di *> malloc(sizeof(cffm.cs_di))
          ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:24:9: 'cs_di' is not a type identifier

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      # Put the scipy data into the CSparse struct. This is just copying some
      # pointers.
      p.nzmax = X.data.shape[0]
      p.m = X.shape[0]
      p.n = X.shape[1]
      p.p = &indptr[0]
           ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:38:10: Cannot convert 'int *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      # pointers.
      p.nzmax = X.data.shape[0]
      p.m = X.shape[0]
      p.n = X.shape[1]
      p.p = &indptr[0]
      p.i = &indices[0]
           ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:39:10: Cannot convert 'int *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      p.nzmax = X.data.shape[0]
      p.m = X.shape[0]
      p.n = X.shape[1]
      p.p = &indptr[0]
      p.i = &indices[0]
      p.x = &data[0]
           ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:40:10: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
                           <PyCapsule_Destructor>del_CsMatrix)

  # Destructor for cleaning up FFMParam objects
  cdef del_FFMParam(object obj):
      pt = <cffm.ffm_param *> PyCapsule_GetPointer(obj, "FFMParam")
           ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:48:10: 'ffm_param' is not a type identifier

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  def FFMParam(fm):
      map_flags = {'classification': 10,
                   'regression': 20,
                   'ranking': 30}
      cdef cffm.ffm_param *p
      p = <cffm.ffm_param *> malloc(sizeof(cffm.ffm_param))
          ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:58:9: 'ffm_param' is not a type identifier

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
                  np.ndarray[np.float64_t, ndim = 2] V, X):
      assert X.shape[1] == len(w)
      assert X.shape[1] == V.shape[1]
      X_ = CsMatrix(X)
      k = V.shape[0]
      pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
             ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:84:12: 'cs_di' is not a type identifier

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      X_ = CsMatrix(X)
      k = V.shape[0]
      pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
      cdef np.ndarray[np.float64_t, ndim=1, mode='c'] y =\
           np.zeros(X.shape[0], dtype=np.float64)
      cffm.ffm_predict(&w_0, &w[0], <double *> V.data, pt_X, &y[0], k)
                      ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:87:21: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      X_ = CsMatrix(X)
      k = V.shape[0]
      pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
      cdef np.ndarray[np.float64_t, ndim=1, mode='c'] y =\
           np.zeros(X.shape[0], dtype=np.float64)
      cffm.ffm_predict(&w_0, &w[0], <double *> V.data, pt_X, &y[0], k)
                            ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:87:27: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      X_ = CsMatrix(X)
      k = V.shape[0]
      pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
      cdef np.ndarray[np.float64_t, ndim=1, mode='c'] y =\
           np.zeros(X.shape[0], dtype=np.float64)
      cffm.ffm_predict(&w_0, &w[0], <double *> V.data, pt_X, &y[0], k)
                                   ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:87:34: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      X_ = CsMatrix(X)
      k = V.shape[0]
      pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
      cdef np.ndarray[np.float64_t, ndim=1, mode='c'] y =\
           np.zeros(X.shape[0], dtype=np.float64)
      cffm.ffm_predict(&w_0, &w[0], <double *> V.data, pt_X, &y[0], k)
                                                            ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:87:59: Cannot convert 'float64_t *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      assert X.shape[0] == len(y) # test shapes
      n_features = X.shape[1]
      X_ = CsMatrix(X)
      pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
      param = FFMParam(fm)
      pt_param = <cffm.ffm_param *> PyCapsule_GetPointer(param, "FFMParam")
                 ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:97:16: 'ffm_param' is not a type identifier

  Error compiling Cython file:
  ------------------------------------------------------------
  ...

  def ffm_als_fit(fm, X, double[:] y):
      assert X.shape[0] == len(y) # test shapes
      n_features = X.shape[1]
      X_ = CsMatrix(X)
      pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
             ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:95:12: 'cs_di' is not a type identifier

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      else:
          w_0 = 0
          w = np.zeros(n_features, dtype=np.float64)
          V = np.zeros((fm.rank, n_features), dtype=np.float64)

      cffm.ffm_als_fit(&w_0, <double *> w.data, <double *> V.data,
                      ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:112:21: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      else:
          w_0 = 0
          w = np.zeros(n_features, dtype=np.float64)
          V = np.zeros((fm.rank, n_features), dtype=np.float64)

      cffm.ffm_als_fit(&w_0, <double *> w.data, <double *> V.data,
                            ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:112:27: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      else:
          w_0 = 0
          w = np.zeros(n_features, dtype=np.float64)
          V = np.zeros((fm.rank, n_features), dtype=np.float64)

      cffm.ffm_als_fit(&w_0, <double *> w.data, <double *> V.data,
                                               ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:112:46: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
          w_0 = 0
          w = np.zeros(n_features, dtype=np.float64)
          V = np.zeros((fm.rank, n_features), dtype=np.float64)

      cffm.ffm_als_fit(&w_0, <double *> w.data, <double *> V.data,
                       pt_X, &y[0], pt_param)
                            ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:113:27: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      assert X.shape[1] == len(y) # test shapes
      n_features = X.shape[0]
      X_ = CsMatrix(X)
      pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
      param = FFMParam(fm)
      pt_param = <cffm.ffm_param *> PyCapsule_GetPointer(param, "FFMParam")
                 ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:128:16: 'ffm_param' is not a type identifier

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      sample access.
      """
      assert X.shape[1] == len(y) # test shapes
      n_features = X.shape[0]
      X_ = CsMatrix(X)
      pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
             ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:126:12: 'cs_di' is not a type identifier

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      cdef np.ndarray[np.float64_t, ndim=1, mode='c'] w =\
           np.zeros(n_features, dtype=np.float64)
      cdef np.ndarray[np.float64_t, ndim=2, mode='c'] V =\
           np.zeros((fm.rank, n_features), dtype=np.float64)

      cffm.ffm_sgd_fit(&w_0, <double *> w.data, <double *> V.data,
                      ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:137:21: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      cdef np.ndarray[np.float64_t, ndim=1, mode='c'] w =\
           np.zeros(n_features, dtype=np.float64)
      cdef np.ndarray[np.float64_t, ndim=2, mode='c'] V =\
           np.zeros((fm.rank, n_features), dtype=np.float64)

      cffm.ffm_sgd_fit(&w_0, <double *> w.data, <double *> V.data,
                            ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:137:27: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      cdef np.ndarray[np.float64_t, ndim=1, mode='c'] w =\
           np.zeros(n_features, dtype=np.float64)
      cdef np.ndarray[np.float64_t, ndim=2, mode='c'] V =\
           np.zeros((fm.rank, n_features), dtype=np.float64)

      cffm.ffm_sgd_fit(&w_0, <double *> w.data, <double *> V.data,
                                               ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:137:46: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
           np.zeros(n_features, dtype=np.float64)
      cdef np.ndarray[np.float64_t, ndim=2, mode='c'] V =\
           np.zeros((fm.rank, n_features), dtype=np.float64)

      cffm.ffm_sgd_fit(&w_0, <double *> w.data, <double *> V.data,
                       pt_X, &y[0], pt_param)
                            ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:138:27: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  def ffm_fit_sgd_bpr(fm, X, np.ndarray[np.float64_t, ndim=2, mode='c'] pairs):
      n_features = X.shape[0]
      X_ = CsMatrix(X)
      pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
      param = FFMParam(fm)
      pt_param = <cffm.ffm_param *> PyCapsule_GetPointer(param, "FFMParam")
                 ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:147:16: 'ffm_param' is not a type identifier

  Error compiling Cython file:
  ------------------------------------------------------------
  ...

  def ffm_fit_sgd_bpr(fm, X, np.ndarray[np.float64_t, ndim=2, mode='c'] pairs):
      n_features = X.shape[0]
      X_ = CsMatrix(X)
      pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
             ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:145:12: 'cs_di' is not a type identifier

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      cdef np.ndarray[np.float64_t, ndim=1, mode='c'] w =\
           np.zeros(n_features, dtype=np.float64)
      cdef np.ndarray[np.float64_t, ndim=2, mode='c'] V =\
           np.zeros((fm.rank, n_features), dtype=np.float64)

      cffm.ffm_sgd_bpr_fit(&w_0, <double *> w.data, <double *> V.data,
                          ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:156:25: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      cdef np.ndarray[np.float64_t, ndim=1, mode='c'] w =\
           np.zeros(n_features, dtype=np.float64)
      cdef np.ndarray[np.float64_t, ndim=2, mode='c'] V =\
           np.zeros((fm.rank, n_features), dtype=np.float64)

      cffm.ffm_sgd_bpr_fit(&w_0, <double *> w.data, <double *> V.data,
                                ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:156:31: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      cdef np.ndarray[np.float64_t, ndim=1, mode='c'] w =\
           np.zeros(n_features, dtype=np.float64)
      cdef np.ndarray[np.float64_t, ndim=2, mode='c'] V =\
           np.zeros((fm.rank, n_features), dtype=np.float64)

      cffm.ffm_sgd_bpr_fit(&w_0, <double *> w.data, <double *> V.data,
                                                   ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:156:50: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
           np.zeros(n_features, dtype=np.float64)
      cdef np.ndarray[np.float64_t, ndim=2, mode='c'] V =\
           np.zeros((fm.rank, n_features), dtype=np.float64)

      cffm.ffm_sgd_bpr_fit(&w_0, <double *> w.data, <double *> V.data,
                           pt_X, <double *> pairs.data, pairs.shape[0], pt_param)
                                ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:157:31: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      assert X_train.shape[1] == X_test.shape[1]
      n_features = X_train.shape[1]
      param = FFMParam(fm)
      pt_param = <cffm.ffm_param *> PyCapsule_GetPointer(param, "FFMParam")
      X_train_ = CsMatrix(X_train)
      pt_X_train = <cffm.cs_di *> PyCapsule_GetPointer(X_train_, "CsMatrix")
                   ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:168:18: 'cs_di' is not a type identifier

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      param = FFMParam(fm)
      pt_param = <cffm.ffm_param *> PyCapsule_GetPointer(param, "FFMParam")
      X_train_ = CsMatrix(X_train)
      pt_X_train = <cffm.cs_di *> PyCapsule_GetPointer(X_train_, "CsMatrix")
      X_test_ = CsMatrix(X_test)
      pt_X_test = <cffm.cs_di *> PyCapsule_GetPointer(X_test_, "CsMatrix")
                  ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:170:17: 'cs_di' is not a type identifier

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  def ffm_mcmc_fit_predict(fm, X_train, X_test, double[:] y):
      assert X_train.shape[0] == len(y)
      assert X_train.shape[1] == X_test.shape[1]
      n_features = X_train.shape[1]
      param = FFMParam(fm)
      pt_param = <cffm.ffm_param *> PyCapsule_GetPointer(param, "FFMParam")
                 ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:166:16: 'ffm_param' is not a type identifier

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      if fm.warm_start:
          hyper_param = fm.hyper_param_
      else:
          hyper_param = np.zeros(n_hyper_param, dtype=np.float64)
      pt_param.n_hyper_param = n_hyper_param
      pt_param.hyper_param = <double *> hyper_param.data
                            ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:204:27: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      else:
          hyper_param = np.zeros(n_hyper_param, dtype=np.float64)
      pt_param.n_hyper_param = n_hyper_param
      pt_param.hyper_param = <double *> hyper_param.data

      cffm.ffm_mcmc_fit_predict(&w_0, <double *> w.data, <double *> V.data,
                               ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:206:30: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      else:
          hyper_param = np.zeros(n_hyper_param, dtype=np.float64)
      pt_param.n_hyper_param = n_hyper_param
      pt_param.hyper_param = <double *> hyper_param.data

      cffm.ffm_mcmc_fit_predict(&w_0, <double *> w.data, <double *> V.data,
                                     ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:206:36: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      else:
          hyper_param = np.zeros(n_hyper_param, dtype=np.float64)
      pt_param.n_hyper_param = n_hyper_param
      pt_param.hyper_param = <double *> hyper_param.data

      cffm.ffm_mcmc_fit_predict(&w_0, <double *> w.data, <double *> V.data,
                                                        ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:206:55: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      pt_param.n_hyper_param = n_hyper_param
      pt_param.hyper_param = <double *> hyper_param.data

      cffm.ffm_mcmc_fit_predict(&w_0, <double *> w.data, <double *> V.data,
                                pt_X_train, pt_X_test,
                                &y[0], <double *> y_pred.data,
                               ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:208:30: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      pt_param.n_hyper_param = n_hyper_param
      pt_param.hyper_param = <double *> hyper_param.data

      cffm.ffm_mcmc_fit_predict(&w_0, <double *> w.data, <double *> V.data,
                                pt_X_train, pt_X_test,
                                &y[0], <double *> y_pred.data,
                                      ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:208:37: Cannot convert 'double *' to Python object

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      return (w_0, w, V), y_pred

  def cs_norm(X):
      X = CsMatrix(X)
      pt = <cffm.cs_di *> PyCapsule_GetPointer(X, "CsMatrix")
           ^
  ------------------------------------------------------------

  fastFM/ffm.pyx:216:10: 'cs_di' is not a type identifier
  building 'ffm' extension
  creating build/temp.linux-x86_64-2.7
  creating build/temp.linux-x86_64-2.7/fastFM
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -IfastFM/ -IfastFM-core/include/ -IfastFM-core/externals/CXSparse/Include/ -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c fastFM/ffm.c -o build/temp.linux-x86_64-2.7/fastFM/ffm.o
  fastFM/ffm.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
   #error Do not use this file, it is the result of a failed Cython compilation.
    ^
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for fastFM
  Running setup.py clean for fastFM
Failed to build fastFM
Installing collected packages: fastFM
  Running setup.py install for fastFM ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-bekvHl/fastFM/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-_kRa9a-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/fastFM
    copying fastFM/datasets.py -> build/lib.linux-x86_64-2.7/fastFM
    copying fastFM/utils.py -> build/lib.linux-x86_64-2.7/fastFM
    copying fastFM/sgd.py -> build/lib.linux-x86_64-2.7/fastFM
    copying fastFM/bpr.py -> build/lib.linux-x86_64-2.7/fastFM
    copying fastFM/__init__.py -> build/lib.linux-x86_64-2.7/fastFM
    copying fastFM/als.py -> build/lib.linux-x86_64-2.7/fastFM
    copying fastFM/base.py -> build/lib.linux-x86_64-2.7/fastFM
    copying fastFM/mcmc.py -> build/lib.linux-x86_64-2.7/fastFM
    copying fastFM/validation.py -> build/lib.linux-x86_64-2.7/fastFM
    copying fastFM/transform_.py -> build/lib.linux-x86_64-2.7/fastFM
    running build_ext
    cythoning fastFM/ffm.pyx to fastFM/ffm.c

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
    # Author: Immanuel Bayer
    # License: BSD 3 clause

    cimport cffm
           ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:4:8: 'cffm.pxd' not found

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
    # Author: Immanuel Bayer
    # License: BSD 3 clause

    cimport cffm
    from cffm cimport cs_di, ffm_param
    ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:5:0: 'cffm/cs_di.pxd' not found

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
    # Author: Immanuel Bayer
    # License: BSD 3 clause

    cimport cffm
    from cffm cimport cs_di, ffm_param
    ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:5:0: 'cffm/ffm_param.pxd' not found

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        free(<void *> pt)

    # Create a CsMatrix object and return as a capsule
    def CsMatrix(X not None):
        cdef cffm.cs_di *p
            ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:23:9: 'cs_di' is not a type identifier

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
    # Create a FFMParam object and return as a capsule
    def FFMParam(fm):
        map_flags = {'classification': 10,
                     'regression': 20,
                     'ranking': 30}
        cdef cffm.ffm_param *p
            ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:57:9: 'ffm_param' is not a type identifier

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
    import numpy as np

    # Destructor for cleaning up CsMatrix objects
    cdef del_CsMatrix(object obj):
        pt = <cffm.cs_di *> PyCapsule_GetPointer(obj, "CsMatrix")
             ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:17:10: 'cs_di' is not a type identifier

    Error compiling Cython file:
    ------------------------------------------------------------
    ...

    # Create a CsMatrix object and return as a capsule
    def CsMatrix(X not None):
        cdef cffm.cs_di *p
        p = <cffm.cs_di *> malloc(sizeof(cffm.cs_di))
            ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:24:9: 'cs_di' is not a type identifier

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        # Put the scipy data into the CSparse struct. This is just copying some
        # pointers.
        p.nzmax = X.data.shape[0]
        p.m = X.shape[0]
        p.n = X.shape[1]
        p.p = &indptr[0]
             ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:38:10: Cannot convert 'int *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        # pointers.
        p.nzmax = X.data.shape[0]
        p.m = X.shape[0]
        p.n = X.shape[1]
        p.p = &indptr[0]
        p.i = &indices[0]
             ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:39:10: Cannot convert 'int *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        p.nzmax = X.data.shape[0]
        p.m = X.shape[0]
        p.n = X.shape[1]
        p.p = &indptr[0]
        p.i = &indices[0]
        p.x = &data[0]
             ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:40:10: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
                             <PyCapsule_Destructor>del_CsMatrix)

    # Destructor for cleaning up FFMParam objects
    cdef del_FFMParam(object obj):
        pt = <cffm.ffm_param *> PyCapsule_GetPointer(obj, "FFMParam")
             ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:48:10: 'ffm_param' is not a type identifier

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
    def FFMParam(fm):
        map_flags = {'classification': 10,
                     'regression': 20,
                     'ranking': 30}
        cdef cffm.ffm_param *p
        p = <cffm.ffm_param *> malloc(sizeof(cffm.ffm_param))
            ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:58:9: 'ffm_param' is not a type identifier

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
                    np.ndarray[np.float64_t, ndim = 2] V, X):
        assert X.shape[1] == len(w)
        assert X.shape[1] == V.shape[1]
        X_ = CsMatrix(X)
        k = V.shape[0]
        pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
               ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:84:12: 'cs_di' is not a type identifier

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        X_ = CsMatrix(X)
        k = V.shape[0]
        pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
        cdef np.ndarray[np.float64_t, ndim=1, mode='c'] y =\
             np.zeros(X.shape[0], dtype=np.float64)
        cffm.ffm_predict(&w_0, &w[0], <double *> V.data, pt_X, &y[0], k)
                        ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:87:21: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        X_ = CsMatrix(X)
        k = V.shape[0]
        pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
        cdef np.ndarray[np.float64_t, ndim=1, mode='c'] y =\
             np.zeros(X.shape[0], dtype=np.float64)
        cffm.ffm_predict(&w_0, &w[0], <double *> V.data, pt_X, &y[0], k)
                              ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:87:27: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        X_ = CsMatrix(X)
        k = V.shape[0]
        pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
        cdef np.ndarray[np.float64_t, ndim=1, mode='c'] y =\
             np.zeros(X.shape[0], dtype=np.float64)
        cffm.ffm_predict(&w_0, &w[0], <double *> V.data, pt_X, &y[0], k)
                                     ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:87:34: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        X_ = CsMatrix(X)
        k = V.shape[0]
        pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
        cdef np.ndarray[np.float64_t, ndim=1, mode='c'] y =\
             np.zeros(X.shape[0], dtype=np.float64)
        cffm.ffm_predict(&w_0, &w[0], <double *> V.data, pt_X, &y[0], k)
                                                              ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:87:59: Cannot convert 'float64_t *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        assert X.shape[0] == len(y) # test shapes
        n_features = X.shape[1]
        X_ = CsMatrix(X)
        pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
        param = FFMParam(fm)
        pt_param = <cffm.ffm_param *> PyCapsule_GetPointer(param, "FFMParam")
                   ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:97:16: 'ffm_param' is not a type identifier

    Error compiling Cython file:
    ------------------------------------------------------------
    ...

    def ffm_als_fit(fm, X, double[:] y):
        assert X.shape[0] == len(y) # test shapes
        n_features = X.shape[1]
        X_ = CsMatrix(X)
        pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
               ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:95:12: 'cs_di' is not a type identifier

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        else:
            w_0 = 0
            w = np.zeros(n_features, dtype=np.float64)
            V = np.zeros((fm.rank, n_features), dtype=np.float64)

        cffm.ffm_als_fit(&w_0, <double *> w.data, <double *> V.data,
                        ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:112:21: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        else:
            w_0 = 0
            w = np.zeros(n_features, dtype=np.float64)
            V = np.zeros((fm.rank, n_features), dtype=np.float64)

        cffm.ffm_als_fit(&w_0, <double *> w.data, <double *> V.data,
                              ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:112:27: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        else:
            w_0 = 0
            w = np.zeros(n_features, dtype=np.float64)
            V = np.zeros((fm.rank, n_features), dtype=np.float64)

        cffm.ffm_als_fit(&w_0, <double *> w.data, <double *> V.data,
                                                 ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:112:46: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
            w_0 = 0
            w = np.zeros(n_features, dtype=np.float64)
            V = np.zeros((fm.rank, n_features), dtype=np.float64)

        cffm.ffm_als_fit(&w_0, <double *> w.data, <double *> V.data,
                         pt_X, &y[0], pt_param)
                              ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:113:27: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        sample access.
        """
        assert X.shape[1] == len(y) # test shapes
        n_features = X.shape[0]
        X_ = CsMatrix(X)
        pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
               ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:126:12: 'cs_di' is not a type identifier

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        assert X.shape[1] == len(y) # test shapes
        n_features = X.shape[0]
        X_ = CsMatrix(X)
        pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
        param = FFMParam(fm)
        pt_param = <cffm.ffm_param *> PyCapsule_GetPointer(param, "FFMParam")
                   ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:128:16: 'ffm_param' is not a type identifier

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        cdef np.ndarray[np.float64_t, ndim=1, mode='c'] w =\
             np.zeros(n_features, dtype=np.float64)
        cdef np.ndarray[np.float64_t, ndim=2, mode='c'] V =\
             np.zeros((fm.rank, n_features), dtype=np.float64)

        cffm.ffm_sgd_fit(&w_0, <double *> w.data, <double *> V.data,
                        ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:137:21: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        cdef np.ndarray[np.float64_t, ndim=1, mode='c'] w =\
             np.zeros(n_features, dtype=np.float64)
        cdef np.ndarray[np.float64_t, ndim=2, mode='c'] V =\
             np.zeros((fm.rank, n_features), dtype=np.float64)

        cffm.ffm_sgd_fit(&w_0, <double *> w.data, <double *> V.data,
                              ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:137:27: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        cdef np.ndarray[np.float64_t, ndim=1, mode='c'] w =\
             np.zeros(n_features, dtype=np.float64)
        cdef np.ndarray[np.float64_t, ndim=2, mode='c'] V =\
             np.zeros((fm.rank, n_features), dtype=np.float64)

        cffm.ffm_sgd_fit(&w_0, <double *> w.data, <double *> V.data,
                                                 ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:137:46: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
             np.zeros(n_features, dtype=np.float64)
        cdef np.ndarray[np.float64_t, ndim=2, mode='c'] V =\
             np.zeros((fm.rank, n_features), dtype=np.float64)

        cffm.ffm_sgd_fit(&w_0, <double *> w.data, <double *> V.data,
                         pt_X, &y[0], pt_param)
                              ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:138:27: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
    def ffm_fit_sgd_bpr(fm, X, np.ndarray[np.float64_t, ndim=2, mode='c'] pairs):
        n_features = X.shape[0]
        X_ = CsMatrix(X)
        pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
        param = FFMParam(fm)
        pt_param = <cffm.ffm_param *> PyCapsule_GetPointer(param, "FFMParam")
                   ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:147:16: 'ffm_param' is not a type identifier

    Error compiling Cython file:
    ------------------------------------------------------------
    ...

    def ffm_fit_sgd_bpr(fm, X, np.ndarray[np.float64_t, ndim=2, mode='c'] pairs):
        n_features = X.shape[0]
        X_ = CsMatrix(X)
        pt_X = <cffm.cs_di *> PyCapsule_GetPointer(X_, "CsMatrix")
               ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:145:12: 'cs_di' is not a type identifier

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        cdef np.ndarray[np.float64_t, ndim=1, mode='c'] w =\
             np.zeros(n_features, dtype=np.float64)
        cdef np.ndarray[np.float64_t, ndim=2, mode='c'] V =\
             np.zeros((fm.rank, n_features), dtype=np.float64)

        cffm.ffm_sgd_bpr_fit(&w_0, <double *> w.data, <double *> V.data,
                            ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:156:25: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        cdef np.ndarray[np.float64_t, ndim=1, mode='c'] w =\
             np.zeros(n_features, dtype=np.float64)
        cdef np.ndarray[np.float64_t, ndim=2, mode='c'] V =\
             np.zeros((fm.rank, n_features), dtype=np.float64)

        cffm.ffm_sgd_bpr_fit(&w_0, <double *> w.data, <double *> V.data,
                                  ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:156:31: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        cdef np.ndarray[np.float64_t, ndim=1, mode='c'] w =\
             np.zeros(n_features, dtype=np.float64)
        cdef np.ndarray[np.float64_t, ndim=2, mode='c'] V =\
             np.zeros((fm.rank, n_features), dtype=np.float64)

        cffm.ffm_sgd_bpr_fit(&w_0, <double *> w.data, <double *> V.data,
                                                     ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:156:50: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
             np.zeros(n_features, dtype=np.float64)
        cdef np.ndarray[np.float64_t, ndim=2, mode='c'] V =\
             np.zeros((fm.rank, n_features), dtype=np.float64)

        cffm.ffm_sgd_bpr_fit(&w_0, <double *> w.data, <double *> V.data,
                             pt_X, <double *> pairs.data, pairs.shape[0], pt_param)
                                  ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:157:31: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        assert X_train.shape[1] == X_test.shape[1]
        n_features = X_train.shape[1]
        param = FFMParam(fm)
        pt_param = <cffm.ffm_param *> PyCapsule_GetPointer(param, "FFMParam")
        X_train_ = CsMatrix(X_train)
        pt_X_train = <cffm.cs_di *> PyCapsule_GetPointer(X_train_, "CsMatrix")
                     ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:168:18: 'cs_di' is not a type identifier

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        param = FFMParam(fm)
        pt_param = <cffm.ffm_param *> PyCapsule_GetPointer(param, "FFMParam")
        X_train_ = CsMatrix(X_train)
        pt_X_train = <cffm.cs_di *> PyCapsule_GetPointer(X_train_, "CsMatrix")
        X_test_ = CsMatrix(X_test)
        pt_X_test = <cffm.cs_di *> PyCapsule_GetPointer(X_test_, "CsMatrix")
                    ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:170:17: 'cs_di' is not a type identifier

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
    def ffm_mcmc_fit_predict(fm, X_train, X_test, double[:] y):
        assert X_train.shape[0] == len(y)
        assert X_train.shape[1] == X_test.shape[1]
        n_features = X_train.shape[1]
        param = FFMParam(fm)
        pt_param = <cffm.ffm_param *> PyCapsule_GetPointer(param, "FFMParam")
                   ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:166:16: 'ffm_param' is not a type identifier

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        if fm.warm_start:
            hyper_param = fm.hyper_param_
        else:
            hyper_param = np.zeros(n_hyper_param, dtype=np.float64)
        pt_param.n_hyper_param = n_hyper_param
        pt_param.hyper_param = <double *> hyper_param.data
                              ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:204:27: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        else:
            hyper_param = np.zeros(n_hyper_param, dtype=np.float64)
        pt_param.n_hyper_param = n_hyper_param
        pt_param.hyper_param = <double *> hyper_param.data

        cffm.ffm_mcmc_fit_predict(&w_0, <double *> w.data, <double *> V.data,
                                 ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:206:30: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        else:
            hyper_param = np.zeros(n_hyper_param, dtype=np.float64)
        pt_param.n_hyper_param = n_hyper_param
        pt_param.hyper_param = <double *> hyper_param.data

        cffm.ffm_mcmc_fit_predict(&w_0, <double *> w.data, <double *> V.data,
                                       ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:206:36: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        else:
            hyper_param = np.zeros(n_hyper_param, dtype=np.float64)
        pt_param.n_hyper_param = n_hyper_param
        pt_param.hyper_param = <double *> hyper_param.data

        cffm.ffm_mcmc_fit_predict(&w_0, <double *> w.data, <double *> V.data,
                                                          ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:206:55: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        pt_param.n_hyper_param = n_hyper_param
        pt_param.hyper_param = <double *> hyper_param.data

        cffm.ffm_mcmc_fit_predict(&w_0, <double *> w.data, <double *> V.data,
                                  pt_X_train, pt_X_test,
                                  &y[0], <double *> y_pred.data,
                                 ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:208:30: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        pt_param.n_hyper_param = n_hyper_param
        pt_param.hyper_param = <double *> hyper_param.data

        cffm.ffm_mcmc_fit_predict(&w_0, <double *> w.data, <double *> V.data,
                                  pt_X_train, pt_X_test,
                                  &y[0], <double *> y_pred.data,
                                        ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:208:37: Cannot convert 'double *' to Python object

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
        return (w_0, w, V), y_pred

    def cs_norm(X):
        X = CsMatrix(X)
        pt = <cffm.cs_di *> PyCapsule_GetPointer(X, "CsMatrix")
             ^
    ------------------------------------------------------------

    fastFM/ffm.pyx:216:10: 'cs_di' is not a type identifier
    building 'ffm' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/fastFM
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -IfastFM/ -IfastFM-core/include/ -IfastFM-core/externals/CXSparse/Include/ -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c fastFM/ffm.c -o build/temp.linux-x86_64-2.7/fastFM/ffm.o
    fastFM/ffm.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
     #error Do not use this file, it is the result of a failed Cython compilation.
      ^
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-bekvHl/fastFM/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-_kRa9a-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-bekvHl/fastFM/
ibayer commented 7 years ago

@mglowacki100 Can you provide more information about the OS version etc. ? It's often helpful to do a source install (see README) and post the output from each step here.

mglowacki100 commented 7 years ago

I have: Ubuntu 16.04.1 LTS, Release: 16.04

Now, I've installed it from source and it works fine.

Only in "make" step there was a warning:

from fastFM/ffm.c:437:
/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it by " \

Before installing it fromy source I've tried to install it by pip and the same error occurs. I think, this issue could be closed. Btw. in Usage section of documentation, it would be good to add definitions of X_train, y_train, X_test to make example fully working (like in tutorial).

ibayer commented 7 years ago

The warning is "normal" I thinks that's something that needs to be changed in numpy.

Before installing it fromy source I've tried to install it by pip and the same error occurs.

You mean it's possible that the pip install worked but produced a warning (not an error)?

Btw. in Usage section of documentation, it would be good to add definitions of X_train, y_train, X_test to make example fully working (like in tutorial).

Thanks for the comment. I have to think about this. Including the data definitions adds little information but distracts from the code library code (data definition need probably as much lines as calling the model).

I'm closing this now, please reopen if you think that the binary on pip has an issue.

mglowacki100 commented 7 years ago

To be more precise: binary install didn't work out (this long log), but source install works correctly.
I suppose that problem could be that I have Ubunt 16.04, but fastFM is tested on 14.04.

henry0312 commented 7 years ago

The same problem occurred when I run pip install -U fastFM. os: ubuntu 16.04.1 gcc: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) python: 3.5.2 (installed from pyenv)

ibayer commented 7 years ago

Travis builds and tests the binaries on 14.04 and I upload them to pypi. Maybe the binaries are version specific for some reason. If that's the case we should check if we can change this or if we can upload binaries for both 14.04 and 16.04.

henry0312 commented 7 years ago

There were no problem with pip install fastFM==0.2.5 on Ubuntu 16.04. I guess something is wrong from v0.2.5.

edmondja commented 7 years ago

I had the same problem and henry's solution worked for me on ubuntu 16.04.

henry0312 commented 7 years ago

@ibayer Installing from source works fine. I think it's worth uploading binaries for Ubuntu 16.04.

ibayer commented 7 years ago

I made a new release that should fix this issue. Can you confirm that pip install works on ubuntu 16.04 now?

henry0312 commented 7 years ago

@ibayer Installing v0.2.9 works fine! Thank you.

❯ pip install --no-cache fastFM
Collecting fastFM
  Downloading fastFM-0.2.9.tar.gz (259kB)
    100% |████████████████████████████████| 266kB 3.2MB/s
Requirement already satisfied: numpy in ./.pyenv/versions/3.5.2/lib/python3.5/site-packages (from fastFM)
Requirement already satisfied: scikit-learn in ./.pyenv/versions/3.5.2/lib/python3.5/site-packages (from fastFM)
Requirement already satisfied: scipy in ./.pyenv/versions/3.5.2/lib/python3.5/site-packages (from fastFM)
Installing collected packages: fastFM
  Running setup.py install for fastFM ... done
Successfully installed fastFM-0.2.9
ibayer commented 7 years ago

@henry0312 Thanks for the feedback