forked from samtools/samtools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
236 lines (170 loc) · 9.05 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
System Requirements
===================
Samtools and HTSlib depend on the following libraries:
Samtools:
zlib <http://zlib.net>
curses or GNU ncurses (optional, for the 'tview' command)
<http://www.gnu.org/software/ncurses/>
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)
See the "System Specific Details" below for guidance on how to install
these.
The bzip2 and liblzma dependencies can be removed if full CRAM support
is not needed - see HTSlib's INSTALL file for details.
The following programs are required:
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
If you are unsure about this, be sure to use './configure' to determine
whether you have these libraries and to help diagnose which packages may
need to be installed on your build machine to provide them.
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 -Wno-syntax
If you have a full GNU autotools install, you can alternatively run:
autoreconf
When running these tools, you may see warnings about AC_CONFIG_SUBDIRS.
These are expected, and should be ignored.
Basic Installation
==================
To build and install Samtools, 'cd' to the samtools-1.x directory containing
the package's source and type the following commands:
./configure
make
make install
The './configure' command checks your build environment and allows various
optional functionality to be enabled (see Configuration below). If you
don't want to select any optional functionality, you may wish to omit
configure and just type 'make; make install' as for previous versions
of samtools. However if the build fails you should run './configure'
as it can diagnose the common reasons for build failures.
The 'make' command builds samtools and various miscellaneous utilities.
If compilation fails you should run './configure' as it can diagnose
problems with your build environment that cause build failures.
(The bgzip, htsfile, and tabix utilities are provided by HTSlib. If you are
not also compiling HTSlib separately, you may wish to compile these utilities
in the associated copy of HTSlib. Type 'make all all-htslib' to do this.)
The 'make install' command installs the samtools executable and various
scripts and executables from misc/ and a manual page to /usr/local.
The installation location can be changed by configuring with --prefix=DIR
or via 'make prefix=DIR install' (see Installation Locations below).
(If you have not also installed HTSlib separately, you may wish to install
the bgzip, htsfile, and tabix utilities from the associated copy of HTSlib.
Type 'make install install-htslib' to do this.)
Typically you will want to enable HTSlib's HTTPS/etc plugin etc.
See README for recipes for typical installation.
Configuration
=============
By default, './configure' examines your build environment, searching for a
usable HTSlib and checking for requirements such as the curses development
files, and arranges for a plain samtools build.
This samtools release contains a copy of the HTSlib source code which will
be used to build samtools. If you already have a system-installed HTSlib
or another HTSlib that you would prefer to build against, you can arrange
this via the --with-htslib option.
The following configure options can be used to enable various features and
specify further optional external requirements:
--with-htslib=DIR
Specifies the HTSlib source tree or installation directory that samtools
should use to parse bioinformatics file formats etc. Configure will check
that DIR appears to contain HTSlib source files or to be the root of an
installation directory (i.e., it has 'include' and 'lib' subdirectories
containing HTSlib headers and libraries).
(If the desired HTSlib source tree has been configured to build in a
separate build directory, DIR should refer to the build directory.)
By default, configure looks for an HTSlib source tree within or alongside
the samtools source directory; if there are several likely candidates,
you will have to choose one via this option.
--with-htslib=system
Ignores any nearby HTSlib source trees, and builds samtools using an
existing HTSlib installation in a system directory (i.e., a directory
already being searched by $CPPFLAGS/$LDFLAGS).
--without-curses
Omit the curses-based 'tview' subcommand from the build. If you do not
have curses on your build machine or otherwise don't want the interactive
tview subcommand, this option disables it and skips testing for working
curses development files.
--enable-configure-htslib
When building with an HTSlib source tree, run HTSlib's configure script
as well. HTSlib configure options can also be used and will be
passed down to the HTSlib configure. See HTSlib's INSTALL documentation
for details of these options.
If you are building with HTSlib source in a subdirectory of the samtools
tree, --enable-configure-htslib is turned on by default and the HTSlib
configure script will be run automatically. This is the case for the
samtools release tar archives which include an embedded copy of HTSlib.
The configure script also accepts the usual options and environment variables
for tuning installation locations and compilers: type './configure --help'
for details. For example,
./configure CC=icc --prefix=/opt/icc-compiled
would specify that samtools is to be built with icc and installed into bin,
lib, etc subdirectories under /opt/icc-compiled.
If dependencies have been installed in non-standard locations (i.e. not on
the normal include and library search paths) then the CPPFLAGS and LDFLAGS
environment variables can be used to set the options needed to find them.
For example, NetBSD users may use:
./configure CPPFLAGS=-I/usr/pkg/include \
LDFLAGS='-L/usr/pkg/lib -Wl,-R/usr/pkg/lib'
to allow compiling and linking against dependencies installed via the ports
collection.
Installation Locations
======================
By default, 'make install' installs samtools and the utilities under
/usr/local/bin and manual pages under /usr/local/share/man.
You can specify a different location to install Samtools by configuring
with --prefix=DIR or specify locations for particular parts of HTSlib by
configuring with --bindir=DIR and so on. Type './configure --help' for
the full list of such install directory options.
Alternatively you can specify different locations at install time by
typing 'make prefix=DIR install' or 'make bindir=DIR install' and so on.
Consult the list of prefix/exec_prefix/etc variables near the top of the
Makefile for the full list of such variables that can be overridden.
You can also specify a staging area by typing 'make DESTDIR=DIR install',
possibly in conjunction with other --prefix or prefix=DIR settings.
For example,
make DESTDIR=/tmp/staging prefix=/opt
would install into bin and share/man subdirectories under /tmp/staging/opt.
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.
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 libncurses5-dev
Note: libcurl4-openssl-dev can be used as an alternative to libcurl4-gnutls-dev.
RedHat / CentOS
---------------
sudo yum install autoconf automake make gcc perl-Data-Dumper zlib-devel bzip2 bzip2-devel xz-devel curl-devel openssl-devel ncurses-devel
Alpine Linux
------------
sudo apk update # Ensure the package list is up to date
sudo apk add autoconf automake make gcc musl-dev perl bash zlib-dev bzip2-dev xz-dev curl-dev libressl-dev ncurses-dev
OpenSUSE
--------
sudo zypper install autoconf automake make gcc perl zlib-devel libbz2-devel xz-devel libcurl-devel libopenssl-devel ncurses-devel