Skip to content

Conversation

@mp15
Copy link
Member

@mp15 mp15 commented Sep 5, 2012

Fix function prototypes for knetfile and bgzf to match system read and write.

@pd3 pd3 merged this pull request into samtools:master Sep 5, 2012
@pd3
Copy link
Member

pd3 commented Sep 5, 2012

These changes break compiling on linux. Can you please fix? I undid the merge for now.

@lh3
Copy link
Member

lh3 commented Sep 5, 2012

Also, we should not use off64_t and lseek64(). They are non-existing on 32-bit Linux, I think (haven't tried). We should use macro to let the system handle off_t and off64_t.

See also: http://www.suse.de/~aj/linux_lfs.html

@mp15
Copy link
Member Author

mp15 commented Sep 6, 2012

Thanks Petr, I've fixed it and committed to the misc_improve branch again.

Heng you're right, the reason why the same code worked in samtools but not htslib is that samtools has -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE set by the default makefile. From what I have read LFS is available on 32-bit systems, and is kernel and filesystem dependant (kernel 2.4.0+) rather than architecture dependant. I'd attempted to workaround its non-existence for BSD but you're right relying on the macro system is better. You may wish to have those flags set by default in htslib too? After all we do tend to work with large files. The POSIX way to do this would be to add getconf LFS_CFLAGS to the makefile, not sure if this would work on WIN32 though.

Martin

On 5 Sep 2012, at 17:07, Heng Li wrote:

Also, we should not use off64_t and lseek64(). They are non-existing on 32-bit Linux, I think (haven't tried). We should use macro to let the system handle off_t and off64_t.


Reply to this email directly or view it on GitHub.

These changes breaks compiling on linux. Can you please fix? I undid the merge for now.

The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants