rwdavies / STITCH

STITCH - Sequencing To Imputation Through Constructing Haplotypes
http://www.nature.com/ng/journal/v48/n8/abs/ng.3594.html
GNU General Public License v3.0
77 stars 17 forks source link

Fatal error during STITCH installation related to zlib.h #88

Open jamonterotena opened 1 year ago

jamonterotena commented 1 year ago

I'm trying to install STITCH using the method explained here:

R CMD INSTALL STITCH_1.6.10.tar.gz

However, it doesn't work and gives the following error:

(zlib) jmontero@lummerland:/vol/agcpgl/jmontero/RILs/Programs/STITCH/releases$ /vol/agcpgl/jmontero/RILs/Programs/R-4.3.1/bin/R CMD INSTALL STITCH_1.6.10.tar.gz
* installing to library ‘/vol/agcpgl/jmontero/RILs/Programs/R-4.3.1/lib/R/library’
* installing *source* package ‘STITCH’ ...
** using staged installation
** libs
using C++ compiler: ‘g++ (crosstool-NG 1.24.0.133_b0863d8_dirty) 7.5.0’
using C++11
g++ -std=gnu++11 -I"/vol/agcpgl/jmontero/RILs/Programs/R-4.3.1/lib/R/include" -DNDEBUG -I./SeqLib// -I./SeqLib//htslib/ -I'/vol/agcpgl/jmontero/RILs/Programs/R-4.3.1/lib/R/library/Rcpp/include' -I'/vol/agcpgl/jmontero/RILs/Programs/R-4.3.1/lib/R/library/RcppArmadillo/include' -I/usr/local/include    -fpic  -g -O2  -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/vol/agcpgl/jmontero/RILs/Programs/R-4.3.1/lib/R/include" -DNDEBUG -I./SeqLib// -I./SeqLib//htslib/ -I'/vol/agcpgl/jmontero/RILs/Programs/R-4.3.1/lib/R/library/Rcpp/include' -I'/vol/agcpgl/jmontero/RILs/Programs/R-4.3.1/lib/R/library/RcppArmadillo/include' -I/usr/local/include    -fpic  -g -O2  -c bam_access.cpp -o bam_access.o
In file included from ./SeqLib//SeqLib/GenomicRegionCollection.h:349:0,
                 from ./SeqLib//SeqLib/ReadFilter.h:13,
                 from ./SeqLib//SeqLib/BamReader.h:5,
                 from bam_access.cpp:3:
./SeqLib//SeqLib/GenomicRegionCollection.cpp:10:10: fatal error: zlib.h: No such file or directory
 #include <zlib.h>
          ^~~~~~~~
compilation terminated.
make: *** [/vol/agcpgl/jmontero/RILs/Programs/R-4.3.1/lib/R/etc/Makeconf:200: bam_access.o] Error 1
ERROR: compilation failed for package ‘STITCH’
* removing ‘/vol/agcpgl/jmontero/RILs/Programs/R-4.3.1/lib/R/library/STITCH’

I tried to install zlib through miniconda and activated the environment before running the command but it keeps printing the same error message. I tried installing STITCH through conda but didn't work either.

What should I try?

Here is some info about the R session in case it helps:

> sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.6 LTS

Matrix products: default
BLAS:   /vol/agcpgl/jmontero/RILs/Programs/R-4.3.1/lib/R/lib/libRblas.so
LAPACK: /vol/agcpgl/jmontero/RILs/Programs/R-4.3.1/lib/R/lib/libRlapack.so;  LAPACK version 3.11.0

locale:
 [1] LC_CTYPE=en_US.utf8       LC_NUMERIC=C
 [3] LC_TIME=en_US.utf8        LC_COLLATE=en_US.utf8
 [5] LC_MONETARY=en_US.utf8    LC_MESSAGES=en_US.utf8
 [7] LC_PAPER=en_US.utf8       LC_NAME=C
 [9] LC_ADDRESS=C              LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C

time zone: Europe/Berlin
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_4.3.1

Any help is appreciated.

Zilong-Li commented 1 year ago

Hi,

I may suggest trying to

  1. ask the system admin to install zlib header files
  2. put the following in your $HOME/.bashrc if you install zlib through conda: export CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:$HOME/miniconda3/include" export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:$HOME/miniconda3/lib/pkgconfig"
rwdavies commented 1 year ago

Thanks for the info re: STITCH through conda, that shouldn't happen. I'll try to have a look later this week about this