Travis CI: Add Test::Most dependency
[bioperl-live.git] / INSTALL.md
blob856a7119ae68643a4394397e7b8c88104e8d8ead
1 # BioPerl Installation
3 There are two principle ways to get BioPerl onto your system. One (and
4 the still most common) is to install it locally on your machine. To do
5 this, refer to and follow the instructions below for installing BioPerl on
6 Unix, Linux, and Mac OS X. For installing BioPerl on Windows, please
7 read INSTALL.WIN. The other way is to use a Docker image with a
8 BioPerl build, whether one we support or one you build yourself.
10 # Installing BioPerl locally
12 Note that this documentation is for Unix, Linux, and MacOSX. For installing BioPerl on Windows, please read INSTALL.WIN.
14 ## System Requirments
16  * `Perl 5.6.1 or higher` Version 5.10 or higher is highly
17    recommended. Modules are tested against version 5.14 and
18    above.
19  * `make` For Mac OS X, this requires installing the Xcode Developer
20    Tools.
22 ## Preliminary Preparation
24 These are optional, but regardless of your subsequent choice of
25 installation method, it will help to carry out the following steps.
26 They will increase the likelihood of installation success
27 (especially of the optional dependencies).
29 * Upgrade CPAN:
31 ```
32 perl -MCPAN -e shell
33 ```
35 * Install or upgrade `Module::Build`, and make it your preferred installer:
37 ```
38 cpan>install Module::Build
39 cpan>o conf prefer_installer MB
40 cpan>o conf commit
41 ```
43 * Install the `expat` library by whatever method is appropriate for your system (e.g. `apt`, `yum`, `homebrew`).
45 ## Installing BioPerl the Easy Way
47 We highly recommend using
48 [cpanminus](https://metacpan.org/pod/distribution/App-cpanminus/bin/cpanm) for
49 installing BioPerl and its dependencies. We also highly recommend (if possible)
50 using a tool like [perlbrew](https://perlbrew.pl) to locally install a modern
51 version of perl (a version that is higher than perl 5.16).  The linked
52 pages describe how to install each tool; make sure if you install perlbrew that
53 you follow up with installing `cpanm`:
55 ```
56 perlbrew install-cpanm
57 ```
59 Then, you can install BioPerl:
61 ```
62 cpanm Bio::Perl
63 ```
65 You can also use the older CPAN shell to install BioPerl. For example:
67 ```
68 perl -MCPAN -e shell
69 ```
71 Or you might have the `cpan` alias installed:
73 ```
74 cpan
75 ```
77 Then find the name of the latest BioPerl package:
79 ```
80 cpan>d /bioperl/
81  ....
83  Distribution    C/CJ/CJFIELDS/BioPerl-1.007001.tar.gz
84  Distribution    C/CJ/CJFIELDS/BioPerl-1.007001.tar.gz
85  Distribution    C/CJ/CJFIELDS/BioPerl-1.007001.tar.gz
86 ```
88 And install the most recent:
90 ```
91 cpan>install C/CJ/CJFIELDS/BioPerl-1.007001.tar.gz
92 ```
94 If you've installed everything perfectly and all the network
95 connections are working then you will pass all the tests run in the
96 `./Build test` phase. Sometimes you may see a failed test. Remember that
97 there are over 900 modules in BioPerl and the test suite is running more
98 than 12000 individual tests, a failed test may not affect your usage
99 of BioPerl.
101 If there's a failed test and you think that the failed test will not
102 affect how you intend to use BioPerl then do:
105 cpan>force install C/CJ/CJFIELDS/BioPerl-1.007001.tar.gz
108 If you're concerned about a failed test and need assistance or advice
109 then contact bioperl-l@bioperl.org, and provide us the detailed
110 results of the failed install.
112 ## Installing BioPerl from Github
114 **NOTE:** We generally do not recommend installing the latest code from Github
115 unless you absolutely need the latest bug fixes.
117 The very latest version of Bioperl is at github.com. If you want this
118 version then download it from https://github.com/bioperl/bioperl-live as a
119 `tar.gz` or `zip` file, or retrieve it using the command line:
122 git clone https://github.com/bioperl/bioperl-live.git
123 cd bioperl-live
126 ### Using cpanm
128 If you have `cpanm`, you can install within the checkout directory by simply using:
131 cpanm --interactive .
134 to run interative installation, or you can leave out the `--interactive` flag to accept the defaults.
136 ### Using the Installation Script
138 Issue the build commands:
141 perl Build.PL
144 You will be asked a few questions about installing BioPerl scripts
145 and running various test suites, hit `return` to accept the defaults.
147 Test:
150 ./Build test
153 Install:
156 ./Build install
159 You may need root permissions in order to run `./Build install`, so you
160 will want to talk to your systems manager if you don't have the necessary
161 privileges. Or you can install the package in your own home
162 directory, see INSTALLING BIOPERL USING `local::lib`.
164 ## Installing Bioperl using `local::lib`
166 If you lack permission to install Perl modules into the standard
167 system directories you can install them in your home directory
168 using [local::lib](https://metacpan.org/pod/local::lib). The instructions for first installing
169 `local::lib` are found in the link.
171 Once `local::lib` is installed you can install BioPerl using a
172 command like this:
175 perl -MCPAN -Mlocal::lib -e 'CPAN::install(C/CJ/CJFIELDS/BioPerl-1.007001.tar.gz)'
178 ## Installing BioPerl Scripts
180 BioPerl comes with a set of production-quality scripts that are
181 kept in the scripts/ directory. You can install these scripts if you'd
182 like, simply answer the questions during `perl Build.PL`.
183 The installation directory can be specified by:
186 perl Build.PL ./Build install --install_path script=/foo/scripts
189 By default they install to `/usr/bin` or similar, depending on platform.
191 ## The Test System
193 The BioPerl test system is located in the `t/` directory and is
194 automatically run whenever you execute the `./Build test` command.
196 The tests have been organized into groups
197 based upon the specific task or class the module being tested belongs
198 to. If you want to investigate the behavior of a specific test such as
199 the Seq test you would type:
202 ./Build test --test_files t/Seq/Seq.t --verbose
205 The `--test_files` argument can be used multiple times to try a set of test
206 scripts in one go. The `--verbose` arguement outputs the detailed test results, instead of just the summary you see during `./Build test`.
208 The `--test-files` argument can also work as a glob. For instance, to run tests on all SearchIO modules, use the following:
211 ./Build test --test_files t/SearchIO* --verbose
214 You can also use the command-line tool `prove` to run tests as well, which
215 is quite useful if you are developing code:
218 prove -lrv t/SearchIO*
221 If you are trying to learn how to use a module, often the test suite
222 is a good place to look. All good extreme programmers try and write a
223 test BEFORE they write the module to insure that their module behaves
224 the way they expect. You'll notice some `ok` and `skip` commands in a
225 test, this is part of the Perl test suite that signifies a passed test
226 with an 'ok N', where N is the test number. Alternatively you can tell
227 Perl to skip tests. This is useful when, for example, your test
228 detects that the network is not present and thus should skip, not
229 fail, any tests that require a network connection.
231 The core developers have indicated that future releases of BioPerl
232 will require that new modules come with a test suite with some minimal
233 tests.  Modules that lack adequate tests or could otherwise be
234 considered 'unstable' will be moved into a separate developer
235 distribution until adequate tests are added and the API stablizes.
237 [how to install Docker]: https://docs.docker.com/engine/installation/
238 [bioperl/bioperl]: https://hub.docker.com/r/bioperl/bioperl/
239 [bioperl/bioperl-deps]: https://hub.docker.com/r/bioperl/bioperl-deps/
241 # Using BioPerl via Docker
243 If you don't have Docker installed already, instructions for [how to install Docker] on Linux, MacOSX, and Windows are available online.
245 We officially support several builds (latest, stable, and releases)
246 hosted in the [bioperl/bioperl] repo on Docker Hub. These images do not
247 have a pre-defined entrypoint. If you have a BioPerl script in the
248 current directory, you can run it as simple as this:
251 docker run -t --rm -v `pwd`:/work -w /work bioperl/bioperl perl my-script.pl
254 Or run an interactive shell:
257 docker run -ti --rm -v `pwd`:/work -w /work bioperl/bioperl bash
260 You can also build your own Docker image of BioPerl, using the same
261 base image and pre-built dependencies that we use. Simply build off of
262 the [bioperl/bioperl-deps] image.