deal with flaky ELM tests; if there are additional issues we may deprecate this module
[bioperl-live.git] / INSTALL.md
blobef5c3f7d0d9d9bf64ccb3348ac15384d8deac1df
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 # Using BioPerl via Docker
12 If you don't have Docker installed already, instructions for [how to install Docker] on Linux, MacOSX, and Windows are available online.
14 We officially support several builds (latest, stable, and releases)
15 hosted in the [bioperl/bioperl] repo on Docker Hub. These images do not
16 have a pre-defined entrypoint. If you have a BioPerl script in the
17 current directory, you can run it as simple as this:
19 ```
20 docker run -t --rm -v `pwd`:/work -w /work bioperl/bioperl perl my-script.pl
21 ```
23 Or run an interactive shell:
25 ```
26 docker run -ti --rm -v `pwd`:/work -w /work bioperl/bioperl bash
27 ```
29 You can also build your own Docker image of BioPerl, using the same
30 base image and pre-built dependencies that we use. Simply build off of
31 the [bioperl/bioperl-deps] image.
33 # Installing BioPerl locally
35 Note that this documentation is for Unix, Linux, and MacOSX. For installing BioPerl on Windows, please read INSTALL.WIN.
37 ## System Requirments
39  * `Perl 5.6.1 or higher` Version 5.10 or higher is highly
40    recommended. Modules are tested against version 5.14 and
41    above.
42  * `make` For Mac OS X, this requires installing the Xcode Developer 
43    Tools.
45 ## Preliminary Preparation
47 These are optional, but regardless of your subsequent choice of
48 installation method, it will help to carry out the following steps.
49 They will increase the likelihood of installation success
50 (especially of the optional dependencies).
52 * Upgrade CPAN:
54 ```
55 perl -MCPAN -e shell
56 ```
58 * Install or upgrade `Module::Build`, and make it your preferred installer:
60 ```
61 cpan>install Module::Build
62 cpan>o conf prefer_installer MB
63 cpan>o conf commit
64 ```
66 * Install the `expat` library by whatever method is appropriate for your system (e.g. `apt`, `yum`, `homebrew`).
68 ## Installing BioPerl the Easy Way
70 We highly recommend using
71 [cpanminus](https://metacpan.org/pod/distribution/App-cpanminus/bin/cpanm) for
72 installing BioPerl and its dependencies. We also highly recommend (if possible)
73 using a tool like [perlbrew](https://perlbrew.pl) to locally install a modern
74 version of perl (a version that is higher than perl 5.16).  The linked
75 pages describe how to install each tool; make sure if you install perlbrew that
76 you follow up with installing `cpanm`:
78 ```
79 perlbrew install-cpanm
80 ```
82 Then, you can install BioPerl:
84 ```
85 cpanm Bio::Perl
86 ```
88 You can also use the older CPAN shell to install BioPerl. For example:
90 ```
91 perl -MCPAN -e shell
92 ```
94 Or you might have the `cpan` alias installed:
96 ```
97 cpan
98 ```
100 Then find the name of the latest BioPerl package:
103 cpan>d /bioperl/
104  ....
106  Distribution    CJFIELDS/BioPerl-1.6.901.tar.gz
107  Distribution    CJFIELDS/BioPerl-1.6.922.tar.gz
108  Distribution    CJFIELDS/BioPerl-1.6.924.tar.gz
111 And install the most recent:
114 cpan>install CJFIELDS/BioPerl-1.6.924.tar.gz
117 If you've installed everything perfectly and all the network
118 connections are working then you will pass all the tests run in the
119 `./Build test` phase. Sometimes you may see a failed test. Remember that 
120 there are over 900 modules in BioPerl and the test suite is running more 
121 than 12000 individual tests, a failed test may not affect your usage 
122 of BioPerl.
124 If there's a failed test and you think that the failed test will not 
125 affect how you intend to use BioPerl then do:
128 cpan>force install C/CJ/CJFIELDS/BioPerl-1.6.923.tar.gz
131 If you're concerned about a failed test and need assistance or advice
132 then contact bioperl-l@bioperl.org, and provide us the detailed
133 results of the failed install.
135 ## Installing BioPerl from Github
137 **NOTE:** We generally do not recommend installing the latest code from Github
138 unless you absolutely need the latest bug fixes. 
140 The very latest version of Bioperl is at github.com. If you want this 
141 version then download it from https://github.com/bioperl/bioperl-live as a
142 `tar.gz` or `zip` file, or retrieve it using the command line:
145 git clone https://github.com/bioperl/bioperl-live.git
146 cd bioperl-live
149 ### Using cpanm
151 If you have `cpanm`, you can install within the checkout directory by simply using:
154 cpanm --interactive .
157 to run interative installation, or you can leave out the `--interactive` flag to accept the defaults.
159 ### Using the Installation Script
161 Issue the build commands:
164 perl Build.PL
167 You will be asked a few questions about installing BioPerl scripts
168 and running various test suites, hit `return` to accept the defaults.
170 Test:
173 ./Build test
176 Install:
179 ./Build install
182 You may need root permissions in order to run `./Build install`, so you 
183 will want to talk to your systems manager if you don't have the necessary
184 privileges. Or you can install the package in your own home
185 directory, see INSTALLING BIOPERL USING `local::lib`.
187 ## Installing Bioperl using `local::lib`
189 If you lack permission to install Perl modules into the standard
190 system directories you can install them in your home directory
191 using [local::lib](https://metacpan.org/pod/local::lib). The instructions for first installing
192 `local::lib` are found in the link.
194 Once `local::lib` is installed you can install BioPerl using a 
195 command like this:
198 perl -MCPAN -Mlocal::lib -e 'CPAN::install(C/CJ/CJFIELDS/BioPerl-1.6.924.tar.gz)'
201 ## Installing BioPerl Scripts
203 BioPerl comes with a set of production-quality scripts that are
204 kept in the scripts/ directory. You can install these scripts if you'd
205 like, simply answer the questions during `perl Build.PL`.
206 The installation directory can be specified by:
209 perl Build.PL ./Build install --install_path script=/foo/scripts
212 By default they install to `/usr/bin` or similar, depending on platform.
214 ## The Test System
216 The BioPerl test system is located in the `t/` directory and is
217 automatically run whenever you execute the `./Build test` command.
219 The tests have been organized into groups
220 based upon the specific task or class the module being tested belongs
221 to. If you want to investigate the behavior of a specific test such as
222 the Seq test you would type:
225 ./Build test --test_files t/Seq/Seq.t --verbose
228 The `--test_files` argument can be used multiple times to try a set of test 
229 scripts in one go. The `--verbose` arguement outputs the detailed test results, instead of just the summary you see during `./Build test`.
231 The `--test-files` argument can also work as a glob. For instance, to run tests on all SearchIO modules, use the following:
234 ./Build test --test_files t/SearchIO* --verbose
237 You can also use the command-line tool `prove` to run tests as well, which
238 is quite useful if you are developing code:
241 prove -lrv t/SearchIO* 
244 If you are trying to learn how to use a module, often the test suite
245 is a good place to look. All good extreme programmers try and write a
246 test BEFORE they write the module to insure that their module behaves
247 the way they expect. You'll notice some `ok` and `skip` commands in a
248 test, this is part of the Perl test suite that signifies a passed test
249 with an 'ok N', where N is the test number. Alternatively you can tell
250 Perl to skip tests. This is useful when, for example, your test
251 detects that the network is not present and thus should skip, not
252 fail, any tests that require a network connection.
254 The core developers have indicated that future releases of BioPerl
255 will require that new modules come with a test suite with some minimal
256 tests.  Modules that lack adequate tests or could otherwise be
257 considered 'unstable' will be moved into a separate developer
258 distribution until adequate tests are added and the API stablizes.
260 [how to install Docker]: https://docs.docker.com/engine/installation/
261 [bioperl/bioperl]: https://hub.docker.com/r/bioperl/bioperl/
262 [bioperl/bioperl-deps]: https://hub.docker.com/r/bioperl/bioperl-deps/