Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fails with samtools v.1.3 and htslib v.1.3 #28

Closed
magicDGS opened this issue Jan 12, 2016 · 4 comments · Fixed by #86
Closed

Compilation fails with samtools v.1.3 and htslib v.1.3 #28

magicDGS opened this issue Jan 12, 2016 · 4 comments · Fixed by #86

Comments

@magicDGS
Copy link

When configure with pre-compiled samtools-1.3 and htslib-1.3, make produce the following error:

In file included from bam_md_ext.c:38:0:
samtools-1.3/bam.h:189:28: error: conflicting types for ‘seq_nt16_int’
 #define bam_nt16_nt4_table seq_nt16_int
                            ^
bam_md_ext.c:54:12: note: in expansion of macro ‘bam_nt16_nt4_table’
 const char bam_nt16_nt4_table[] = { 4, 0, 1, 4, 2, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 4 };
            ^
In file included from htslib-1.3/htslib/sam.h:30:0,
                 from bam_md_ext.c:37:
htslib-1.3/htslib/hts.h:255:18: note: previous declaration of ‘seq_nt16_int’ was here
 extern const int seq_nt16_int[];
                  ^
In file included from bam_md_ext.c:43:0:
samutils.h:47:14: warning: ‘op_cat_str’ defined but not used [-Wunused-variable]
 static char *op_cat_str[] = {
              ^
make[1]: *** [bam_md_ext.o] Error 1
make: *** [all-recursive] Error 1
@andreas-wilm
Copy link
Contributor

Yep. The Debian team suggested to remove the samtools dependency altogether and only rely on htslib. Will need to look into it

@jmarshall
Copy link
Contributor

👍 to the suggestion to modify lofreq to use only HTSlib. HTSlib is maintained as a coherent and usable library, but the legacy samtools API is not.

In the meantime, you can work around this particular problem and compile successfully by adding the following to e.g. src/lofreq/bam_md_ext.h:

#undef bam_nt16_nt4_table

I have not tested whether the resulting executable is fully functional.

@andreas-wilm
Copy link
Contributor

That's definitely the best way to go forward. Might take some time to implement though.

cfriedline pushed a commit to cfriedline/lofreq that referenced this issue Dec 2, 2016
This was referenced Jun 21, 2017
@mmterpstra
Copy link

mmterpstra commented Oct 8, 2019

hints for creating a decent version with fixed dependencies (aka patch out includedir path for both HTSlib and SAMtools and fix compile error):

https://github.com/easybuilders/easybuild-easyconfigs/blob/44dc94e901cd40c3044e2fad2e0f0b5590c61b8f/easybuild/easyconfigs/l/LoFreq/LoFreq-2.1.2_SAMtools-HTSlib.patch

the $EBROOT[SAMTOOLS|HTSLIB] variables are (easy)build system defaults. These can be replaced with SAMTOOLS|HTSLIB parameters pointing to the installation dirs of SAMTOOLS|HTSLIB instead of the sourcedirs.

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 a pull request may close this issue.

4 participants