sync from trunk
[bioperl-live.git] / INSTALL
blobc37a2611dc143eb44fd91cd6459eebd1d0c0ef84
1 # $Id$
3 Installing BioPerl for Unix
5      * 1 BIOPERL INSTALLATION
6      * 2 SYSTEM REQUIREMENTS
7      * 3 OPTIONAL
8      * 4 ADDITIONAL INSTALLATION INFORMATION
9      * 5 THE BIOPERL BUNDLE
10      * 6 PRELIMINARY PREPARATION
11      * 7 INSTALLING BIOPERL THE EASY WAY USING CPAN
12      * 8 INSTALLING BIOPERL THE EASY WAY USING 'Build.PL'
13      * 9 WHERE ARE THE MAN PAGES?
14      * 10 EXTERNAL PROGRAMS
16           * 10.1 Environment Variables
18      * 11 INSTALLING BIOPERL SCRIPTS
19      * 12 INSTALLING BIOPERL IN A PERSONAL MODULE AREA
20      * 13 INSTALLING BIOPERL MODULES THE HARD WAY
21      * 14 USING MODULES NOT INSTALLED IN THE STANDARD LOCATION
22      * 15 THE TEST SYSTEM
23      * 16 BUILDING THE OPTIONAL bioperl-ext PACKAGE
25           * 16.1 CONFIGURING for BSD and Solaris boxes
26           * 16.2 INSTALLATION
28 BIOPERL INSTALLATION
30 For the most up-to-date installation instructions please see the
31 BioPerl wiki:
33   http://www.bioperl.org/wiki/Installing_BioPerl
35 BioPerl has been installed on many forms of Unix, Win9X/NT/2000/XP,
36 and on Mac OS X (see the PLATFORMS file for more details). Following
37 are instructions for installing BioPerl for Unix/Linux/Mac OS X;
38 Windows installation instructions can be found in INSTALL.WIN. For
39 installing BioPerl for Mac OS X using Fink, see:
41 http://www.bioperl.org/wiki/Getting_BioPerl#Mac_OS_X_using_fink
43 SYSTEM REQUIREMENTS
45     * Perl 5.6.1 or later; version 5.8 and greater are highly
46       recommended. Modules are generally tested against perl 5.8 and
47       above.
49     * External modules: BioPerl uses functionality provided in other
50       Perl modules. Some of these are included in the standard perl
51       package but some need to be obtained from the CPAN site. The
52       list of external modules is included in the DEPENDENCIES file.
54 OPTIONAL
56    * ANSI C or GNU C compiler (gcc) for XS extensions (the bioperl-ext
57      package; see BUILDING THE OPTIONAL bioperl-ext PACKAGE, below).
59 ADDITIONAL INSTALLATION INFORMATION
61    * Additional information on BioPerl and MAC OS:
62       * OS 9 - http://bioperl.org/Core/mac-bioperl.html
63             NOTE: These are severely out-of-date and require MacPerl
64             (the latest version of which is 5.6.1rc1). As such, we do
65             not currently support BioPerl on OS 9
66       * OS X - http://www.tc.umn.edu/~cann0010/Bioperl_OSX_install.html
67             (outdated, but useful for libgd installation notes)
68       * OS X - Installing using Fink (in Getting BioPerl)
70 THE BIOPERL BUNDLE
72 Users of previous versions of BioPerl may remember Bundle::BioPerl.
73 You no longer need to install Bundle::BioPerl. Instead, the normal
74 installation process will ask you if you'd like to install optional
75 external module dependencies that BioPerl has.
77 A full list of BioPerl dependencies can be found in the DEPENDENCIES
78 file included with this distribution.
80 PRELIMINARY PREPARATION
82    This is optional, but regardless of your subsequent choice of
83    installation method, it will help to carry out the following steps.
84    They will increase the likelyhood of installation success
85    (especially of optional dependencies).
87      * Upgrade CPAN:
89  >perl -MCPAN -e shell
90  cpan>install Bundle::CPAN
91  cpan>q
93      * Install/upgrade Module::Build, and make it your preferred
94        installer:
96  >cpan
97  cpan>install Module::Build
98  cpan>o conf prefer_installer MB
99  cpan>o conf commit
100  cpan>q
102      * Install the expat and libgd libraries by whatever method is
103        appropriate for your system. If you install libgd in a
104        non-standard location, that is fine: when installing the perl
105        module that needs it you will be asked where you installed it.
107      * If your expat library is installed in a non-standard location,
108        tell CPAN about it:
110  >cpan
111  cpan>o conf makepl_arg "EXPATLIBPATH=/non-standard/lib EXPATINCPATH=/non-standard/include"
112  cpan>o conf commit
114 INSTALLING BIOPERL THE EASY WAY USING CPAN
116 You can use the CPAN shell to install BioPerl. For example:
118  >perl -MCPAN -e shell
120 Or you might have the cpan alias installed:
122  >cpan
124 Then find the name of the BioPerl version you want:
126  cpan>d /bioperl/
127  CPAN: Storable loaded ok
128  Going to read /home/bosborne/.cpan/Metadata
129  Database was generated on Mon, 20 Nov 2006 05:24:36 GMT
130  Distribution B/BI/BIRNEY/bioperl-1.2.tar.gz
131  Distribution B/BI/BIRNEY/bioperl-1.4.tar.gz
132  Distribution S/SE/SENDU/bioperl-1.5.2_100.tar.gz
134 Now install:
136  cpan>install S/SE/SENDU/bioperl-1.5.2_100.tar.gz
138 If you've installed everything perfectly and all the network
139 connections are working then you may pass all the tests run in the
140 './Build test' phase. It's also possible that you may fail some tests.
141 Possible explanations: problems with local Perl installation, network
142 problems, previously undetected bug in BioPerl, flawed test script,
143 problems with CGI script used for sequence retrieval at public
144 database, and so on. Remember that there are over 900 modules in
145 BioPerl and the test suite is running more than 12000 individual
146 tests, a few failed tests may not affect your usage of BioPerl.
148 If you decide that the failed tests will not affect how you intend to
149 use BioPerl and you'd like to install anyway do:
151  cpan>force install S/SE/SENDU/bioperl-1.5.2_100.tar.gz
153 This is what most experienced BioPerl users would do. However, if
154 you're concerned about a failed test and need assistance or advice
155 then contact bioperl-l@bioperl.org. (You could provide us the detailed
156 results of the failed test(s): see the `THE TEST SYSTEM' below for
157 information on how to generate such results.)
159 INSTALLING BIOPERL THE EASY WAY USING Build.PL
161 The advantage of this approach is it's stepwise, so it's easy to stop
162 and analyze in case of any problem.
164 Download, then unpack the tar file. For example:
166  >gunzip bioperl-1.5.2_100.tar.gz
167  >tar xvf bioperl-1.5.2_100.tar
168  >cd bioperl-1.5.2_100
170 Now issue the build commands:
172  >perl Build.PL
173  >./Build test
175 If you've installed everything perfectly and all the network
176 connections are working then you may pass all the tests run in the
177 './Build test' phase. It's also possible that you may fail some tests.
178 Possible explanations: problems with local Perl installation, network
179 problems, previously undetected bug in BioPerl, flawed test script,
180 problems with CGI script using for sequence retrieval at public
181 database, and so on. Remember that there are over 900 modules in
182 BioPerl and the test suite is running more than 12000 individual
183 tests, a few failed tests may not affect your usage of BioPerl.
185 If you decide that the failed tests will not affect how you intend to
186 use BioPerl and you'd like to install anyway, or if all tests were
187 fine, do:
189  >./Build install
191 This is what most experienced BioPerl users would do. However, if
192 you're concerned about a failed test and need assistance or advice
193 then contact bioperl-l@bioperl.org. (You could provide us the detailed
194 results of the failed test(s): see the `THE TEST SYSTEM' below for
195 information on how to generate such results.)
197 To './Build install' you need write permission in the
198 perl5/site_perl/source area (or similar, depending on your
199 environment). Usually this will require you becoming root, so you will
200 want to talk to your systems manager if you don't have the necessary
201 privileges.
203 It is also straightforward to install the package outside of the this
204 standard Perl5 location. See INSTALLING BIOPERL IN A PERSONAL MODULE
205 AREA, below.
207 WHERE ARE THE MAN PAGES?
209 Previously, when using Makefile.PL (no longer covered in this
210 documentation), we had to disable the automatic creation of man pages
211 because this step was triggering a "line too long" error on some OSs
212 due to shell constraints. If you want man pages installed use the
213 Build.PL installation process discussed above. 
215 EXTERNAL PROGRAMS
217 BioPerl can interface with some external programs for executing
218 analyses. These include clustalw and t_coffee for Multiple Sequence
219 Alignment (Bio::Tools::Run::Alignment::Clustalw and
220 Bio::Tools::Run::Alignment::TCoffee) and blastall, blastpgp, and
221 bl2seq for BLAST analyses (Bio::Tools::Run::StandAloneBlast), and to
222 all the programs in the EMBOSS suite (Bio::Factory::EMBOSS).  Most
223 of the modules which 'wrap' these programs are located in the separate
224 bioperl-run distribution; however, two commonly-used modules are still
225 distributed with the BioPerl core (Bio::Tools::Run::StandAloneBlast,
226 Bio::Tools::Run::RemoteBlast).  
228     Environment Variables
230 Some modules which run external programs need certain environment
231 variables set. If you do not have a local copy of the specific
232 executable you do not need to set these variables. Additionally the
233 modules will attempt to locate the specific applications in your
234 runtime PATH variable. You may also need to set an environment
235 variable to tell BioPerl about your network configuration if your site
236 uses a firewall.
238 Setting environment variables on unix means adding lines like the
239 following to your shell *rc file.
241    For bash or sh:
243  export BLASTDIR=/data1/blast
245    For csh or tcsh:
247  setenv BLASTDIR /data1/blast
249 Some environment variables include:
251 +------------------------------------------------------------------------+
252 | Env. Variable |                      Description                       |
253 |---------------+--------------------------------------------------------|
254 |               |Specifies where the NCBI blastall, blastpgp, bl2seq,    |
255 |BLASTDIR       |etc.. are located. A 'data' directory could also be     |
256 |               |present in this directory as well, you could put your   |
257 |               |blastable databases here.                               |
258 |---------------+--------------------------------------------------------|
259 |               |If one does not want to locate the data dir within the  |
260 |BLASTDATADIR or|same dir as where the BLASTDIR variable points, a       |
261 |BLASTDB        |BLASTDATADIR or BLASTDB variable can be set to point to |
262 |               |a dir where BLAST database indexes are located.         |
263 |---------------+--------------------------------------------------------|
264 |BLASTMAT       |The directory containing the substitution matrices such |
265 |               |as BLOSUM62.                                            |
266 |---------------+--------------------------------------------------------|
267 |CLUSTALDIR     |The directory where the clustalw executable is located. |
268 |---------------+--------------------------------------------------------|
269 |TCOFFEEDIR     |The directory where the t_coffee executable is located. |
270 |---------------+--------------------------------------------------------|
271 |               |If you access the internet via a proxy server then you  |
272 |               |can tell the BioPerl modules which require network      |
273 |               |access about this by using the http_proxy environment   |
274 |http_proxy     |variable. The value set includes the proxy address and  |
275 |               |the port, with optional username/password for           |
276 |               |authentication purposes                                 |
277 |               |(e.g. http://USERNAME:PASSWORD@proxy.example.com:8080). |
278 +------------------------------------------------------------------------+
280 INSTALLING BIOPERL SCRIPTS
282 BioPerl comes with a set of production-quality scripts that are
283 kept in the scripts/ directory. You can install these scripts if you'd
284 like, simply answer the questions during 'perl Build.PL'.
285 The installation directory can be specified by:
287  perl Build.PL
288  ./Build install --install_path script=/foo/scripts
290 By default they install to /usr/bin or similar, depending on platform.
292 INSTALLING BIOPERL IN A PERSONAL MODULE AREA
294 If you lack permission to install perl modules into the standard
295 site_perl/ system area you can configure BioPerl to install itself
296 anywhere you choose. Ideally this would be a personal perl directory
297 or standard place where you plan to put all your 'local' or personal
298 perl modules.
300    Example:
302  >perl Build.PL --install_base /home/users/dag
303  >./Build test
304  >./Build install
306 This tells perl to install all the various parts of bioperl in the
307 desired place, e.g. creating:
309    /home/users/dag/lib/perl5/Bio/Perl.pm
311 Then in your BioPerl script you would write:
313  use lib "/home/users/dag/lib/perl5/";
314  use Bio::Perl;
316 For more information on these sorts of custom installs see the
317 documentation for Module::Build.
319 If you are used to using something like:
321  >perl Makefile.PL PREFIX=/home/users/dag
323 You can get similar behaviour by using this instead:
325  >perl Build.PL --prefix /home/users/dag
327 For more information, see Module::Build::Cookbook documentation for
328 Installing_in_the_same_location_as_ExtUtils::MakeMaker
330 You can also use CPAN to install modules in your local directory.
331 First enter the CPAN shell, then set the arguments for the commands
332 "perl Makefile.PL" and "./Build install", like this:
334  >perl -e shell -MCPAN
335  cpan>o conf makepl_arg LIB=/home/users/dag/My_Local_Perl_Modules
336  cpan>o conf mbuild_install_arg "--install_path lib=/home/users/dag/My_Local_Perl_Modules"
337  cpan>o conf commit
339 INSTALLING BIOPERL MODULES THE HARD WAY
341 As a last resort, you can simply copy all files in Bio/ to any
342 directory in which you have write privileges. This is generally NOT
343 recommended since some modules may require special configuration
344 (currently none do, but don't rely on this).
346 You will need to set "use lib '/path/to/my/bioperl/modules';" in your
347 perl scripts so that you can access these modules if they are not
348 installed in the standard site_perl/ location. See above for an
349 example.
351 To get manpage documentation to work correctly you will have to
352 configure man so that it looks in the proper directory. On most
353 systems this will just involve adding an additional directory to your
354 $MANPATH environment variable.
356 The installation of the Compile directory can be similarly redirected,
357 but execute the make commands from the Compile/SW directory.
359 If all else fails and you are unable to access the perl distribution
360 directories, ask your system administrator to place the files there
361 for you. You can always execute perl scripts in the same directory as
362 the location of the modules (Bio/ in the distribution) since perl
363 always checks the current working directory when looking for modules.
365 USING MODULES NOT INSTALLED IN THE STANDARD LOCATION
367 You can explicitly tell perl where to look for modules by using the
368 Lib module which comes standard with perl.
370    Example:
372  #!/usr/bin/perl
373  use lib "/home/users/dag/lib/perl5/";
374  use Bio::Perl;
375  #<...insert whizzy perl code here...>
377 Or, you can set the environmental variable PERL5LIB:
379    csh or tcsh:
381  setenv PERL5LIB /home/users/dag/lib/perl5/
383    bash or sh:
385  export PERL5LIB=/home/users/dag/lib/perl5/
387 THE TEST SYSTEM
389 The BioPerl test system is located in the t/ directory and is
390 automatically run whenever you execute the './Build test' command
391 (having previously run 'Perl Build.PL'; if you have already installed
392 BioPerl answer 'no' to script installation to get nicer test output
393 later). 
395 For the 1.6 release and beyond, tests have been organized into groups
396 based upon the specific task or class the module ibeing tested belongs
397 to. If you want to investigate the behavior of a specific test such as
398 the Seq test you would type: 
400  >./Build test --test_files t/Seq/Seq.t --verbose
402 The ./ ensures you are using the Build script in the current directory
403 to make sure you are testing the modules in this directory not ones
404 installed elsewhere. The --test_files arguement can be used multiple
405 times to try a set of test scripts in one go. The --verbose arguement
406 outputs the detailed test results, instead of just the summary you see
407 during './Build test'.
409 The '--test-files' argument can also work as a glob. For instance, to
410 run tests on all SearchIO modules, use the following:
412  >./Build test --test_files t/SearchIO* --verbose
414 If you are trying to learn how to use a module, often the test suite
415 is a good place to look. All good extreme programmers try and write a
416 test BEFORE they write the module to insure that their module behaves
417 the way they expect. You'll notice some 'ok' and 'skip' commands in a
418 test, this is part of the Perl test suite that signifies a passed test
419 with an 'ok N', where N is the test number. Alternatively you can tell
420 Perl to skip tests. This is useful when, for example, your test
421 detects that the network is not present and thus should skip, not
422 fail, any tests that require a network connection.
424 The core developers have indicated that future releases of BioPerl
425 will require that new modules come with a test suite with some minimal
426 tests.  Modules that lack adequate tests or could otherwise be
427 considered 'unstable' will be moved into a separate developer
428 distribution until adequate tests are added and the API stablizes.
430 BUILDING THE OPTIONAL bioperl-ext PACKAGE
432 The bioperl-ext package contains C code and XS extensions for various
433 alignment and trace file modules (Bio::Tools::pSW for DNA
434 Smith-Waterman, Bio::Tools::dpAlign for protein Smith-Waterman,
435 Bio::SearchDist for EVD fitting of extreme value, Bio::SeqIO::staden).
437 This Installation may work out-of-the box for most platforms except
438 BSD and Solaris boxes. For other platforms skip this next paragraph.
439 Of note, the code for bioperl-ext has not been updated along with the
440 rest of bioperl, so one may expect to see some issues. If so, please
441 report them to the BioPerl mailing list. Patches for these modules are
442 always welcome.
444     CONFIGURING for BSD and Solaris boxes
446 You should add the line -fPIC to the CFLAGS line in
447 Compile/SW/libs/makefile. This makes the compile generate position
448 independent code, which is required for these architectures. In
449 addition, on some Solaris boxes, the generated Makefile does not make
450 the correct -fPIC/-fpic flags for the C compiler that is used. This
451 requires manual editing of the generated Makefile to switch case. Try
452 it out once, and if you get errors, try editing the -fpic line
454     INSTALLATION
456 Move to the directory bioperl-ext. This is available as a separate
457 package released from ftp://bioperl.org/pub/bioperl/DIST. This is
458 where the C code and XS extension for the bp_sw module is held and
459 execute these commands: (possibly after making the change for BSD and
460 Solaris, as detailed above)
462  perl Makefile.PL   # makes the system specific makefile
463  make          # builds all the libaries
464  make test     # runs a short test
465  make install  # installs the package correctly.
467 This should install the compiled extension. The Bio::Tools::pSW module
468 will work cleanly now.