Changeset: 43f84e370374 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=43f84e370374 Modified Files: MonetDB.spec configure.ag debian/rules sql/backends/monet5/Makefile.ag sql/backends/monet5/bam/Makefile.ag Branch: bamloader Log Message:
Adapted .ag files, MonetDB.spec and debian/rules to look for htslib instead of samtools diffs (202 lines): diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -36,8 +36,8 @@ %define with_geos 1 %endif -%if %{?_with_samtools:1}%{!?_with_samtools:0} -%define with_samtools 1 +%if %{?_with_hts:1}%{!?_with_hts:0} +%define with_hts 1 %endif Name: %{name} @@ -82,8 +82,8 @@ BuildRequires: rubygems-devel %endif BuildRequires: unixODBC-devel BuildRequires: zlib-devel -%if %{?with_samtools:1}%{!?with_samtools:0} -BuildRequires: samtools-devel +%if %{?with_hts:1}%{!?with_hts:0} +BuildRequires: hts-devel %endif # need to define python_sitelib on RHEL 5 and older @@ -456,7 +456,7 @@ numerical analysis (gsl). %{_libdir}/monetdb5/gsl.mal %{_libdir}/monetdb5/lib_gsl.so -%if %{?_with_samtools:1}%{!?_with_samtools:0} +%if %{?_with_hts:1}%{!?_with_hts:0} %package bam-MonetDB5 Summary: MonetDB5 SQL interface to the bam library Group: Applications/Databases @@ -542,7 +542,7 @@ fi %exclude %{_libdir}/monetdb5/lib_geom.so %endif %exclude %{_libdir}/monetdb5/lib_gsl.so -%if %{?_with_samtools:1}%{!?_with_samtools:0} +%if %{?_with_hts:1}%{!?_with_hts:0} %exclude %{_libdir}/monetdb5/bam.mal %exclude %{_libdir}/monetdb5/autoload/*_bam.mal %exclude %{_libdir}/monetdb5/lib_bam.so @@ -640,7 +640,7 @@ systemd-tmpfiles --create %{_sysconfdir} %exclude %{_libdir}/monetdb5/createdb/*_geom.sql %endif %exclude %{_libdir}/monetdb5/createdb/*_gsl.sql -%if %{?_with_samtools:1}%{!?_with_samtools:0} +%if %{?_with_hts:1}%{!?_with_hts:0} %exclude %{_libdir}/monetdb5/createdb/*_bam.sql %endif # %exclude %{_libdir}/monetdb5/createdb/*_rdf.sql @@ -800,7 +800,7 @@ developer, but if you do want to test, t --with-readline=yes \ --with-rubygem=%{?rhel:no}%{!?rhel:yes} \ --with-rubygem-dir=%{?rhel:no}%{!?rhel:"%{gem_dir}"} \ - --with-samtools=%{?with_samtools:yes}%{!?with_samtools:no} \ + --with-hts=%{?with_hts:yes}%{!?with_hts:no} \ --with-sphinxclient=no \ --with-unixodbc=yes \ --with-valgrind=no \ diff --git a/configure.ag b/configure.ag --- a/configure.ag +++ b/configure.ag @@ -2362,49 +2362,51 @@ AC_SUBST(MSEED_CFLAGS, $MSEED_CFLAGS) AC_SUBST(MSEED_LIBS, $MSEED_LIBS) AM_CONDITIONAL(HAVE_MSEED, test x"$have_mseed" != xno) -# samtools, only used by sql -org_have_samtools="auto" -have_samtools=$org_have_samtools -AC_ARG_WITH(samtools, - AS_HELP_STRING([--with-samtools=DIR], - [samtools (providing bam library) are installed in DIR]), - [have_samtools="$withval"], [have_samtools="auto"]) -if test "x$have_samtools" != xno; then - case "$have_samtools" in +# hts (required by BAM library), only used by sql +org_have_bam="auto" +have_bam=$org_have_bam +AC_ARG_WITH(hts, + AS_HELP_STRING([--with-hts=DIR], + [hts (providing bam library) are installed in DIR]), + [have_bam="$withval"], [have_bam="auto"]) +if test "x$have_bam" != xno; then + case "$have_bam" in auto|yes) ;; *) - SAMTOOLS_CFLAGS="-I$have_samtools/include" - SAMTOOLS_LIBS="-L$have_samtools/lib -lbam" + BAM_CFLAGS="-I$have_bam/include" + BAM_LIBS="-L$have_bam/lib -lhts" ;; esac save_CPPFLAGS="$CPPFLAGS" save_LDFLAGS="$LDFLAGS" - CPPFLAGS="$CPPFLAGS $SAMTOOLS_CFLAGS" - LDFLAGS="$LDFLAGS $SAMTOOLS_LIBS" - AC_CHECK_HEADER(samtools/bam.h, - AC_CHECK_HEADER(samtools/bgzf.h, - AC_CHECK_LIB(bam, bam_header_read, - AC_DEFINE(HAVE_SAMTOOLS, 1, [Define if you have the samtools (providing the bam library)]), - [ if test "x$have_samtools" != xauto; then AC_MSG_ERROR([-lbam library not found]); fi - have_samtools=no; why_have_samtools="(bam library not found)" ], - [-lm -lpthread -lz]), - [ if test "x$have_samtools" != xauto; then AC_MSG_ERROR([samtools/bgzf.h header not found]); fi - have_samtools=no; why_have_samtools="(samtools/bgzf.h header not found)" ]), - [ if test "x$have_samtools" != xauto; then AC_MSG_ERROR([samtools/bam.h header not found]); fi - have_samtools=no; why_have_samtools="(samtools/bam.h header not found)" ]) + CPPFLAGS="$CPPFLAGS $BAM_CFLAGS" + LDFLAGS="$LDFLAGS $BAM_LIBS" + AC_CHECK_HEADER(htslib/sam.h, + AC_CHECK_HEADER(htslib/bgzf.h, + AC_CHECK_HEADER(htslib/kstring.h, + AC_CHECK_LIB(hts, sam_hdr_read, + AC_DEFINE(ENABLE_BAM, 1, [Define if the BAM library will be enabled (only if htslib was found on system)]), + [ if test "x$have_bam" != xauto; then AC_MSG_ERROR([-lhts library not found]); fi + have_bam=no; why_have_bam="(bam library not found)" ], + [-lm -lpthread -lz]), + [ if test "x$have_bam" != xauto; then AC_MSG_ERROR([htslib/kstring.h header not found]); fi + have_bam=no; why_have_bam="(htslib/kstring.h header not found)" ]), + [ if test "x$have_bam" != xauto; then AC_MSG_ERROR([htslib/bgzf.h header not found]); fi + have_bam=no; why_have_bam="(htslib/bgzf.h header not found)" ]), + [ if test "x$have_bam" != xauto; then AC_MSG_ERROR([htslib/sam.h header not found]); fi + have_bam=no; why_have_bam="(htslib/sam.h header not found)" ]) LDFLAGS="$save_LDFLAGS" CPPFLAGS="$save_CPPFLAGS" - if test "x$have_samtools" = "xyes" -o "x$have_samtools" = "xauto"; then - SAMTOOLS_CFLAGS= - SAMTOOLS_LIBS="-lbam" - AC_CHECK_HEADERS([samtools/kstring.h]) + if test "x$have_bam" = "xyes" -o "x$have_bam" = "xauto"; then + BAM_CFLAGS= + BAM_LIBS="-lhts" fi fi -AC_SUBST(SAMTOOLS_CFLAGS, $SAMTOOLS_CFLAGS) -AC_SUBST(SAMTOOLS_LIBS, $SAMTOOLS_LIBS) -AM_CONDITIONAL(HAVE_SAMTOOLS, test x"$have_samtools" != xno) +AC_SUBST(BAM_CFLAGS, $BAM_CFLAGS) +AC_SUBST(BAM_LIBS, $BAM_LIBS) +AM_CONDITIONAL(ENABLE_BAM, test x"$have_bam" != xno) # geos, only used in geom module org_have_geos=auto @@ -3447,7 +3449,7 @@ for comp in \ 'raptor ' \ 'readline ' \ 'rubygem ' \ - 'samtools ' \ + 'bam ' \ 'setsockopt ' \ 'sphinxclient ' \ 'unixodbc ' \ diff --git a/debian/rules b/debian/rules --- a/debian/rules +++ b/debian/rules @@ -60,7 +60,7 @@ override_dh_auto_configure: --with-readline=yes \ --with-rubygem=yes \ --with-rubygem-dir=lib/ruby/gems/1.8 \ - --with-samtools=yes \ + --with-hts=yes \ --with-sphinxclient=no \ --with-unixodbc=yes \ --with-valgrind=no diff --git a/sql/backends/monet5/Makefile.ag b/sql/backends/monet5/Makefile.ag --- a/sql/backends/monet5/Makefile.ag +++ b/sql/backends/monet5/Makefile.ag @@ -15,7 +15,7 @@ # Copyright August 2008-2014 MonetDB B.V. # All Rights Reserved. -SUBDIRS = NOT_WIN32?vaults UDF HAVE_SAMTOOLS?bam LSST ENABLE_DATACELL?datacell HAVE_JSONSTORE?rest HAVE_GSL?gsl +SUBDIRS = NOT_WIN32?vaults UDF ENABLE_BAM?bam LSST ENABLE_DATACELL?datacell HAVE_JSONSTORE?rest HAVE_GSL?gsl INCLUDES = ../../include ../../common ../../storage ../../server \ ../../../monetdb5/modules/atoms \ diff --git a/sql/backends/monet5/bam/Makefile.ag b/sql/backends/monet5/bam/Makefile.ag --- a/sql/backends/monet5/bam/Makefile.ag +++ b/sql/backends/monet5/bam/Makefile.ag @@ -30,7 +30,8 @@ INCLUDES = .. \ ../../../../common/stream \ ../../../../gdk \ ../../../../tools/merovingian \ - ../../../../tools/merovingian/daemon + ../../../../tools/merovingian/daemon \ + $(BAM_CFLAGS) lib__bam = { MODULE @@ -43,7 +44,7 @@ lib__bam = { bam_export.c bam_export.h LIBS = ../../../../monetdb5/tools/libmonetdb5 \ ../../../../gdk/libbat \ - -lhts + $(BAM_LIBS) } headers_mal = { _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list