diff --git a/ci/azure-linux_mac.yml b/ci/azure-linux_mac.yml index 6a5c24b78..cafab64aa 100755 --- a/ci/azure-linux_mac.yml +++ b/ci/azure-linux_mac.yml @@ -32,7 +32,7 @@ steps: sudo make install popd else - brew install bcftools + brew install bcftools automake fi # Install autoconf/automake (required for htslib) diff --git a/ci/native_libs-linux_osx.yml b/ci/native_libs-linux_osx.yml index e49421738..da12d5548 100755 --- a/ci/native_libs-linux_osx.yml +++ b/ci/native_libs-linux_osx.yml @@ -13,7 +13,7 @@ steps: sudo make install popd else - brew install bcftools + brew install bcftools automake fi # Install autoconf/automake (required for htslib) diff --git a/docker/Dockerfile-cli b/docker/Dockerfile-cli index 3cb02cd55..bc9a2347c 100644 --- a/docker/Dockerfile-cli +++ b/docker/Dockerfile-cli @@ -5,7 +5,7 @@ ENV AWS_EC2_METADATA_DISABLED true # Install some dependencies RUN yum -y install cmake3 which wget git tar gzip unzip gcc-c++ zlib-devel \ openssl-devel bzip2-devel libcurl-devel xz-devel make \ - automake autoconf \ + automake autoconf patch \ && yum clean all WORKDIR /tmp diff --git a/libtiledbvcf/cmake/Modules/FindHTSlib_EP.cmake b/libtiledbvcf/cmake/Modules/FindHTSlib_EP.cmake index 629279cb2..0c86eeb69 100644 --- a/libtiledbvcf/cmake/Modules/FindHTSlib_EP.cmake +++ b/libtiledbvcf/cmake/Modules/FindHTSlib_EP.cmake @@ -60,6 +60,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(HTSlib REQUIRED_VARS HTSLIB_LIBRARIES HTSLIB_INCLUDE_DIR ) + if (NOT HTSLIB_FOUND) if (SUPERBUILD) message(STATUS "Adding HTSlib as an external project") @@ -74,6 +75,12 @@ if (NOT HTSLIB_FOUND) if (BUILD_TYPE STREQUAL "DEBUG") SET(CFLAGS "-g") endif() + + # required to updated htslib configure.ac with autoconf 2.70 + # - see https://github.com/samtools/htslib/commit/680c0b8ef0ff133d3b572abc80fe66fc2ea965f0 + # - and https://github.com/samtools/htslib/pull/1198/commits/6821fc8ed88706e9282b561e74dfa45dac4d74c8 + find_program(AUTORECONF NAMES autoreconf REQUIRED) + ExternalProject_Add(ep_htslib PREFIX "externals" URL "https://github.com/samtools/htslib/archive/1.10.zip" @@ -82,13 +89,15 @@ if (NOT HTSLIB_FOUND) CONFIGURE_COMMAND autoheader COMMAND - autoconf + ${AUTORECONF} -i COMMAND ./configure --prefix=${EP_INSTALL_PREFIX} LDFLAGS=${EXTRA_LDFLAGS} CFLAGS=${CFLAGS} BUILD_COMMAND $(MAKE) INSTALL_COMMAND $(MAKE) install + PATCH_COMMAND + patch -N -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/cmake/patches/htslib-1.10-config.patch BUILD_IN_SOURCE TRUE LOG_DOWNLOAD TRUE LOG_CONFIGURE TRUE @@ -114,4 +123,4 @@ endif() if (EP_HTSLIB_BUILT AND TARGET HTSlib::HTSlib) include(TileDBCommon) install_target_libs(HTSlib::HTSlib) -endif() \ No newline at end of file +endif() diff --git a/libtiledbvcf/cmake/patches/htslib-1.10-config.patch b/libtiledbvcf/cmake/patches/htslib-1.10-config.patch new file mode 100644 index 000000000..2c6e7443d --- /dev/null +++ b/libtiledbvcf/cmake/patches/htslib-1.10-config.patch @@ -0,0 +1,31 @@ +From 6821fc8ed88706e9282b561e74dfa45dac4d74c8 Mon Sep 17 00:00:00 2001 +From: John Marshall +Date: Fri, 1 Jan 2021 10:37:22 +0000 +Subject: [PATCH] Don't set $host_alias as that confuses autoconf 2.70 + +Autoconf 2.70 is more careful about cross compilation, so with this +version using AC_FUNC_MMAP implies AC_CANONICAL_HOST and hence computes +$build/build_alias/host/host_alias/etc. Setting $host_alias ourselves +interferes with that. Hat tip Matthias Klose (via debbug#978835). + +As autoconf 2.70 implicitly uses AC_CANONICAL_HOST, it requires (and its +autoreconf --install installs) config.guess and config.sub. Ignore those, +and ignore install-sh as well for good measure. +--- +diff --git a/configure.ac b/configure.ac +index 9bd1642d7..f473c97e5 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -137,9 +137,9 @@ AC_ARG_ENABLE([s3], + [support Amazon AWS S3 URLs])], + [], [enable_s3=check]) + +-test -n "$host_alias" || host_alias=unknown-`uname -s` +-AC_MSG_CHECKING([shared library type for $host_alias]) +-case $host_alias in ++basic_host=${host_alias:-unknown-`uname -s`} ++AC_MSG_CHECKING([shared library type for $basic_host]) ++case $basic_host in + *-cygwin* | *-CYGWIN*) + host_result="Cygwin DLL" + PLATFORM=CYGWIN