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/
bug help wanted