Add tests for memory leaks and weaken for Issue #81
[bioperl-live.git] / INSTALL
blob89c3d06aedbc76faf80e838d91e2abfffa6027ef
1 Installing BioPerl for Unix
3      * 1 BIOPERL INSTALLATION
4      * 2 SYSTEM REQUIREMENTS
5      * 3 OPTIONAL
6      * 4 ADDITIONAL INSTALLATION INFORMATION
7      * 5 PRELIMINARY PREPARATION
8      * 6 INSTALLING BIOPERL THE EASY WAY USING Build.PL
9      * 7 INSTALLING BIOPERL THE EASY WAY USING CPAN
10      * 8 WHERE ARE THE MAN PAGES?
11      * 9 EXTERNAL PROGRAMS
12           * 9.1 Environment Variables
13      * 10 INSTALLING BIOPERL SCRIPTS
14      * 11 INSTALLING BIOPERL IN A PERSONAL MODULE AREA
15      * 12 INSTALLING BIOPERL MODULES THE HARD WAY
16      * 13 USING MODULES NOT INSTALLED IN THE STANDARD LOCATION
17      * 14 THE TEST SYSTEM
18      * 15 BUILDING THE OPTIONAL bioperl-ext PACKAGE
19           * 16.1 CONFIGURING for BSD and Solaris boxes
20           * 16.2 INSTALLATION
22 BIOPERL INSTALLATION
24 For the most up-to-date installation instructions please see the
25 BioPerl wiki:
27   http://www.bioperl.org/wiki/Installing_BioPerl
29 BioPerl has been installed on many forms of Unix, Win9X/NT/2000/XP,
30 and on Mac OS X. The following are instructions for installing BioPerl 
31 for Unix/Linux/Mac OS X. Windows installation instructions can be found 
32 in INSTALL.WIN. For installing BioPerl for Mac OS X using Fink, see:
34 http://www.bioperl.org/wiki/Getting_BioPerl#Mac_OS_X_using_fink
36 SYSTEM REQUIREMENTS
38     * Perl 5.6.1 or later; version 5.8 and greater are highly
39       recommended. Modules are generally tested against perl 5.8 and
40       above.
42     * External modules: BioPerl uses functionality provided in other
43       Perl modules. Some of these are included in the standard perl
44       package but some need to be obtained from the CPAN site. The
45       list of external modules is included in the DEPENDENCIES file.
47 OPTIONAL
49    * ANSI C or GNU C compiler (gcc) for XS extensions (the bioperl-ext
50      package; see BUILDING THE OPTIONAL bioperl-ext PACKAGE, below).
52 ADDITIONAL INSTALLATION INFORMATION
54    * Additional information on BioPerl and MAC OS:
55       * OS 9 - http://bioperl.org/Core/mac-bioperl.html
56             NOTE: These are severely out-of-date and require MacPerl
57             (the latest version of which is 5.6.1rc1). As such, we do
58             not currently support BioPerl on OS 9
59       * OS X - Installing using Fink (in Getting BioPerl)
61 PRELIMINARY PREPARATION
63    This is optional, but regardless of your subsequent choice of
64    installation method, it will help to carry out the following steps.
65    They will increase the likelyhood of installation success
66    (especially of optional dependencies).
68      * Upgrade CPAN:
70  >perl -MCPAN -e shell
71  cpan>install Bundle::CPAN
72  cpan>q
74      * Install/upgrade Module::Build, and make it your preferred
75        installer:
77  >cpan
78  cpan>install Module::Build
79  cpan>o conf prefer_installer MB
80  cpan>o conf commit
81  cpan>q
83      * Install the expat library by whatever method is
84        appropriate for your system.
86      * If your expat library is installed in a non-standard location,
87        tell CPAN about it:
89  >cpan
90  cpan>o conf makepl_arg "EXPATLIBPATH=/non-standard/lib EXPATINCPATH=/non-standard/include"
91  cpan>o conf commit
94 INSTALLING BIOPERL THE EASY WAY USING Build.PL
96 The advantage of this approach is it's stepwise, so it's easy to stop
97 and analyze in case of any problem.
99 Download, then unpack the tar file. For example:
101  >tar xvfz BioPerl-1.6.923.tar.gz
102  >cd BioPerl-1.6.923
104 Now issue the build commands:
106  >perl Build.PL
107  >./Build test
109 If you've installed everything perfectly and all the network
110 connections are working then you may pass all the tests run in the
111 './Build test' phase. It's also possible that you may fail some tests.
112 Possible explanations: problems with local Perl installation, network
113 problems, previously undetected bug in BioPerl, flawed test script,
114 problems with CGI script using for sequence retrieval at public
115 database, and so on. Remember that there are over 900 modules in
116 BioPerl and the test suite is running more than 12000 individual
117 tests, a few failed tests may not affect your usage of BioPerl.
119 If you decide that the failed tests will not affect how you intend to
120 use BioPerl and you'd like to install anyway, or if all tests were
121 fine, do:
123  >./Build install
125 If you're concerned about a failed test and need assistance or advice
126 then contact bioperl-l@bioperl.org. (You could provide us the detailed
127 results of the failed test(s): see the `THE TEST SYSTEM' below for
128 information on how to generate such results.)
130 To './Build install' you need write permission in the
131 perl5/site_perl/source area (or similar, depending on your
132 environment). Usually this will require you becoming root, so you will
133 want to talk to your systems manager if you don't have the necessary
134 privileges.
136 It is also straightforward to install the package outside of the this
137 standard Perl5 location. See INSTALLING BIOPERL IN A PERSONAL MODULE
138 AREA, below.
141 INSTALLING BIOPERL THE EASY WAY USING CPAN
143 You can use the CPAN shell to install BioPerl. For example:
145  >perl -MCPAN -e shell
147 Or you might have the cpan alias installed:
149  >cpan
151 Then find the name of the BioPerl version you want:
153  cpan>d /bioperl/
155  ....
157 Distribution    CJFIELDS/BioPerl-1.6.901.tar.gz
158 Distribution    CJFIELDS/BioPerl-1.6.922.tar.gz
159 Distribution    CJFIELDS/BioPerl-1.6.923.tar.gz
161 Now install:
163  cpan>install CJFIELDS/BioPerl-1.6.923.tar.gz
165 If you've installed everything perfectly and all the network
166 connections are working then you may pass all the tests run in the
167 './Build test' phase. It's also possible that you may fail some tests.
168 Possible explanations: problems with local Perl installation, network
169 problems, previously undetected bug in BioPerl, flawed test script,
170 problems with CGI script used for sequence retrieval at public
171 database, and so on. Remember that there are over 900 modules in
172 BioPerl and the test suite is running more than 12000 individual
173 tests, a few failed tests may not affect your usage of BioPerl.
175 If you decide that the failed tests will not affect how you intend to
176 use BioPerl and you'd like to install anyway do:
178  cpan>force install C/CJ/CJFIELDS/BioPerl-1.6.923.tar.gz
180 If you're concerned about a failed test and need assistance or advice
181 then contact bioperl-l@bioperl.org. (You could provide us the detailed
182 results of the failed test(s): see the `THE TEST SYSTEM' below for
183 information on how to generate such results.)
185 WHERE ARE THE MAN PAGES?
187 Previously, when using Makefile.PL (no longer covered in this
188 documentation), we had to disable the automatic creation of man pages
189 because this step was triggering a "line too long" error on some OSs
190 due to shell constraints. If you want man pages installed use the
191 Build.PL installation process discussed above.
193 EXTERNAL PROGRAMS
195 BioPerl can interface with some external programs for executing
196 analyses. These include clustalw and t_coffee for Multiple Sequence
197 Alignment (Bio::Tools::Run::Alignment::Clustalw and
198 Bio::Tools::Run::Alignment::TCoffee) and blastall, blastpgp, and
199 bl2seq for BLAST analyses (Bio::Tools::Run::StandAloneBlast), and to
200 all the programs in the EMBOSS suite (Bio::Factory::EMBOSS).  Most
201 of the modules which 'wrap' these programs are located in the separate
202 bioperl-run distribution; however, two commonly-used modules are still
203 distributed with the BioPerl core (Bio::Tools::Run::StandAloneBlast,
204 Bio::Tools::Run::RemoteBlast).
206     Environment Variables
208 Some modules which run external programs need certain environment
209 variables set. If you do not have a local copy of the specific
210 executable you do not need to set these variables. Additionally the
211 modules will attempt to locate the specific applications in your
212 runtime PATH variable. You may also need to set an environment
213 variable to tell BioPerl about your network configuration if your site
214 uses a firewall.
216 Setting environment variables on unix means adding lines like the
217 following to your shell *rc file.
219    For bash or sh:
221  export BLASTDIR=/data1/blast
223    For csh or tcsh:
225  setenv BLASTDIR /data1/blast
227 Some environment variables include:
229 +------------------------------------------------------------------------+
230 | Env. Variable |                      Description                       |
231 |---------------+--------------------------------------------------------|
232 |               |Specifies where the NCBI blastall, blastpgp, bl2seq,    |
233 |BLASTDIR       |etc.. are located. A 'data' directory could also be     |
234 |               |present in this directory as well, you could put your   |
235 |               |blastable databases here.                               |
236 |---------------+--------------------------------------------------------|
237 |               |If one does not want to locate the data dir within the  |
238 |BLASTDATADIR or|same dir as where the BLASTDIR variable points, a       |
239 |BLASTDB        |BLASTDATADIR or BLASTDB variable can be set to point to |
240 |               |a dir where BLAST database indexes are located.         |
241 |---------------+--------------------------------------------------------|
242 |BLASTMAT       |The directory containing the substitution matrices such |
243 |               |as BLOSUM62.                                            |
244 |---------------+--------------------------------------------------------|
245 |CLUSTALDIR     |The directory where the clustalw executable is located. |
246 |---------------+--------------------------------------------------------|
247 |TCOFFEEDIR     |The directory where the t_coffee executable is located. |
248 |---------------+--------------------------------------------------------|
249 |               |If you access the internet via a proxy server then you  |
250 |               |can tell the BioPerl modules which require network      |
251 |               |access about this by using the http_proxy environment   |
252 |http_proxy     |variable. The value set includes the proxy address and  |
253 |               |the port, with optional username/password for           |
254 |               |authentication purposes                                 |
255 |               |(e.g. http://USERNAME:PASSWORD@proxy.example.com:8080). |
256 +------------------------------------------------------------------------+
258 INSTALLING BIOPERL SCRIPTS
260 BioPerl comes with a set of production-quality scripts that are
261 kept in the scripts/ directory. You can install these scripts if you'd
262 like, simply answer the questions during 'perl Build.PL'.
263 The installation directory can be specified by:
265  perl Build.PL
266  ./Build install --install_path script=/foo/scripts
268 By default they install to /usr/bin or similar, depending on platform.
270 INSTALLING BIOPERL IN A PERSONAL MODULE AREA
272 If you lack permission to install perl modules into the standard
273 site_perl/ system area you can configure BioPerl to install itself
274 anywhere you choose. Ideally this would be a personal perl directory
275 or standard place where you plan to put all your 'local' or personal
276 perl modules.
278    Example:
280  >perl Build.PL --install_base /home/users/dag
281  >./Build test
282  >./Build install
284 This tells perl to install all the various parts of bioperl in the
285 desired place, e.g. creating:
287    /home/users/dag/lib/perl5/Bio/Perl.pm
289 Then in your BioPerl script you would write:
291  use lib "/home/users/dag/lib/perl5/";
292  use Bio::Perl;
294 For more information on these sorts of custom installs see the
295 documentation for Module::Build.
297 If you are used to using something like:
299  >perl Makefile.PL PREFIX=/home/users/dag
301 You can get similar behaviour by using this instead:
303  >perl Build.PL --prefix /home/users/dag
305 For more information, see Module::Build::Cookbook documentation for
306 Installing_in_the_same_location_as_ExtUtils::MakeMaker
308 You can also use CPAN to install modules in your local directory.
309 First enter the CPAN shell, then set the arguments for the commands
310 "perl Makefile.PL" and "./Build install", like this:
312  >perl -e shell -MCPAN
313  cpan>o conf makepl_arg LIB=/home/users/dag/My_Local_Perl_Modules
314  cpan>o conf mbuild_install_arg "--install_path lib=/home/users/dag/My_Local_Perl_Modules"
315  cpan>o conf commit
317 INSTALLING BIOPERL MODULES THE HARD WAY
319 As a last resort, you can simply copy all files in Bio/ to any
320 directory in which you have write privileges. This is generally NOT
321 recommended since some modules may require special configuration
322 (currently none do, but don't rely on this).
324 You will need to set "use lib '/path/to/my/bioperl/modules';" in your
325 perl scripts so that you can access these modules if they are not
326 installed in the standard site_perl/ location. See above for an
327 example.
329 To get manpage documentation to work correctly you will have to
330 configure man so that it looks in the proper directory. On most
331 systems this will just involve adding an additional directory to your
332 $MANPATH environment variable.
334 The installation of the Compile directory can be similarly redirected,
335 but execute the make commands from the Compile/SW directory.
337 If all else fails and you are unable to access the perl distribution
338 directories, ask your system administrator to place the files there
339 for you. You can always execute perl scripts in the same directory as
340 the location of the modules (Bio/ in the distribution) since perl
341 always checks the current working directory when looking for modules.
343 USING MODULES NOT INSTALLED IN THE STANDARD LOCATION
345 You can explicitly tell perl where to look for modules by using the
346 Lib module which comes standard with perl.
348    Example:
350  #!/usr/bin/perl
351  use lib "/home/users/dag/lib/perl5/";
352  use Bio::Perl;
353  #<...insert whizzy perl code here...>
355 Or, you can set the environmental variable PERL5LIB:
357    csh or tcsh:
359  setenv PERL5LIB /home/users/dag/lib/perl5/
361    bash or sh:
363  export PERL5LIB=/home/users/dag/lib/perl5/
365 THE TEST SYSTEM
367 The BioPerl test system is located in the t/ directory and is
368 automatically run whenever you execute the './Build test' command
369 (having previously run 'Perl Build.PL'; if you have already installed
370 BioPerl answer 'no' to script installation to get nicer test output
371 later).
373 For the 1.6 release and beyond, tests have been organized into groups
374 based upon the specific task or class the module being tested belongs
375 to. If you want to investigate the behavior of a specific test such as
376 the Seq test you would type:
378  >./Build test --test_files t/Seq/Seq.t --verbose
380 The ./ ensures you are using the Build script in the current directory
381 to make sure you are testing the modules in this directory not ones
382 installed elsewhere. The --test_files arguement can be used multiple
383 times to try a set of test scripts in one go. The --verbose arguement
384 outputs the detailed test results, instead of just the summary you see
385 during './Build test'.
387 The '--test-files' argument can also work as a glob. For instance, to
388 run tests on all SearchIO modules, use the following:
390  >./Build test --test_files t/SearchIO* --verbose
392 If you are trying to learn how to use a module, often the test suite
393 is a good place to look. All good extreme programmers try and write a
394 test BEFORE they write the module to insure that their module behaves
395 the way they expect. You'll notice some 'ok' and 'skip' commands in a
396 test, this is part of the Perl test suite that signifies a passed test
397 with an 'ok N', where N is the test number. Alternatively you can tell
398 Perl to skip tests. This is useful when, for example, your test
399 detects that the network is not present and thus should skip, not
400 fail, any tests that require a network connection.
402 The core developers have indicated that future releases of BioPerl
403 will require that new modules come with a test suite with some minimal
404 tests.  Modules that lack adequate tests or could otherwise be
405 considered 'unstable' will be moved into a separate developer
406 distribution until adequate tests are added and the API stablizes.
408 BUILDING THE OPTIONAL bioperl-ext PACKAGE
410 The bioperl-ext package contains C code and XS extensions for various
411 alignment and trace file modules (Bio::Tools::pSW for DNA
412 Smith-Waterman, Bio::Tools::dpAlign for protein Smith-Waterman,
413 Bio::SearchDist for EVD fitting of extreme value, Bio::SeqIO::staden).
415 This Installation may work out-of-the box for most platforms except
416 BSD and Solaris boxes. For other platforms skip this next paragraph.
417 Of note, the code for bioperl-ext has not been updated along with the
418 rest of bioperl, so one may expect to see some issues. If so, please
419 report them to the BioPerl mailing list. Patches for these modules are
420 always welcome.
422     CONFIGURING for BSD and Solaris boxes
424 You should add the line -fPIC to the CFLAGS line in
425 Compile/SW/libs/makefile. This makes the compile generate position
426 independent code, which is required for these architectures. In
427 addition, on some Solaris boxes, the generated Makefile does not make
428 the correct -fPIC/-fpic flags for the C compiler that is used. This
429 requires manual editing of the generated Makefile to switch case. Try
430 it out once, and if you get errors, try editing the -fpic line
432     INSTALLATION
434 Move to the directory bioperl-ext. This is available as a separate
435 package released from ftp://bioperl.org/pub/bioperl/DIST. This is
436 where the C code and XS extension for the bp_sw module is held and
437 execute these commands: (possibly after making the change for BSD and
438 Solaris, as detailed above)
440  perl Makefile.PL   # makes the system specific makefile
441  make          # builds all the libaries
442  make test     # runs a short test
443  make install  # installs the package correctly.
445 This should install the compiled extension. The Bio::Tools::pSW module
446 will work cleanly now.