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

libbz2.so is not distributed by bzip2-1.0.6 #2441

Closed
rainwoodman opened this Issue Jun 20, 2017 · 6 comments

Comments

Projects
None yet
4 participants
@rainwoodman

rainwoodman commented Jun 20, 2017

In bzip2-1.0.6 it appears only libbz2.a is distributed. This creates difficulty to port prebuilt binaries that uses libbz2. If the build platform provides a libbz2.so it is usually preferred and the binaries are linked with libbz2.so instead of libbz2.a provided by conda. As a result, when the binaries are deployed by conda to a platform without libbz2.so, the code crashes with an error:

~/.conda/envs/bccp/lib/python3.5/site-packages/fitsio/fitslib.py in <module>()
     27 import warnings
     28 
---> 29 from . import _fitsio_wrap
     30 from .util import FITSRuntimeWarning, cfitsio_version
     31 

ImportError: libbz2.so.1.0: cannot open shared object file: No such file or directory

Related to bccp/conda-channel-bccp#8

@rainwoodman

This comment has been minimized.

Show comment
Hide comment
@rainwoodman

rainwoodman Jun 22, 2017

It turns out if the package is built under anaconda and declares bzip2 as a build dependency the reference to libbz2.so is eliminated. At least this is true on travis-ci linux64.

rainwoodman commented Jun 22, 2017

It turns out if the package is built under anaconda and declares bzip2 as a build dependency the reference to libbz2.so is eliminated. At least this is true on travis-ci linux64.

@tfording

This comment has been minimized.

Show comment
Hide comment
@tfording

tfording Jul 24, 2017

I'm trying to use 'pysam' via conda install and am getting the same error:

>>> import pysam Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/n/projects/anaconda2/lib/python2.7/site-packages/pysam/__init__.py", line 5, in <module> from pysam.libchtslib import * ImportError: libbz2.so.1.0: cannot open shared object file: No such file or directory

I've attempted to install bz2 via conda as well, but like stated above the only instance of the package I can find is 'libbz2.a'.

tfording commented Jul 24, 2017

I'm trying to use 'pysam' via conda install and am getting the same error:

>>> import pysam Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/n/projects/anaconda2/lib/python2.7/site-packages/pysam/__init__.py", line 5, in <module> from pysam.libchtslib import * ImportError: libbz2.so.1.0: cannot open shared object file: No such file or directory

I've attempted to install bz2 via conda as well, but like stated above the only instance of the package I can find is 'libbz2.a'.

@rainwoodman

This comment has been minimized.

Show comment
Hide comment
@rainwoodman

rainwoodman Jul 24, 2017

@tfording, the problem disappeared when I added bzip2 to the conda recipe. So the maintainer of bioconda can perhaps help you to fix this.

rainwoodman commented Jul 24, 2017

@tfording, the problem disappeared when I added bzip2 to the conda recipe. So the maintainer of bioconda can perhaps help you to fix this.

@iromeo

This comment has been minimized.

Show comment
Hide comment
@iromeo

iromeo Jul 28, 2017

@rainwoodman

the problem disappeared when I added bzip2 to the conda recipe.

Could you explain how to do it? I have same issue with libbz2.so.1.0:

iromeo commented Jul 28, 2017

@rainwoodman

the problem disappeared when I added bzip2 to the conda recipe.

Could you explain how to do it? I have same issue with libbz2.so.1.0:

@AndreasHeger

This comment has been minimized.

Show comment
Hide comment
@AndreasHeger

AndreasHeger Jul 31, 2017

Just got caught by the same issue. In my situation, the reason was that:

  • "defaults" channel: provides bzip2-1.0.6 without .so
  • "conda-forge" channel: provides bzip2-1.0.6 with .so

To resolve, either set conda-forge as a higher-priority channel or type:

conda install --override-channels -c conda-forge bzip2

AndreasHeger commented Jul 31, 2017

Just got caught by the same issue. In my situation, the reason was that:

  • "defaults" channel: provides bzip2-1.0.6 without .so
  • "conda-forge" channel: provides bzip2-1.0.6 with .so

To resolve, either set conda-forge as a higher-priority channel or type:

conda install --override-channels -c conda-forge bzip2
@rainwoodman

This comment has been minimized.

Show comment
Hide comment
@rainwoodman

rainwoodman Jul 31, 2017

Hi, I prefer to work with the default channels because it is not clear if there is any policy conda-forge overwrites a default channel package. I suppose anaconda have a policy of not distributing the .so file because it prefers static linking (for a variety of good reasons) -- most other Linux distributors do prefer dynamic linking, which may have motivated conda-forge's packaging policy.

Here is what I did to fix our package's yaml recipe. It's a one line change.

bccp/conda-channel-bccp@ae73b3f#diff-2a1bf10256fa18f4a657af078af914c8L18

rainwoodman commented Jul 31, 2017

Hi, I prefer to work with the default channels because it is not clear if there is any policy conda-forge overwrites a default channel package. I suppose anaconda have a policy of not distributing the .so file because it prefers static linking (for a variety of good reasons) -- most other Linux distributors do prefer dynamic linking, which may have motivated conda-forge's packaging policy.

Here is what I did to fix our package's yaml recipe. It's a one line change.

bccp/conda-channel-bccp@ae73b3f#diff-2a1bf10256fa18f4a657af078af914c8L18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment