limix / bgen-reader-py

A BGEN file format reader.
MIT License
10 stars 3 forks source link

Can't figure out dev build on Derbin #28

Closed CarlKCarlK closed 4 years ago

CarlKCarlK commented 4 years ago

[Sorry for the flood of queries. - Carl]

On Durbin, python setup.py build_ext --inplace seems to work. But, when I set by Python path and try to run a test, I get ImportError: libbgen.so.3: cannot open shared object file: No such file or directory

Below are some details. Thanks! Carl

(base) carlk@kadie2:~$ ls /usr/local/include
athr_export.h  athr.h  bgen  bgen.h  zbuff.h  zdict.h  zstd_errors.h  zstd.h
(base) carlk@kadie2:~$ cd /mnt/d/OneDrive/programs/bgen-reader-py2
(base) carlk@kadie2:/mnt/d/OneDrive/programs/bgen-reader-py2$ export PYTHONPATH=/mnt/d/OneDrive/programs/bgen-reader-py2
(base) carlk@kadie2:/mnt/d/OneDrive/programs/bgen-reader-py2$ python setup.py build_ext --inplace
running build_ext
generating cffi module 'build/temp.linux-x86_64-3.7/bgen_reader._ffi.c'
building 'bgen_reader._ffi' extension
gcc -pthread -B /home/carlk/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/carlk/anaconda3/include -I/usr/include -I/usr/local/include -I/home/carlk/anaconda3/include/python3.7m -c build/temp.linux-x86_64-3.7/bgen_reader._ffi.c -o build/temp.linux-x86_64-3.7/build/temp.linux-x86_64-3.7/bgen_reader._ffi.o
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/bgen_reader
gcc -pthread -shared -B /home/carlk/anaconda3/compiler_compat -L/home/carlk/anaconda3/lib -Wl,-rpath=/home/carlk/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/build/temp.linux-x86_64-3.7/bgen_reader._ffi.o -L/home/carlk/anaconda3/lib -L/usr/lib -L/usr/local/lib -lbgen -lz -lzstd -lathr -o build/lib.linux-x86_64-3.7/bgen_reader/_ffi.abi3.so
copying build/lib.linux-x86_64-3.7/bgen_reader/_ffi.abi3.so -> bgen_reader
(base) carlk@kadie2:/mnt/d/OneDrive/programs/bgen-reader-py2$
(base) carlk@kadie2:/mnt/d/OneDrive/programs/bgen-reader-py2$
(base) carlk@kadie2:/mnt/d/OneDrive/programs/bgen-reader-py2$ ls
bgen_reader  build_ext.py  docs        LICENSE.md   __pycache__  readthedocs.yml   setup.cfg  version.py
build        ci            libpath.py  MANIFEST.in  README.md    requirements.txt  setup.py
(base) carlk@kadie2:/mnt/d/OneDrive/programs/bgen-reader-py2$ cd bgen_reader/
(base) carlk@kadie2:/mnt/d/OneDrive/programs/bgen-reader-py2/bgen_reader$ ls
_bgen.py     _dosage.py    _ffi.abi3.so  _helper.py   _metadata.py   _samples.py  _testit.py
conftest.py  _download.py  _file.py      __init__.py  _partition.py  _string.py
_dask.py     _example      _genotype.py  interface.h  _reader.py     test

(base) carlk@kadie2:/mnt/d/OneDrive/programs/bgen-reader-py2/bgen_reader$ cd test
(base) carlk@kadie2:/mnt/d/OneDrive/programs/bgen-reader-py2/bgen_reader/test$ ls
__init__.py  test_bgen_reader.py  test_dosage.py  test_interface.py  test_large_file.py
(base) carlk@kadie2:/mnt/d/OneDrive/programs/bgen-reader-py2/bgen_reader/test$ python test_bgen_reader.py
Traceback (most recent call last):
  File "test_bgen_reader.py", line 8, in <module>
    from bgen_reader import create_metafile, example_files, read_bgen
  File "/mnt/d/OneDrive/programs/bgen-reader-py2/bgen_reader/__init__.py", line 26, in <module>
    from ._metadata import create_metafile
  File "/mnt/d/OneDrive/programs/bgen-reader-py2/bgen_reader/_metadata.py", line 4, in <module>
    from ._bgen import bgen_file
  File "/mnt/d/OneDrive/programs/bgen-reader-py2/bgen_reader/_bgen.py", line 3, in <module>
    from ._ffi import ffi, lib
ImportError: libbgen.so.3: cannot open shared object file: No such file or directory
(base) carlk@kadie2:/mnt/d/OneDrive/programs/bgen-reader-py2/bgen_reader/test$ cd ..
(base) carlk@kadie2:/mnt/d/OneDrive/programs/bgen-reader-py2/bgen_reader$ cd ..
(base) carlk@kadie2:/mnt/d/OneDrive/programs/bgen-reader-py2$ find . | fgrep libbgen.so
(base) carlk@kadie2:/mnt/d/OneDrive/programs/bgen-reader-py2$ echo $PYTHONPATH
/mnt/d/OneDrive/programs/bgen-reader-py2
(base) carlk@kadie2:/mnt/d/OneDrive/programs/bgen-reader-py2$ find . | fgrep .so
./bgen_reader/_ffi.abi3.so
./build/lib.linux-x86_64-3.7/bgen_reader/_ffi.abi3.so
(base) carlk@kadie2:/mnt/d/OneDrive/programs/bgen-reader-py2$
horta commented 4 years ago

Is Derbin a linux distribution on Windows? I googled it but couldn't find it.

Make sure to install the following packages before-hand: zstd, zlib, athr, and bgen.

You will find some instructions here: https://github.com/limix/bgen The instructions on the bgen README.md should be enough. If not, you can find fine details here: https://github.com/limix/bgen-reader-py/blob/master/.travis.yml

CarlKCarlK commented 4 years ago

Derbin is just another Linux distribution (refhttps://en.wikipedia.org/wiki/Debian). I do have it on Windows, but I mostly use Ubuntu so I’d suggest just closing this issue unless someone else has a problem.

From: Danilo Horta notifications@github.com Sent: Tuesday, April 07, 2020 9:02 AM To: limix/bgen-reader-py bgen-reader-py@noreply.github.com Cc: Carl Kadie carlk@msn.com; Author author@noreply.github.com Subject: Re: [limix/bgen-reader-py] Can't figure out dev build on Derbin (#28)

Is Derbin a linux distribution on Windows? I googled it but couldn't find it.

Make sure to install the following packages before-hand: zstd, zlib, athr, and bgen.

You will find some instructions here: https://github.com/limix/bgenhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Flimix%2Fbgen&data=02%7C01%7C%7C0d5cf1febd664ad9b53108d7db0cf9a7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637218721075322054&sdata=yvJ%2FjIVCa3NyyU8VBLAT%2B%2BspqvyRyqDC%2FZNhs2jRudI%3D&reserved=0 The instructions on the bgen README.md should be enough. If not, you can find fine details here: https://github.com/limix/bgen-reader-py/blob/master/.travis.ymlhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Flimix%2Fbgen-reader-py%2Fblob%2Fmaster%2F.travis.yml&data=02%7C01%7C%7C0d5cf1febd664ad9b53108d7db0cf9a7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637218721075332049&sdata=Szc0ewmAr71kM8zwhGIwFqVOpJ9o0n9%2Bx0y%2FXbI%2Fdoo%3D&reserved=0

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Flimix%2Fbgen-reader-py%2Fissues%2F28%23issuecomment-610473527&data=02%7C01%7C%7C0d5cf1febd664ad9b53108d7db0cf9a7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637218721075332049&sdata=PzP5PRim8R%2FUjTyokOVLkEPeALkFIhFOX7lmBJVeIL8%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABR65P3WXKUAJA67TYVKUILRLNE6VANCNFSM4LUL4PYQ&data=02%7C01%7C%7C0d5cf1febd664ad9b53108d7db0cf9a7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637218721075332049&sdata=jiH%2B9469wS4fVeBLnZ59%2FDQfT2It3M%2Ff3LOlbnXUg0g%3D&reserved=0.