master1234
master1234

Reputation: 11

zlib not found when installing ShortRead

I am using R (3.4.3) installed via anaconda (version 5.2). I have installed zlib using conda already. But when trying to install the Bioconductor R package: "ShortRead" I am getting this error:

checking for gzeof in -lz... no
configure: error: zlib not found
ERROR: configuration failed for package ‘ShortRead’

I tried installing inside R using Bioconductor biocLite and install.packages, but no luck!

I also tried installing directly from conda:

conda install -c bioconda bioconductor-shortread 
Solving environment: failed
UnsatisfiableError: The following specifications were found to be in conflict:
  - bioconductor-shortread
Use "conda info <package>" to see the dependencies for each package.

It seems this package is not available for R 3.4.3 from conda.

I also manually downloaded the zlib package. After compiling, I tried installing by exporting my LD library path to zlib''s lib location:

export LD_LIBRARY_PATH=/pathtozlib/zlib/lib

It didn't help either. Any help would be appreciated!

P.S I don't have root privileges in the machine I am working.

I found other people facing this issue: https://support.bioconductor.org/p/108808/. They suggest that it could be a problem with conda library.

Thanks,

Upvotes: 1

Views: 4708

Answers (3)

MEGHA SHYAM
MEGHA SHYAM

Reputation: 1

If you're running a deep learning algorithm where opencv is used and if u get zlib not found while all the dependencies are being installed don't panic. I had the same problem.There can the following reasons:

  1. If you've installed a IDE like anaconde your pip version will be automatically set to 3.4.2 and in this version zlib.h has a problem so it will show an error.So prefer to create a virtual environment and try installing the latest version of pip and if its not happening uninstall anaconda and use jupyter from pip{having the latest pip version}.
  2. If you're pip version is not updated, update it by the latest version.

Upvotes: 0

brendan
brendan

Reputation: 131

I believe that the problem lies with the configuration of autotools in r-base>3.4.1b2, but I'm not competent to fix that. The plus side is that, although configure can't find zlib during the pre-installation, zlib is actually present in any Conda environment with r-base and can be linked during the actual installation. I filed an issue at Conda-Forge, but until and unless the issue is resolved in r-base, I made a fork of ShortRead which skips the check. It works for me with r-base=3.5.1.

tldr: remotes::install_github("brendanf/ShortRead")

Upvotes: 2

MathBiolGuy
MathBiolGuy

Reputation: 1

I had the same error for the past week. I tried every thing that was mentioned regarding the zlib library on the internet. I couldn't fix it properly. I have the zlib installed as when I run: pkg-config zlib --libs; I get as output: -lz $ pkg-config zlib --libs -lz

I am running conda (v4.5.4). R version 3.4.3 and I have R as a conda environment. I think the problem is with multiple zlib libraries (ubuntu base and conda).

Somehow I just made this to work. What I did was to install R in ubuntu shell (i.e. outside conda) and install the ShortRead library there. There was no conflict/error with the zlib. After that I added the core Rlib directories to libPaths in conda.

$.libPaths(c('/home/aridaman/.conda/envs/rstudio/lib/R/library','/usr/local/lib/R/site-library/','/usr/lib/R/site-library','/usr/lib/R/site-library'))

This is not ideal but somehow worked for me. I would be glad to have a better conda based solution.

Upvotes: 0

Related Questions