Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: Not building on Windows or Bash for Windows #12

Closed
Skylion007 opened this issue Dec 16, 2016 · 3 comments
Closed

ERROR: Not building on Windows or Bash for Windows #12

Skylion007 opened this issue Dec 16, 2016 · 3 comments

Comments

@Skylion007
Copy link

So I am attempting to build this library, but I keep getting this error about not method called POSV found:

Downloading/unpacking implicit
  Downloading implicit-0.1.7.tar.gz (161kB): 161kB downloaded
  Running setup.py (path:/tmp/pip_build_skylion/implicit/setup.py) egg_info for package implicit

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
                        # Since we've already added in YtY, we subtract 1 from confidence
                        for j in range(factors):
                            temp = (confidence - 1) * Y[i, j]
                            axpy(&factors, &temp, &Y[i, 0], &one, A + j * factors, &one)

                    posv("U", &factors, &one, A, &factors, b, &factors, &err);
                        ------------------------------------------------------------

    implicit/_implicit.pyx:97:20: no suitable method found

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

I am really wondering what could be the issue. I can look into trying to get this to build later, but I have tried on both bash for Windows and Windows with the proper libraries installed. I am wondering if this is an issue with newer versions of scipy or cython. Here is my scipy config info.

blas_info:
    libraries = ['blas']
    library_dirs = ['/usr/lib']
    language = f77
lapack_info:
    libraries = ['lapack']
    library_dirs = ['/usr/lib']
    language = f77
atlas_threads_info:
  NOT AVAILABLE
blas_opt_info:
    libraries = ['blas']
    library_dirs = ['/usr/lib']
    language = f77
    define_macros = [('NO_ATLAS_INFO', 1)]
openblas_info:
  NOT AVAILABLE
atlas_blas_threads_info:
  NOT AVAILABLE
lapack_opt_info:
    libraries = ['lapack', 'blas']
    library_dirs = ['/usr/lib']
    language = f77
    define_macros = [('NO_ATLAS_INFO', 1)]
@benfred
Copy link
Owner

benfred commented Dec 16, 2016

The 'posv' function should be defined in that file - its just a cython fused type wrapper switching between the 32/64 bit BLAS calls to the dposv/sposv functions.

I don't have a windows machine available, and the only real testing on windows I have done is to setup up CI on appveyor: https://ci.appveyor.com/project/benfred/implicit =(

What version of cython and scipy are you using?

@Skylion007
Copy link
Author

Python 3.5.1
Scipy 18.1
Numpy 1.11.2
Windows 10
Cython 0.23.4

@benfred
Copy link
Owner

benfred commented Dec 16, 2016

The scipy/cython versions are all good - though looking at it and the appveyor build is only testing python 2.7 so its possible that there are some problems on windows with python 3 .

I'll have access to a windows computer over Christmas, I'll test this out then.

There are a couple things you could try in the meantime though if you want this working before then. This means cloning this repo and making some small changes.

Replace the call to posv with gesv (LU solver).

I'm wondering if its failing on this line because the posv function is being passed the "U" string parameter (which is missing from the gesv call) and for some reason its failing to find the correct overload w/ casting to 'char *'. Change here would be:

diff --git a/implicit/_implicit.pyx b/implicit/_implicit.pyx
index d884b1a..1cd6b66 100644
--- a/implicit/_implicit.pyx
+++ b/implicit/_implicit.pyx
@@ -94,7 +94,8 @@ def least_squares(Cui, floating [:, :] X, floating [:, :] Y, double regularizati
                         temp = (confidence - 1) * Y[i, j]
                         axpy(&factors, &temp, &Y[i, 0], &one, A + j * factors, &one)
 
-                posv("U", &factors, &one, A, &factors, b, &factors, &err);
+                #posv("U", &factors, &one, A, &factors, b, &factors, &err);
+                gesv(&factors, &one, A, &factors, pivot, b, &factors, &err)
 
                 # fall back to using a LU decomposition if this fails
                 if err:

If this works, I'll come up with a real fix.

Disable compiling the cython file

I made some changes to the build process recently (thought it was simpler), but now its detecting if you have cython installed and if so compiling the Cython file to C - which is the step thats failing. Since the C file is checked in, this step could probably be skipped, which requires hacking up the setup.py

diff --git a/setup.py b/setup.py
index 01bf468..e4a7efb 100644
--- a/setup.py
+++ b/setup.py
@@ -108,6 +108,6 @@ setup(
     packages=[SRC_ROOT],
     install_requires=['numpy', 'scipy>=0.16'],
     setup_requires=["Cython >= 0.19"],
-    ext_modules=define_extensions(use_cython),
+    ext_modules=define_extensions(False),
     test_suite="tests",
 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants