Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Support for krand in htslib 1.6 #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chapmanb
Copy link

htslib 1.6 changed how ksort is exposed, internalizing drand48 into
hts_drand48 (samtools/htslib#559). This caused a lookup error during
compiling:

src/reader.cpp:67: undefined reference to `hts_drand48()'

Triggered when initializing ksort:

https://github.com/chapmanb/pindel/blob/b706fba61c64a11fb1d3716d501fd2f4d8992e29/src/reader.cpp#L67

This works around the issue by referencing hts_drand48 to drand48.

I'm not sure if this is the best long term fix but hopefully will be a workaround for folks or lead to discussion of a better approach to take.

htslib 1.6 changed how ksort is exposed, internalizing drand48 into
hts_drand48 (samtools/htslib#559). This caused a lookup error during
compiling:
```
src/reader.cpp:67: undefined reference to `hts_drand48()'
```
Triggered when initializing ksort:

https://github.com/chapmanb/pindel/blob/b706fba61c64a11fb1d3716d501fd2f4d8992e29/src/reader.cpp#L67

This works around the issue by referencing hts_drand48 to drand48.
@jmarshall
Copy link
Contributor

Something like that may be a useful workaround to get past a pain point, but it is a terrible hack that should not be checked in. This htslib change, distasteful though it is, should be invisible outside htslib.

I suspect what is happening here is that you are compiling with the 1.6 headers but accidentally linking with an older pre-1.6 libhts.a. Is this possible?

@chapmanb
Copy link
Author

chapmanb commented Nov 3, 2017

John -- agreed this is an ugly hack and I'd welcome a better solution. Practically this happens when building pindel inside bioconda so it starts with a clean empty Docker environment that only injects the 1.6 build. Unless the bioconda 1.6 htslib is somehow broken, I'm not sure how we'd get the older versions in there. I'm definitely not an expert on pindel building or htslib so am kind of out of my element here and would welcome better ideas to fix this.

@jmarshall
Copy link
Contributor

I'm not going to defend the HTSlib change, but I was surprised that I was unable to reproduce this sort of problem when building third-party software against it. First step: send me a full log from your bioconda build and I can take a look at it. Though really it is @daviesrob's problem 😄

@daviesrob
Copy link

Looks like this was due to a missing extern "C" in htslib/ksort.h (see #76). One should appear on the develop branch soon.

Apologies for the inconvenience...

@daviesrob
Copy link

The fix has now been pushed to htslib's develop branch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants