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

STITCH compilation issue #6

Closed Zilong-Li closed 5 years ago

Zilong-Li commented 7 years ago

when I try to install STITCH on my linux system, I meet with this compilation issue

cram/cram_io.c: In function ‘cram_set_voption’ cram/cram_io.c:4529:10: error: ‘CRAM_OPT_BASES_PER_SLICE’ undeclared (first use in this function) case CRAM_OPT_BASES_PER_SLICE: ^ cram/cram_io.c:4529:10: note: each undeclared identifier is reported only once for each function it appears in cram/cram_io.c:4549:10: error: ‘CRAM_OPT_LOSSY_NAMES’ undeclared (first use in this function) case CRAM_OPT_LOSSY_NAMES: ^ cram/cram_io.c:4626:2: error: unknown type name ‘htsThreadPool’ htsThreadPool p = va_arg(args, htsThreadPool ); ^ In file included from /ifs4/BC_PUB/biosoft/pipeline/Package/huangshujia/extra/zlib/1.2.11/include/zconf.h:450:0, from /ifs4/BC_PUB/biosoft/pipeline/Package/huangshujia/extra/zlib/1.2.11/include/zlib.h:34, from cram/cram_io.c:55: cram/cram_io.c:4626:34: error: unknown type name ‘htsThreadPool’ htsThreadPool p = va_arg(args, htsThreadPool ); ^ cram/cram_io.c:4627:18: error: request for member ‘pool’ in something not a structure or union fd->pool = p ? p->pool : NULL; ^ cram/cram_io.c:4630:8: error: request for member ‘qsize’ in something not a structure or union p->qsize ? p->qsize : hts_tpool_size(fd->pool)2, ^ cram/cram_io.c:4630:19: error: request for member ‘qsize’ in something not a structure or union p->qsize ? p->qsize : hts_tpool_size(fd->pool)2, ^ make[1]: [cram/cram_io.o] Error 1 make[1]: Leaving directory `/tmp/Rtmp4ouBsJ/R.INSTALL10852a92e2b5/STITCH/src/SeqLib/htslib' make: [SeqLib] Error 2 ERROR: compilation failed for package ‘STITCH’

I have no idea how to fix this error. Any suggestion will be extremely grateful

rwdavies commented 7 years ago

Hi, interestingly that looks like a problem with compiling htslib through SeqLib. I'm travelling currently so have limited time to look at this right now, but what kind of Linux are you on, what version of R is this, and have you ever had any problems installing things like samtools?

Zilong-Li commented 7 years ago

Thanks for the reply.The Linux is CentOS 6.9 and R version is 3.3.What's more, the other colleague have failed to install the angsd on the Linux due to the newest htslib version, and we fixed it by substituted with the old htslib version. I believe it may be a optional solution, and I also try to substitute the STITCH/src/SeqLib/htslib with the old version but failed. Looking forward to your reply.

rwdavies commented 7 years ago

Hey, really sorry, I had thought I'd have some time to look at this, but I'm now halfway through my August holidays with family and haven't had a chance to look at this in much depth. I'm travelling this week with limited / no internet until August 27th but will be able to investigate this in more detail on my return.

One small thing though, when you say you substituted the old STITCH/src/SeqLib/htslib, did you then install using a release tarball (R CMD INSTALL) or install using ./scripts/build-and-install.R? The former uses a static copy of htslib included in the tarball, while the latter would make use of STITCH/src/SeqLib/htslib.

Zilong-Li commented 7 years ago

Finally, I make it by using ./scripts/build-and-install.R. Thanks very much.

And best wishes for your holidays.

Zilong-Li commented 6 years ago

Hi, Dr Davies

I am very excited about STITCH new feature. And it is very helpful for my work that the latest version of STITCH can dramatically speed up analysis for low coverage samples. Thanks for your efforts very much.

However, this complication issue can't be solved by substituting with the old STITCH/src/SeqLib/htslib. any more. If the latest htslib is necessary, how can I fix this issue.

Any advice will be grateful.

rwdavies commented 6 years ago

Hey,

I don't think a newer STITCH/src/SeqLib/hstlib should be necessary? Maybe try swapping the entirety of STITCH/src/SeqLib from the version that worked for you to a new clone of STITCH? More formally maybe rolling back the pinned SeqLib commit to an old one would would? Can you try something like the following

git clone --recursive https://github.com/rwdavies/STITCH.git
cd STITCH
./scripts/install-dependencies.sh
cd STITCH/src/SeqLib/ 
git checkout 770cd10 # one of the earlier pinned versions of SeqLib
cd ../../../
./scripts/build-and-install.R
Zilong-Li commented 6 years ago

I make it ! Many thanks !