-
Notifications
You must be signed in to change notification settings - Fork 240
/
INSTALL
270 lines (187 loc) · 9.34 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
For the impatient
=================
The latest source code can be downloaded from github and compiled using:
git clone --recurse-submodules https://github.com/samtools/htslib.git
git clone https://github.com/samtools/bcftools.git
cd bcftools
# The following is optional:
# autoheader && autoconf && ./configure --enable-libgsl --enable-perl-filters
make
IMPORTANT:
---
In order to use the BCFtools plugins, this environment variable must be set and point
to the correct location
export BCFTOOLS_PLUGINS=/path/to/bcftools/plugins
---
Note that if also the polysomy command or support for Perl filtering should be included,
the compilation instructions differ, see Optional Compilation with GSL and Optional
Compilation with Perl below.
System Requirements
===================
BCFtools and HTSlib depend on the following libraries:
BCFtools:
zlib <http://zlib.net>
gsl <https://www.gnu.org/software/gsl/>
(optional, for the 'polysomy' command)
libperl <http://www.perl.org/>
(optional, to support filters using perl syntax)
HTSlib:
zlib <http://zlib.net>
libbz2 <http://bzip.org/>
liblzma <http://tukaani.org/xz/>
libcurl <https://curl.haxx.se/>
(optional but strongly recommended, for network access)
libcrypto <https://www.openssl.org/>
(optional, for Amazon S3 support; not needed on MacOS)
Building them requires development files to be installed on the build machine;
note that MacOS and some Linux distributions package these separately from the
library itself. See the "System Specific Details" below for guidance on how to
install these on a variety of systems.
The bzip2 and liblzma dependencies can be removed if full CRAM support
is not needed - see HTSlib's INSTALL file for details.
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 suppressed using 'autoconf -Wno-syntax'.
Compilation
===========
'cd' to the bcftools directory containing the package's source and type:
./configure
make
If installing from a release (as opposed to from GitHub), the BCFtools release
tarball 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 using the configure script's
--with-htslib option. Use --with-htslib=DIR to point to an HTSlib source tree
or installation in DIR (if the desired source tree has been configured to
build in a separate build directory, DIR should refer to the build directory);
or use --with-htslib=system to ignore any nearby HTSlib source tree and use
only a system-installed HTSlib.
When --with-htslib is not used, configure looks for an HTSlib source tree
within or alongside the BCFtools source directory; if there are several
likely candidates, you will have to use --with-htslib to choose one. When
using make without running configure first, the directory ../htslib is used.
Optional Compilation with Perl
==============================
The '-i' and '-e' options can take external perl scripts for a more
sophisticated filtering. This option can be enabled by supplying the
--enable-perl-filters option to configure before running make:
./configure --enable-perl-filters
Note that enabling this option changes the license from MIT to GPL because bcftools
need to be built with
perl -MExtUtils::Embed -e ccopts -e ldopts
Note that when compiling on MacOS, the default options for linking with Perl
provided by the system sometimes do not work. It was reported that removing
the occurrence of -arch i386 from config.mk solved the problem.
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, supply the --enable-libgsl
option to configure before running make:
./configure --enable-libgsl
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. 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
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
by copying bcftools-1.x/htslib-1.x/{bgzip,tabix} to the same bin directory
to which you have installed bcftools et al.
System Specific Details
=======================
Installing the prerequisites is system dependent and there is more
than one correct way of satisfying these, including downloading them
from source, compiling and installing them yourself.
For people with super-user access, we provide an example set of commands
below for installing the dependencies on a variety of operating system
distributions. Note these are not specific recommendations on distribution,
compiler or SSL implementation. It is assumed you already have the core set
of packages for the given distribution - the lists may be incomplete if
this is not the case.
Intel Compiler
--------------
At some optimisation levels the Intel compiler may use approximate
floating point mathematics. We do not believe this to produce
substantially erroneous results, but it can cause the test harness to
fail due to minor fluctuations in the least significiant digits. If
you wish to use icc with the test harness, it is recommended you use
the "-fp-model precise" icc option.
Debian / Ubuntu
---------------
sudo apt-get update # Ensure the package list is up to date
sudo apt-get install autoconf automake make gcc perl zlib1g-dev libbz2-dev liblzma-dev libcurl4-gnutls-dev libssl-dev libperl-dev libgsl0-dev
Note: libcurl4-openssl-dev can be used as an alternative to libcurl4-gnutls-dev.
RedHat / CentOS
---------------
Note: To install gsl-devel, it may be necessary to enable the "crb" repository.
dnf --enablerepo=crb install gsl-devel
sudo yum install autoconf automake make gcc perl-Data-Dumper zlib-devel bzip2 bzip2-devel xz-devel curl-devel openssl-devel gsl-devel perl-ExtUtils-Embed
Note: On some versions, Perl FindBin will need to be installed to make the tests work.
sudo yum install perl-FindBin
Alpine Linux
------------
Note: To install gsl-dev, it may be necessary to enable the "community"
repository in /etc/apk/repositories.
Note: some older Alpine versions use libressl-dev rather than openssl-dev.
doas apk update # Ensure the package list is up to date
doas apk add autoconf automake make gcc musl-dev perl bash zlib-dev bzip2-dev xz-dev curl-dev openssl-dev gsl-dev perl-dev
OpenSUSE
--------
sudo zypper install autoconf automake make gcc perl zlib-devel libbz2-devel xz-devel libcurl-devel libopenssl-devel gsl-devel
MacOS, assuming Xcode is installed:
-----
xz
gsl (optional)
Windows MSYS2/MINGW64
---------------------
The configure script must be used as without it the compilation will
likely fail.
Follow MSYS2 installation instructions at
https://www.msys2.org/wiki/MSYS2-installation/
Then relaunch to MSYS2 shell using the "MSYS2 MinGW x64" executable.
Once in that environment (check $MSYSTEM equals "MINGW64") install the
compilers using pacman -S and the following package list:
base-devel mingw-w64-x86_64-toolchain
mingw-w64-x86_64-libdeflate mingw-w64-x86_64-zlib mingw-w64-x86_64-bzip2
mingw-w64-x86_64-xz mingw-w64-x86_64-curl mingw-w64-x86_64-autotools
mingw-w64-x86_64-tools-git
(The last is only needed for building libraries compatible with MSVC.)