Skip to content

Commit

Permalink
Merge pull request #576 from samtools/feature/autoconf
Browse files Browse the repository at this point in the history
Merge in autoconf for bcftools.

Closes #573, closes #481
  • Loading branch information
mcshane committed Jun 13, 2017
2 parents 469b8e2 + a6bad14 commit d595e63
Show file tree
Hide file tree
Showing 19 changed files with 1,159 additions and 92 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ plugins/*.so
plugins/*.dSYM
plugins/*.P

aclocal.m4
autom4te.cache
config.cache
config.h
config.h.in
config.log
config.mk
config.status
configure

/test/test-rbuf
/test/test-regidx

Expand Down
17 changes: 14 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,24 @@ matrix:
include:
- os: linux
compiler: clang
env: USE_CONFIG=no
- os: linux
compiler: gcc
env: USE_CONFIG=no
# An unoptimised C99 build, for detecting non-static inline functions
- os: linux
compiler: gcc
env: CFLAGS="-std=gnu99 -O0"
env: CFLAGS="-std=gnu99 -O0" USE_CONFIG=no
- os: osx
compiler: clang
env: USE_CONFIG=no
# Test the configure script
- os: linux
compiler: gcc
env: USE_CONFIG=yes
- os: osx
compiler: clang
env: USE_CONFIG=yes

env:
global:
Expand All @@ -25,16 +35,17 @@ addons:
packages:
- liblzma-dev
- libbz2-dev
- libgsl0-dev

# For MacOSX systems
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install xz; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install xz gsl ; fi

before_script:
# Clone samtools/htslib (or another repository, as specified by a Travis CI
# repository $HTSREPO setting) and check out a corresponding branch with the
# same name, if any, or otherwise the default branch.
- .travis/clone ${HTSREPO:-git://github.com/samtools/htslib.git} $HTSDIR $TRAVIS_BRANCH

script: make plugindir=$TRAVIS_BUILD_DIR/plugins -e && make -e test-plugins
script: if test "$USE_CONFIG" = "yes" ; then ( cd "$HTSDIR" && autoreconf ) && autoreconf && ./configure --enable-libgsl && make && make test ; else make plugindir=$TRAVIS_BUILD_DIR/plugins -e && make -e test-plugins ; fi
82 changes: 69 additions & 13 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -23,43 +23,99 @@ are:
bzip2-devel
xz-devel

To build BCFtools, you will need:

GNU make
C compiler (e.g. gcc or clang)

In addition, building the configure script requires:

autoheader
autoconf

Running the configure script uses awk, along with a number of
standard UNIX tools (cat, cp, grep, mv, rm, sed, among others). Almost
all installations will have these already.

Running the test harness (make test) uses:

bash
perl

Building Configure
==================

This step is only needed if configure.ac has been changed, or if configure
does not exist (for example, when building from a git clone). The
configure script and config.h.in can be built by running:

autoheader
autoconf

If you have a full GNU autotools install, you can alternatively run:

autoreconf

Warnings like "AC_CONFIG_SUBDIRS: you should use literals" can be ignored
or supressed using 'autoconf -Wno-syntax'.


Compilation
===========

'cd' to the bcftools-1.x directory containing the package's source and type
'make' to compile BCFtools.
'cd' to the bcftools directory containing the package's source and type:

./configure
make

This BCFtools release contains a copy of HTSlib which will be used to build
BCFtools. If you already have a system-installed HTSlib or another HTSlib
that you would prefer to build against, you can arrange this by overriding
$(HTSDIR) by typing 'make HTSDIR=/path/to/htslib-source' -- see the makefile
for details.
that you would prefer to build against, you can arrange this by using the
configure script's --with-htslib option. Use --with-htslib=DIR to point
to an HTSlib source tree or installation in DIR; or --with-htslib=system
to use a system-installed HTSlib.


Optional Compilation with GSL
=============================

The 'polysomy' command depends on the GNU Scientific Library (GSL) and is not
enabled by default. In order to compile it, type 'make clean && make USE_GPL=1'.
enabled by default. In order to compile it, supply the --enable-libgsl
option to configure before running make:

./configure --enable-libgsl

Note that GSL is distributed under a GPL license, so when USE_GPL=1 is used to
compile bcftools, the resulting program must only be distributed under terms
compatible with that license.
The GNU Scientific Library depends on the cblas library. The configure
script will look for both libcblas and libgslcblas, in that order. If
you have more than one version of cblas installed and want to override its
choice you can do this by using either --with-cblas=cblas or
--with-cblas=gslcblas.

Note that GSL is distributed under the GNU General Public License (GPL).
When --enable-libgsl is used to compile bcftools, the resulting program
will also be GPL licensed. If you want to distribute the program, you MUST
do so under terms compatible with that license. A copy of the GPL is included
in the LICENSE file, or can be downloaded from
<http://www.gnu.org/copyleft/gpl.html>.

In the default compilation mode the program is dual licensed and you may
choose to be licensed under the terms of the MIT/Expat license or the
GNU General Public License (GPL).

Information on the GNU Scientific Library, including the rationale for
its choice of license can be found at <https://www.gnu.org/software/gsl/>.

Installation
============

Type 'make install' to install the bcftools executable and associated scripts
and a manual page to /usr/local.
and a manual page. The default is to install in /usr/local. This can be
changed by using the configure script's --prefix option:

./configure --prefix=/path/to/install/dir

Type 'make prefix=/path/to/dir install' to install everything under your
choice of installation directory. The install target also understands
DESTDIR and the other usual installation directory variables.
The install target also understands DESTDIR and the other usual installation
directory variables.

The bgzip and tabix utilities are provided by HTSlib. If you have not also
installed HTSlib separately, you may wish to install these utilities by hand
Expand Down
Loading

0 comments on commit d595e63

Please sign in to comment.