single-cell-genetics / cellsnp-lite

Efficient genotyping bi-allelic SNPs on single cells
https://cellsnp-lite.readthedocs.io
Apache License 2.0
132 stars 11 forks source link

Installation Error #135

Closed DarioS closed 3 months ago

DarioS commented 3 months ago

Error message is unclear.

/usr/bin/ld: /dski/biostat/software/htslib-1.20/cram/cram_io.c:1547: undefined reference to `libdeflate_crc32'
/usr/bin/ld: /dski/biostat/software/htslib-1.20//libhts.a(cram_io.o): in function `cram_uncompress_block':
/dski/biostat/software/htslib-1.20/cram/cram_io.c:1581: undefined reference to `libdeflate_crc32'
undefined references to `libdeflate_crc32' follow
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:445: cellsnp-lite] Error 1
make[1]: Leaving directory '/dski/biostat/software/cellsnp-lite'
make: *** [Makefile:322: all] Error 2
hxj5 commented 3 months ago

EDIT (20240905): issue #137 ("Error with link to libhts.a") lists one possible solution to the problem above.


original answer:

Hi, it seems a compling issue related to htslib. Specifically, the libdeflate may be missing. You may first build "libdeflate" and then pass it to htslib, something like ./configure LDFLAGS='-L/location/of/libdeflate -Wl,-R/location/of/libdeflate'. For details, you may check out this similar thread.

Alternatively, we highly recommend installing cellsnp-lite via conda to get rid of the compiling issues. conda install -c bioconda cellsnp-lite

DarioS commented 3 months ago

Very easy with conda.