Blosc / pycblosc

A low level Python interface to the C-Blosc library
Other
4 stars 1 forks source link

Conan installer does not work on RTFD site #2

Open FrancescAlted opened 6 years ago

FrancescAlted commented 6 years ago

My attempts to provide an installer for the shared Blosc library ended with the RTFD not being able to recognize the shared libraries. Here are the RTFD logs:

/home/docs/checkouts/readthedocs.org/user_builds/pycblosc/checkouts/latest/docs/api.rst:4: WARNING: autodoc: failed to import module 'pycblosc'; the following exception was raised:
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pycblosc/envs/latest/lib/python3.5/site-packages/sphinx/ext/autodoc.py", line 658, in import_object
    __import__(self.modname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pycblosc/checkouts/latest/pycblosc/pycblosc.py", line 64, in <module>
    C = ffi.dlopen("blosc")
  File "/home/docs/checkouts/readthedocs.org/user_builds/pycblosc/envs/latest/lib/python3.5/site-packages/cffi/api.py", line 141, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pycblosc/envs/latest/lib/python3.5/site-packages/cffi/api.py", line 802, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pycblosc/envs/latest/lib/python3.5/site-packages/cffi/api.py", line 797, in _load_backend_lib
    raise OSError(msg)
OSError: ctypes.util.find_library() did not manage to locate a library called 'blosc'

Apparently, the shared library is correctly downloaded from conan-center and copied to package destination:

creating /home/docs/checkouts/readthedocs.org/user_builds/pycblosc/envs/latest/lib/python3.5/site-packages/pycblosc
copying build/lib/pycblosc/pycblosc.py -> /home/docs/checkouts/readthedocs.org/user_builds/pycblosc/envs/latest/lib/python3.5/site-packages/pycblosc
copying build/lib/pycblosc/libblosc.so.1 -> /home/docs/checkouts/readthedocs.org/user_builds/pycblosc/envs/latest/lib/python3.5/site-packages/pycblosc
copying build/lib/pycblosc/libblosc.so.1.14.0 -> /home/docs/checkouts/readthedocs.org/user_builds/pycblosc/envs/latest/lib/python3.5/site-packages/pycblosc
copying build/lib/pycblosc/__init__.py -> /home/docs/checkouts/readthedocs.org/user_builds/pycblosc/envs/latest/lib/python3.5/site-packages/pycblosc
copying build/lib/pycblosc/libblosc.so -> /home/docs/checkouts/readthedocs.org/user_builds/pycblosc/envs/latest/lib/python3.5/site-packages/pycblosc
byte-compiling /home/docs/checkouts/readthedocs.org/user_builds/pycblosc/envs/latest/lib/python3.5/site-packages/pycblosc/pycblosc.py to pycblosc.cpython-35.pyc
byte-compiling /home/docs/checkouts/readthedocs.org/user_builds/pycblosc/envs/latest/lib/python3.5/site-packages/pycblosc/__init__.py to __init__.cpython-35.pyc

The current configuration works flwalessly on my Mac box, so my current guess is that there should be a problem of the C-Blosc shared library for Linux not being compatible with all the Linux out there. Perhaps @lasote could shed some light here?

lasote commented 6 years ago

Hi, @FrancescAlted

First of all, a tip to simplify your setup. We introduced some versions ago the "deploy" method, to avoid this extra step of creating a conanfile.txt to import things.

The idea is, edit your c-blosc conan recipe and add a deploy() method with all the things you need to

    def deploy(self):
        self.copy("*.dll")
        self.copy("*.so*")
        self.copy("*.dylib*")

Then in the setup.py file you only need to call conan install c-blosc/v{}@francescalted/stable and it will copy automatically those files to your current directory.

About the Linux issue, I would need to try it, but I don't think this is a compatibility problem but a path problem. But I don't see it at first sight. It looks very good by the way! It's pretty cool. I'm sure we can make it work.

FrancescAlted commented 6 years ago

Yep, looks like this was a path problem. 4c1e20c seems to fix it. I still need to setup Travis CI and AppVeyor though.

FrancescAlted commented 6 years ago

BTW, thanks for the tip about c-blosc conan recipe. Will give it a try.