Update from wiki
[bioperl-live.git] / INSTALL
blob69f6f6c4f11191bdd2fe0f67c14994692ab71557
1 # $Id$
3 Installing Bioperl for Unix
5     *  BIOPERL INSTALLATION
6     *  SYSTEM REQUIREMENTS
7     *  OPTIONAL
8     *  ADDITIONAL INSTALLATION INFORMATION
9     *  THE BIOPERL BUNDLE
10     *  INSTALLING BIOPERL THE EASY WAY USING CPAN
11     *  INSTALLING BIOPERL THE EASY WAY USING Build.PL
12     *  WHERE ARE THE MAN PAGES?
13     *  EXTERNAL PROGRAMS
14         *  Environment Variables
15     *  INSTALLING BIOPERL SCRIPTS
16     *  INSTALLING BIOPERL IN A PERSONAL MODULE AREA
17     *  INSTALLING BIOPERL MODULES THE HARD WAY
18     *  USING MODULES NOT INSTALLED IN THE STANDARD LOCATION
19     *  THE TEST SYSTEM
20     *  BUILDING THE OPTIONAL bioperl-ext PACKAGE
21         *  CONFIGURING for BSD and Solaris boxes
22         *  INSTALLATION
24 BIOPERL INSTALLATION
26 Bioperl has been installed on many forms of Unix,
27 Win9X/NT/2000/XP, and on Mac OS X (see the PLATFORMS file for more
28 details). Following are instructions for installing Bioperl for
29 Unix/Linux/Mac OS X; Windows installation instructions can be found
30 in INSTALL.WIN. For installing Bioperl for Mac OS X using Fink, see:
32 http://www.bioperl.org/wiki/Getting_BioPerl#Mac_OS_X_using_fink
34 SYSTEM REQUIREMENTS
36     * Perl 5.6.1 or later; version 5.8 and greater are recommended.
38     * External modules: Bioperl uses functionality provided in other
39       Perl modules. Some of these are included in the standard perl package
40       but some need to be obtained from the CPAN site. The list of external
41       modules is included in the DEPENDENCIES file.
43 OPTIONAL
45    * ANSI C or GNU C compiler (gcc) for XS extensions (the
46      bioperl-ext package; see BUILDING THE OPTIONAL bioperl-ext
47      PACKAGE, below).
49 ADDITIONAL INSTALLATION INFORMATION
51    * Additional information on Bioperl and MAC OS:
52       * OS 9 - http://bioperl.org/Core/mac-bioperl.html
53       * OS X - http://www.tc.umn.edu/~cann0010/Bioperl_OSX_install.html
54       * OS X - Installing using Fink (in Getting BioPerl)
56 THE BIOPERL BUNDLE
58 Users of previous versions of Bioperl may remember Bundle::BioPerl.
59 You no longer need to install Bundle::BioPerl. Instead, the normal
60 installation process will ask you if you'd like to install the
61 optional external module dependencies that Bioperl has.
63 INSTALLING BIOPERL THE EASY WAY USING CPAN
65 You can use the CPAN shell to install Bioperl. For example:
67  >perl -MCPAN -e shell
69 Or you might have the cpan alias installed:
71  >cpan
73 Then find the name of the Bioperl version you want:
75  cpan>d /bioperl/
76  CPAN: Storable loaded ok
77  Going to read /home/bosborne/.cpan/Metadata
78  Database was generated on Mon, 20 Nov 2006 05:24:36 GMT
79  Distribution B/BI/BIRNEY/bioperl-1.2.tar.gz
80  Distribution B/BI/BIRNEY/bioperl-1.4.tar.gz
81  Distribution S/SE/SENDU/bioperl-1.5.2_100.tar.gz
83 Now install:
85  cpan>install S/SE/SENDU/bioperl-1.5.2_100.tar.gz
87 If you've installed everything perfectly and all the network connections
88 are working then you may pass all the tests run in the './Build test' phase.
89 It's also possible that you may fail some tests. Possible explanations:
90 problems with local Perl installation, network problems, previously
91 undetected bug in Bioperl, flawed test script, problems with CGI
92 script used for sequence retrieval at public database, and so on. Remember
93 that there are over 800 modules in Bioperl and the test suite is running
94 more than 12000 individual tests, a few failed tests may not affect your
95 usage of Bioperl.
97 If you decide that the failed tests will not affect how you intend to use
98 Bioperl and you'd like to install anyway do:
100  cpan>force install S/SE/SENDU/bioperl-1.5.2_100.tar.gz
102 This is what most experienced Bioperl users would do. However, if you're
103 concerned about a failed test and need assistance or advice then contact
104 bioperl-l@bioperl.org.
106 INSTALLING BIOPERL THE EASY WAY USING Build.PL
108 The advantage of this approach is it's stepwise, so it's easy to stop and
109 analyze in case of any problem.
111 Download, then unpack the tar file. For example:
113  >gunzip bioperl-1.5.2_100.tar.gz
114  >tar xvf bioperl-1.5.2_100.tar
115  >cd bioperl-1.5.2_100
117 Now issue the build commands:
119  >perl Build.PL
120  >./Build test
122 If you've installed everything perfectly and all the network connections
123 are working then you may pass all the tests run in the './Build test' phase.
124 It's also possible that you may fail some tests. Possible explanations:
125 problems with local Perl installation, network problems, previously
126 undetected bug in Bioperl, flawed test script, problems with CGI script
127 using for sequence retrieval at public database, and so on. Remember that
128 there are over 800 modules in Bioperl and the test suite is running more
129 than 12000 individual tests, a few failed tests may not affect your usage
130 of Bioperl.
132 If you decide that the failed tests will not affect how you intend to use
133 Bioperl and you'd like to install anyway, or if all tests were fine, do:
135  >./Build install
137 This is what most experienced Bioperl users would do. However, if you're
138 concerned about a failed test and need assistance or advice then contact
139 bioperl-l@bioperl.org.
141 To './Build install' you need write permission in the perl5/site_perl/source
142 area (or similar, depending on your environment). Usually this will require
143 you becoming root, so you will want to talk to your systems manager if you
144 don't have the necessary privileges.
146 It is also straightforward to install the package outside of the this
147 standard Perl5 location. See INSTALLING BIOPERL IN A PERSONAL MODULE
148 AREA, below.
150 WHERE ARE THE MAN PAGES?
152 When using Makefile.PL (no longer covered in this documentation), we had
153 to disable the automatic creation of man pages because this step was
154 triggering a "line too long" error on some OSs due to shell constraints.
155 If you want man pages installed use the Build.PL installation process
156 discussed above.
158 EXTERNAL PROGRAMS
160 Bioperl can interface with some external programs for executing analyses.
161 These include clustalw and t_coffee for Multiple Sequence Alignment
162 (Bio::Tools::Run::Alignment::Clustalw and
163 Bio::Tools::Run::Alignment::TCoffee) and blastall, blastpgp, and
164 bl2seq for BLAST analyses (Bio::Tools::Run::StandAloneBlast), and
165 to all the programs in the EMBOSS suite (Bio::Factory::EMBOSS).
167     Environment Variables
169 Some modules which run external programs need certain environment
170 variables set. If you do not have a local copy of the specific executable
171 you do not need to set these variables. Additionally the modules will
172 attempt to locate the specific applications in your runtime PATH variable.
173 You may also need to set an environment variable to tell BioPerl about
174 your network configuration if your site uses a firewall.
176 Setting environment variables on unix means adding lines like the
177 following to your shell *rc file.
179    For bash or sh:
181  export BLASTDIR=/data1/blast
183    For csh or tcsh:
185  setenv BLASTDIR /data1/blast
187 Some environment variables include:
189 +------------------------------------------------------------------------+
190 | Env. Variable |                      Description                       |
191 |---------------+--------------------------------------------------------|
192 |               |Specifies where the NCBI blastall, blastpgp, bl2seq,    |
193 |BLASTDIR       |etc.. are located. A 'data' directory could also be     |
194 |               |present in this directory as well, you could put your   |
195 |               |blastable databases here.                               |
196 |---------------+--------------------------------------------------------|
197 |               |If one does not want to locate the data dir within the  |
198 |BLASTDATADIR or|same dir as where the BLASTDIR variable points, a       |
199 |BLASTDB        |BLASTDATADIR or BLASTDB variable can be set to point to |
200 |               |a dir where BLAST database indexes are located.         |
201 |---------------+--------------------------------------------------------|
202 |BLASTMAT       |The directory containing the substitution matrices such |
203 |               |as BLOSUM62.                                            |
204 |---------------+--------------------------------------------------------|
205 |CLUSTALDIR     |The directory where the clustalw executable is located. |
206 |---------------+--------------------------------------------------------|
207 |TCOFFEEDIR     |The directory where the t_coffee executable is located. |
208 |---------------+--------------------------------------------------------|
209 |               |If you access the internet via a proxy server then you  |
210 |               |can tell the Bioperl modules which require network      |
211 |               |access about this by using the http_proxy environment   |
212 |http_proxy     |variable. The value set includes the proxy address and  |
213 |               |the port, with optional username/password for           |
214 |               |authentication purposes                                 |
215 |               |(e.g. http://USERNAME:PASSWORD@proxy.example.com:8080). |
216 +------------------------------------------------------------------------+
218 INSTALLING BIOPERL SCRIPTS
220 Bioperl comes with a set of production-quality scripts that are
221 kept in the scripts/ directory. You can install these scripts if you'd
222 like, simply answer the questions during 'perl Build.PL'.
223 The installation directory can be specified by
224  perl Build.PL
225  ./Build install --install_path script=/foo/scripts
226 By default they install to /usr/bin or similar, depending on platform.
228 INSTALLING BIOPERL IN A PERSONAL MODULE AREA
230 If you lack permission to install perl modules into the standard
231 site_perl/ system area you can configure Bioperl to install itself
232 anywhere you choose. Ideally this would be a personal perl directory or
233 standard place where you plan to put all your 'local' or personal perl
234 modules.
236    Example:
238  >perl Build.PL --install_base /home/users/dag
239  >./Build test
240  >./Build install
242 This tells perl to install all the various parts of bioperl in the desired
243 place, e.g. creating:
245    /home/users/dag/lib/perl5/Bio/Perl.pm
247 Then in your Bioperl script you would write:
249  use lib "/home/users/dag/lib/perl5/";
250  use Bio::Perl;
252 For more information on these sorts of custom installs see the documentation
253 for Module::Build.
255 If you are used to using something like:
257  >perl Makefile.PL PREFIX=/home/users/dag
259 You can get similar behaviour by using this instead:
261  >perl Build.PL --prefix /home/users/dag
263 For more information, see Module::Build::Cookbook documentation for
264 Installing_in_the_same_location_as_ExtUtils::MakeMaker
266 You can also use CPAN to install modules in your local directory. First
267 enter the CPAN shell, then set the arguments for the commands
268 "perl Makefile.PL" and "./Build install", like this:
270  >perl -e shell -MCPAN
271  cpan>o conf makepl_arg LIB=/home/users/dag/My_Local_Perl_Modules
272  cpan>o conf mbuild_install_arg "--install_path lib=/home/users/dag/My_Local_Perl_Modules"
273  cpan>o conf commit
275 INSTALLING BIOPERL MODULES THE HARD WAY
277 As a last resort, you can simply copy all files in Bio/ to any directory
278 in which you have write privileges. This is generally NOT recommended
279 since some modules may require special configuration (currently none do,
280 but don't rely on this).
282 You will need to set "use lib '/path/to/my/bioperl/modules';" in your perl
283 scripts so that you can access these modules if they are not installed in
284 the standard site_perl/ location. See above for an example.
286 To get manpage documentation to work correctly you will have to
287 configure man so that it looks in the proper directory. On most systems
288 this will just involve adding an additional directory to your $MANPATH
289 environment variable.
291 The installation of the Compile directory can be similarly redirected, but
292 execute the make commands from the Compile/SW directory.
294 If all else fails and you are unable to access the perl distribution
295 directories, ask your system administrator to place the files there for
296 you. You can always execute perl scripts in the same directory as the
297 location of the modules (Bio/ in the distribution) since perl always
298 checks the current working directory when looking for modules.
300 USING MODULES NOT INSTALLED IN THE STANDARD LOCATION
302 You can explicitly tell perl where to look for modules by using the
303 Lib module which comes standard with perl.
305    Example:
307  #!/usr/bin/perl
308  use lib "/home/users/dag/lib/perl5/";
309  use Bio::Perl;
310  #<...insert whizzy perl code here...>
312 Or, you can set the environmental variable PERL5LIB:
314    csh or tcsh:
316  setenv PERL5LIB /home/users/dag/lib/perl5/
318    bash or sh:
320  export PERL5LIB=/home/users/dag/lib/perl5/
322 THE TEST SYSTEM
324 The Bioperl test system is located in the t/ directory and is
325 automatically run whenever you execute the './Build test' command
326 (having previously run 'Perl Build.PL'; if you have already installed
327 Bioperl answer 'no' to script installation to get nicer test output
328 later).
329 Alternatively if you want to investigate the behavior of a specific test
330 such as the Seq test you would type:
332  >./Build test --test_files t/Seq.t --verbose
334 The ./ ensures you are using the Build script in the current directory to
335 make sure you are testing the modules in this directory not ones
336 installed elsewhere. The --test_files arguement can be used multiple times
337 to try a set of test scripts in one go. The --verbose arguement outputs
338 the detailed test results, instead of just the summary you see during
339 './Build test'.
341 If you are trying to learn how to use a module, often the test suite is a
342 good place to look. All good extreme programmers try and write a test
343 BEFORE they write the module to insure that their module behaves the way
344 they expect. You'll notice some 'ok' and 'skip' commands in a test, this
345 is part of the Perl test suite that signifies a passed test with an 'ok
346 N', where N is the test number. Alternatively you can tell Perl to skip
347 tests. This is useful when, for example, your test detects that the
348 network is not present and thus should skip, not fail, any tests that
349 require a network connection.
351 BUILDING THE OPTIONAL bioperl-ext PACKAGE
353 The bioperl-ext package contains C code and XS extensions for
354 various alignment and trace file modules (Bio::Tools::pSW for DNA
355 Smith-Waterman, Bio::Tools::dpAlign for protein Smith-Waterman,
356 Bio::SearchDist for EVD fitting of extreme value,
357 Bio::SeqIO::staden).
359 This Installation works out-of-the box for all platforms except BSD
360 and Solaris boxes. For other platforms skip this next paragraph.
362     CONFIGURING for BSD and Solaris boxes
364 You should add the line -fPIC to the CFLAGS line in
365 Compile/SW/libs/makefile. This makes the compile generate position
366 independent code, which is required for these architectures. In addition,
367 on some Solaris boxes, the generated Makefile does not make the correct
368 -fPIC/-fpic flags for the C compiler that is used. This requires manual
369 editing of the generated Makefile to switch case. Try it out once, and if
370 you get errors, try editing the -fpic line
372     INSTALLATION
374 Move to the directory bioperl-ext. This is available as a separate package
375 released from ftp://bioperl.org/pub/bioperl/DIST. This is where the C
376 code and XS extension for the bp_sw module is held and execute these
377 commands: (possibly after making the change for BSD and Solaris, as
378 detailed above)
380  perl Makefile.PL   # makes the system specific makefile
381  make          # builds all the libaries
382  make test     # runs a short test
383  make install  # installs the package correctly.
385 This should install the compiled extension. The Bio::Tools::pSW
386 module will work cleanly now.