Debian Codegraph @

documentation/userguide/install.tex

raw
1 \section{Installation}
2 \label{section:installation}
3 \setcounter{footnote}{0}
4
5 \subsection{Quick installation instructions}
6
7 Download \prog{infernal-1.1.5.tar.gz} from \url{http://eddylab.org/infernal/}, or
8 directly from \\
9 \url{eddylab.org/infernal/infernal-1.1.5.tar.gz};
10 unpack it, configure, and make:
11
12 \user{wget eddylab.org/infernal/infernal-1.1.5.tar.gz}\\
13 \user{tar xf infernal-1.1.5.tar.gz}\\
14 \user{cd infernal-1.1.5}\\
15 \user{./configure}\\
16 \user{make}
17
18 To compile and run a test suite to make sure all is well, you can
19 optionally do:
20
21 \user{make check}
22
23 All these tests should pass.
24
25 You don't have to install Infernal programs to run them. The newly
26 compiled binaries are now in the \prog{src} directory. You can run
27 them from there. To install the programs and man pages somewhere on
28 your system, do:
29
30 \user{make install}
31
32 By default, programs are installed in \prog{/usr/local/bin} and man
33 pages in \prog{/usr/local/share/man/man1/}. You can change the
34 \prog{/usr/local} prefix to any directory you want using the
35 \prog{./configure --prefix} option, as in \prog{./configure --prefix
36 /the/directory/you/want}.
37
38 Optionally, you can install the Easel library package as well,
39 including its various ``miniapplications'', in addition to its library
40 and header files. We don't do this by default, in case you already
41 have a copy of Easel separately installed:
42
43 \user{cd easel; make install}
44
45 That's it. You can keep reading if you want to know more about
46 customizing a Infernal installation, or you can skip ahead to the next
47 chapter, the tutorial.
48
49 \subsection{System requirements}
50
51 \paragraph{Operating system:} Infernal is designed for
52 POSIX-compatible platforms, including Linux, Mac OS/X, and various
53 UNIX OS's. The POSIX standard essentially includes all operating
54 systems except Microsoft Windows.\footnote{Windows 10 includes a Linux
55 subsystem that allows you to install a Linux OS inside Windows, with
56 a bash command shell, and this should work fine. For older Windows,
57 there are add-on products available for making Windows more
58 POSIX-compliant and more compatible with GNU-ish configures and
59 builds. One such product is Cygwin,
60 \url{http://www.cygwin.com}{www.cygwin.com}, which is freely
61 available.} We develop primarily on Mac OS/X and x86\_64/Linux
62 (both Intel and AMD), and we test releases on a wider range of
63 platforms.\footnote{Many thanks to the GCC Compile Farm Project for
64 providing access to some of the platforms that we use for testing.}
65
66 \paragraph{Processor:} Infernal depends on vector parallelization methods
67 in HMMER, which Infernal uses as a library, that are
68 processor-specific. Infernal supports three types of processors:
69 x86-compatible (Intel/AMD) processors (SSE2 and AVX instruction sets),
70 ARM processors such as new Macs (NEON instructions), and some PowerPC
71 systems (Altivec/VMX instructions, big-endian mode only).
72
73 SSE2 is supported on Intel processors from Pentium 4 on, and AMD
74 processors from K8 (Athlon 64) on; we believe this includes almost all
75 Intel processors since 2000 and AMD processors since 2003.
76
77 Altivec/VMX is supported on Motorola G4, IBM G5, and IBM PowerPC
78 processors starting with the Power6, which we believe includes almost
79 all PowerPC-based desktop systems since 1999 and servers since
80 2007.\footnote{If your platform does not support either of these
81 vector instruction sets -- or if you're on a ppc64le system that
82 supports VMX but in little-endian byte order -- the configure script
83 will stop with an error message.}
84
85 If your platform does not support one of these vector instruction
86 sets, you won't be able to install and run Infernal 1.1 on it.
87
88 We do aim to be portable to all modern processors. The acceleration
89 algorithms are designed to be portable despite their use of
90 specialized SIMD vector instructions. We hope to add support for the
91 Sun SPARC VIS instruction set, for example. We believe that the code
92 will be able to take advantage of GP-GPUs and FPGAs in the future.
93
94 \paragraph{Compiler:} The source code conforms to ANSI
95 C99 and POSIX standards. It should compile with any ANSI C99 compliant
96 compiler, including the freely available GNU C compiler \ccode{gcc}.
97 We test the code most frequently using the GNU \ccode{gcc}, Apple
98 \ccode{llvm/clang}, and Intel \ccode{icc} and \ccode{icx}
99 compilers.\footnote{On OS/X, if you're compiling the source, make sure
100 you have XCode installed so that you have a C compiler.}
101
102 We depend on IEEE754-compliant floating point math.\footnote{With one
103 highly technical exception; on x86-compatible CPUs, we deliberately
104 turn on a CPU mode called FTZ (flush-to-zero).} Most C compilers,
105 including gcc and clang, are IEEE754-compliant by default. \textbf{Do
106 not use their \ccode{\-\-fast-math} option.} The Intel compiler icc/icx
107 defaults to using an unsafe ``fast-math'' mode. If you want to use an
108 Intel compiler, you must turn on IEEE754 compliance with an option
109 such as \ccode{-fp-model strict}; for example, you could configure for
110 Intel icx with \ccode{./configure CC=icx CFLAGS='-O3 -fp-model=strict'}.
111
112 \paragraph{Libraries and other installation requirements:}
113 Infernal includes two software libraries, HMMER and Easel, which it
114 will automatically compile during its installation process. By
115 default, Infernal does not require any additional libraries to be
116 installed by you, other than standard ANSI C99 libraries that should
117 already be present on a system that can compile C code. Bundling HMMER
118 and Easel instead of making them separate installation requirements is
119 a deliberate design decision to simplify the installation
120 process.\footnote{If you install standalone HMMER (which also bundles
121 Easel), this may become an annoyance; you'll have multiple
122 instantiations of HMMER and Easel lying around. Unfortunately this
123 is necessary as Infernal requires the specific versions of HMMER and
124 Easel bundled within it. Also, the Easel API is not yet stable
125 enough to decouple it from the applications that use it.}
126
127 Configuration and compilation use several UNIX utilities. Although
128 these utilities are available on all UNIX/Linux/MacOS systems, old
129 versions may not support all the features the \ccode{./configure}
130 script and Makefiles are hoping to find. We aim to build on anything,
131 even old Ebay'ed junk, but if you have an old system, you may want to
132 hedge your bets and install up-to-date versions of GNU tools such as
133 GNU make and GNU grep.
134
135 Running the test suite (and some of our development tools, if you
136 delve deep into our codebase) requires Perl and Python3 to be
137 installed. If you don't have them (which should be rare), \ccode{make
138 check} won't work for you, but that's ok because \ccode{make} and
139 \ccode{make install} will still work fine.
140
141 Compiling the user guide itself (this document) does require
142 the additional tool \ccode{rman} to be installed.
143
144 \subsection{Multithreaded parallelization for multicores is the default}
145
146 The main workhorse Infernal programs \prog{cmalign},
147 \prog{cmcalibrate}, \prog{cmsearch} and \prog{cmscan} support
148 multicore parallelization using POSIX threads. By default, the
149 configure script will identify whether your platform supports POSIX
150 threads (almost all platforms do), and will automatically compile in
151 multithreading support.
152
153 To disable multithreading at compile time, compile from source with
154 the \ccode{--disable-threads} flag to \ccode{./configure}.
155 If you want to disable multithreading at compile time, recompile from
156
157 Multithreaded Infernal programs use master/worker parallelization, with
158 \ccode{<n>} worker threads and one master thread. When Infernal is run on
159 a machine with multiple available cores, the default number of worker
160 threads is four\footnote{Set by a compile-time configuration option,
161 \ccode{CMNCPU}, in \ccode{src/config.h.in}.}. You can control the
162 number of cores each Infernal process will use for computation with the
163 \ccode{--cpu <n>} command line option or the \ccode{INFERNAL\_NCPU}
164 environment variable.
165
166 If you specify \ccode{--cpu 0}, an Infernal program will run in
167 serial-only mode, with no threading. We use this in debugging when we
168 suspect something is awry with the parallel implementation, but it's
169 not something you'd generally want to do in your work. Even with a
170 single worker thread (\ccode{--cpu 1}), Infernal will be faster than
171 serial-only mode, because the master thread handles input and output.
172
173 If you are running Infernal on a cluster that enforces policy on the
174 number of cores a process can use, you may need to count both the
175 workers and the master: you may need to tell your cluster management
176 software that Infernal needs \ccode{<n>}+1 cores.
177
178 \subsection{MPI parallelization for clusters is optional}
179
180 The \prog{cmalign}, \prog{cmcalibrate}, \prog{cmsearch} and
181 \prog{cmscan} programs also support MPI (Message Passing Interface)
182 parallelization on clusters. To use MPI, you first need to have an
183 MPI library installed, such as OpenMPI (\url{www.open-mpi.org}).
184
185 MPI support is not enabled by default, and it is not compiled into the
186 precompiled binaries that we supply with Infernal. To enable MPI support
187 at compile time, give the \ccode{--enable-mpi} option to the
188 \ccode{./configure} command.
189
190 To use MPI parallelization, each program that has an MPI-parallel mode
191 has an \ccode{--mpi} command line option. This option activates a
192 master/worker parallelization mode. (Without the \ccode{--mpi} option,
193 if you run a program under \ccode{mpirun} on N nodes, you'll be
194 running N independent duplicate commands, not a single MPI-enabled
195 command. Don't do that.)
196
197 The MPI implementation for \prog{cmcalibrate} scales well up to 161
198 processors.\footnote{By default, \prog{cmcalibrate} searches 160
199 random sequences of length 10 Kb (1.6 total Mb), so there's no reason
200 to use more than 160 workers plus 1 master - unless you use the
201 \ccode{-L <x>} option to increase the total Mb searched (see the
202 \prog{cmcalibrate} man page for more information).} \prog{cmalign}
203 scales pretty well up to a couple hundred processors. \prog{cmsearch}
204 scales all right, but the scaling performance will vary on different
205 inputs\footnote{A database in which many high-scoring hits are
206 clustered in sequences or exist in many sequences with similar names
207 (that sort close together alphabetically) may show especially poor
208 scaling performance.} \prog{cmscan} scales poorly, and probably
209 shouldn't be used on more than tens of processors at most. Improving
210 MPI scaling is one of our goals.
211
212 \subsection{Using build directories}
213
214 The configuration and compilation process from source supports using
215 separate build directories, using the GNU-standard VPATH
216 mechanism. This allows you to maintain separate builds for different
217 processors or with different configuration/compilation options. All
218 you have to do is run the configure script from the directory you want
219 to be the root of your build directory. For example:
220
221 \user{mkdir my-infernal-build}\\
222 \user{cd my-infernal-build}\\
223 \user{/path/to/infernal/configure}\\
224 \user{make}
225
226 This assumes you have a \ccode{make} that supports VPATH. If your
227 system's \ccode{make} does not, you can always install GNU make.
228
229 \subsection{Makefile targets}
230
231 \begin{sreitems}{\emprog{distclean}}
232
233 \item[\emprog{all}]
234 Builds everything. Same as just saying \ccode{make}.
235
236 \item[\emprog{check}]
237 Runs automated test suites in Infernal, and the HMMER and Easel
238 libraries.
239
240 \item[\emprog{pdf}]
241 Compiles this user guide.
242
243 \item[\emprog{install}]
244 Installs programs and man pages.
245
246 \item[\emprog{uninstall}]
247 Removes programs and man pages from where \ccode{make install} put them.
248
249 \item[\emprog{clean}]
250 Removes all files generated by compilation (by
251 \ccode{make}). Configuration (files generated by
252 \ccode{./configure}) is preserved.
253
254 \item[\emprog{distclean}]
255 Removes all files generated by configuration (by \ccode{./configure})
256 and by compilation (by \ccode{make}).
257
258 Note that if you want to make a new configuration (for example, to
259 try an MPI version by \ccode{./configure --enable-mpi; make}) you
260 should do a \ccode{make distclean} (rather than a \ccode{make
261 clean}), to be sure old configuration files aren't used
262 accidentally.
263 \end{sreitems}
264
265 \subsection{What gets installed by 'make install', and where?}
266
267 Infernal's 'make install' generally follows the GNU Coding Standards
268 and the Filesystem Hierarchy Standard. The top-level Makefile has
269 variables that specify three directories where \ccode{make install}
270 will install things:
271
272 \begin{tabular}{ll}
273 Variable & What \\ \hline
274 \ccode{bindir} & All Infernal programs \\
275 \ccode{man1dir} & All Infernal man pages \\
276 \ccode{pdfdir} & \ccode{Userguide.pdf} \\ \hline
277 \end{tabular}
278
279 These variables are constructed from some other variables, in
280 accordance with the GNU Coding Standards. All of these variables are
281 at the top of the top-level Makefile. Their defaults are as follows:
282
283 \begin{tabular}{ll}
284 Variable & Default \\ \hline
285 \ccode{prefix} & \ccode{/usr/local} \\
286 \ccode{exec\_prefix} & \ccode{\${prefix}} \\
287 \ccode{bindir} & \ccode{\${exec\_prefix}/bin}\\
288 \ccode{libdir} & \ccode{\${exec\_prefix}/lib}\\
289 \ccode{includedir} & \ccode{\${prefix}/include} \\
290 \ccode{datarootdir} & \ccode{\${prefix}/share} \\
291 \ccode{mandir} & \ccode{\${datarootdir}/man} \\
292 \ccode{man1dir} & \ccode{\${mandir}/man1} \\ \hline
293 \end{tabular}
294
295 The best way to change these defaults is when you use
296 \ccode{./configure}, and the most important variable to consider
297 changing is \ccode{--prefix}. For example, if you want to install
298 Infernal in a directory hierarchy all of its own, you might want to do
299 something like:
300
301 \user{./configure --prefix /usr/local/infernal}
302
303 That would keep Infernal out of your system-wide directories like
304 \ccode{/usr/local/bin}, which might be desirable. Of course, if you do
305 it that way, you'd also want to add \ccode{/usr/local/infernal/bin} to
306 your \ccode{\$PATH}, \ccode{/usr/local/infernal/share/man} to your
307 \ccode{\$MANPATH}, etc.
308
309 These variables only affect \ccode{make install}. Infernal executables
310 have no pathnames compiled into them.
311
312 \subsection{Seeing more output from 'make'}
313
314 By default, our \ccode{make} hides what's really going on with the
315 compilation with a pretty wrapper that we stole from the source for
316 \ccode{git}. If you want to see what the command lines really look like
317 in all their ugly glory, pass a \ccode{V=1} option (V for ``verbose'')
318 to \ccode{make}, as in:
319
320 \vspace{1ex}
321 \user{make V=1}
322 \vspace{1ex}
323
324 \subsection{Staged installations in a buildroot, for a packaging system}
325
326 Infernal's \ccode{make install} supports staged installations, accepting
327 the traditional \ccode{DESTDIR} variable that packagers use to specify
328 a buildroot. For example, you can do:
329
330 \user{make DESTDIR=/rpm/tmp/buildroot install}
331
332 \subsection{Workarounds for some unusual configure/compilation problems}
333
334 \paragraph{Configuration or compilation fails when trying to use a
335 separate build directory.} If you try to build in a build tree
336 (other than the source tree) and you have any trouble in configuration
337 or compilation, try just building in the source tree instead. Some
338 \ccode{make} versions don't support the VPATH mechanism needed to use
339 separate build trees. Another workaround is to install GNU make.
340
341 \paragraph{Configuration fails, complaining ``no acceptable grep could
342 be found''.} We've seen this happen on our Sun Sparc/Solaris
343 machine. It's a known issue in GNU autoconf. You can either install
344 GNU grep, or you can insist to \ccode{./configure} that the Solaris
345 grep (or whatever grep you have) is ok by explicitly setting
346 \ccode{GREP}:
347
348 \user{./configure GREP=/usr/xpg4/bin/grep}
349
350 \paragraph{Many 'make check' tests fail.} We have one report of a
351 system that failed to link multithread-capable system C libraries
352 correctly, and instead linked to one or more serial-only
353 libraries.\footnote{The telltale phenotype of this failure is to
354 configure with debugging flags on and recompile, run one of the
355 failed unit test drivers (such as \ccode{easel/easel\_utest})
356 yourself and let it dump core; and use a debugger to examine the
357 stack trace in the core. If it's failed in
358 \ccode{\_\_errno\_location()}, it's linked a non-thread-capable
359 system C library.} We've been unable to reproduce the problem here,
360 and are not sure what could cause it -- we optimistically believe it's
361 a messed-up system instead of our fault. If it does happen, it screws
362 all kinds of things up with the multithreaded implementation. A
363 workaround is to shut threading off:
364
365 \user{./configure --disable-threads}
366
367 This will compile code that won't parallelize across multiple cores,
368 of course, but it will still work fine on a single processor at a time
369 (and MPI, if you build with MPI enabled).
370