Skip to content

Commit 515ab50

Browse files
author
Immanuel Bayer
committed
update fastFM-core to include static linking of openblas
1 parent 528923e commit 515ab50

File tree

5 files changed

+4
-18
lines changed

5 files changed

+4
-18
lines changed

fastFM/cffm.pxd

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ cdef extern from "../fastFM-core/externals/CXSparse/Include/cs.h":
1111
double *x # numerical values, size nzmax */
1212
int nz # # of entries in triplet matrix, -1 for compressed-col */
1313

14-
double cs_di_norm(const cs_di *X) # max colsum
15-
1614
cdef extern from "../fastFM-core/include/ffm.h":
1715

1816
ctypedef struct ffm_param:

fastFM/ffm.pyx

+1-7
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,4 @@ def ffm_mcmc_fit_predict(fm, X_train, X_test, double[:] y):
208208
&y[0], <double *> y_pred.data,
209209
pt_param)
210210
fm.hyper_param_ = hyper_param
211-
return (w_0, w, V), y_pred
212-
213-
214-
def cs_norm(X):
215-
X = CsMatrix(X)
216-
pt = <cffm.cs_di *> PyCapsule_GetPointer(X, "CsMatrix")
217-
return cffm.cs_di_norm(pt)
211+
return (w_0, w, V), y_pred

fastFM/tests/test_ffm.py

-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ def get_test_problem():
2121
return w0, w, V, y, X
2222

2323

24-
def test_cxsparse_integration():
25-
X = sp.csc_matrix(np.arange(60, dtype=np.float64).reshape(6, 10))
26-
assert_almost_equal(ffm.cs_norm(X), X.sum(axis=0).max())
27-
28-
2924
def test_ffm_predict():
3025
w0, w, V, y, X = get_test_problem()
3126
y_pred = ffm.ffm_predict(w0, w, V, X)

setup.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55

66
ext_modules = [
77
Extension('ffm', ['fastFM/ffm.pyx'],
8-
libraries=['m', 'fastfm', 'cxsparse', 'blas'],
9-
library_dirs=['fastFM/', 'fastFM-core/bin/',
10-
'fastFM-core/externals/CXSparse/Lib/'],
8+
libraries=['m', 'fastfm'],
9+
library_dirs=['fastFM/', 'fastFM-core/bin/'],
1110
include_dirs=['fastFM/', 'fastFM-core/include/',
1211
'fastFM-core/externals/CXSparse/Include/',
1312
numpy.get_include()])]

0 commit comments

Comments
 (0)