[bug 2637]
[bioperl-live.git] / INSTALL
blobd032e7b5e96d05ff4942b9e35ad5177fd50bafa1
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 Bioperl has been installed on many forms of Unix,
31 Win9X/NT/2000/XP, and on Mac OS X (see the PLATFORMS file for more
32 details). Following are instructions for installing Bioperl for
33 Unix/Linux/Mac OS X; Windows installation instructions can be found
34 in INSTALL.WIN. For installing Bioperl for Mac OS X using Fink, see:
36 http://www.bioperl.org/wiki/Getting_BioPerl#Mac_OS_X_using_fink
38 SYSTEM REQUIREMENTS
40     * Perl 5.6.1 or later; version 5.8 and greater are highly recommended.
42     * External modules: Bioperl uses functionality provided in other
43       Perl modules. Some of these are included in the standard perl package
44       but some need to be obtained from the CPAN site. The list of external
45       modules is included in the DEPENDENCIES file.
47 OPTIONAL
49    * ANSI C or GNU C compiler (gcc) for XS extensions (the
50      bioperl-ext package; see BUILDING THE OPTIONAL bioperl-ext
51      PACKAGE, below).
53 ADDITIONAL INSTALLATION INFORMATION
55    * Additional information on Bioperl and MAC OS:
56       * OS 9 - http://bioperl.org/Core/mac-bioperl.html
57       * OS X - http://www.tc.umn.edu/~cann0010/Bioperl_OSX_install.html
58             (outdated, but useful for libgd installation notes)
59       * OS X - Installing using Fink (in Getting BioPerl)
61 THE BIOPERL BUNDLE
63 Users of previous versions of Bioperl may remember Bundle::BioPerl.
64 You no longer need to install Bundle::BioPerl. Instead, the normal
65 installation process will ask you if you'd like to install the
66 optional external module dependencies that Bioperl has.
68 A full list of BioPerl dependencies can be found inf the DEPENDENCIES
69 file included with this distribution.
71 PRELIMINARY PREPARATION
73    This is optional, but regardless of your subsequent choice of installation
74    method, it will help to carry out the following steps. They will increase
75    the likelyhood of installation success (especially of optional
76    dependencies).
78      * Upgrade CPAN:
80  >perl -MCPAN -e shell
81  cpan>install Bundle::CPAN
82  cpan>q
84      * Install/upgrade Module::Build, and make it your preferred installer:
86  >cpan
87  cpan>install Module::Build
88  cpan>o conf prefer_installer MB
89  cpan>o conf commit
90  cpan>q
92      * Install the expat and libgd libraries by whatever method is
93        appropriate for your system. If you install libgd in a non-standard
94        location, that is fine: when installing the perl module that needs it
95        you will be asked where you installed it.
97      * If your expat library is installed in a non-standard location, tell
98        CPAN about it:
100  >cpan
101  cpan>o conf makepl_arg "EXPATLIBPATH=/non-standard/lib EXPATINCPATH=/non-standard/include"
102  cpan>o conf commit
104 INSTALLING BIOPERL THE EASY WAY USING CPAN
106 You can use the CPAN shell to install Bioperl. For example:
108  >perl -MCPAN -e shell
110 Or you might have the cpan alias installed:
112  >cpan
114 Then find the name of the Bioperl version you want:
116  cpan>d /bioperl/
117  CPAN: Storable loaded ok
118  Going to read /home/bosborne/.cpan/Metadata
119  Database was generated on Mon, 20 Nov 2006 05:24:36 GMT
120  Distribution B/BI/BIRNEY/bioperl-1.2.tar.gz
121  Distribution B/BI/BIRNEY/bioperl-1.4.tar.gz
122  Distribution S/SE/SENDU/bioperl-1.5.2_100.tar.gz
124 Now install:
126  cpan>install S/SE/SENDU/bioperl-1.5.2_100.tar.gz
128 If you've installed everything perfectly and all the network connections
129 are working then you may pass all the tests run in the './Build test' phase.
130 It's also possible that you may fail some tests. Possible explanations:
131 problems with local Perl installation, network problems, previously
132 undetected bug in Bioperl, flawed test script, problems with CGI
133 script used for sequence retrieval at public database, and so on. Remember
134 that there are over 800 modules in Bioperl and the test suite is running
135 more than 12000 individual tests, a few failed tests may not affect your
136 usage of Bioperl.
138 If you decide that the failed tests will not affect how you intend to use
139 Bioperl and you'd like to install anyway do:
141  cpan>force install S/SE/SENDU/bioperl-1.5.2_100.tar.gz
143 This is what most experienced Bioperl users would do. However, if you're
144 concerned about a failed test and need assistance or advice then contact
145 bioperl-l@bioperl.org. (You could provide us the detailed results of the failed
146 test(s): see the `THE TEST SYSTEM' below for information on how to generate such
147 results.)
149 INSTALLING BIOPERL THE EASY WAY USING Build.PL
151 The advantage of this approach is it's stepwise, so it's easy to stop and
152 analyze in case of any problem.
154 Download, then unpack the tar file. For example:
156  >gunzip bioperl-1.5.2_100.tar.gz
157  >tar xvf bioperl-1.5.2_100.tar
158  >cd bioperl-1.5.2_100
160 Now issue the build commands:
162  >perl Build.PL
163  >./Build test
165 If you've installed everything perfectly and all the network connections
166 are working then you may pass all the tests run in the './Build test' phase.
167 It's also possible that you may fail some tests. Possible explanations:
168 problems with local Perl installation, network problems, previously
169 undetected bug in Bioperl, flawed test script, problems with CGI script
170 using for sequence retrieval at public database, and so on. Remember that
171 there are over 800 modules in Bioperl and the test suite is running more
172 than 12000 individual tests, a few failed tests may not affect your usage
173 of Bioperl.
175 If you decide that the failed tests will not affect how you intend to use
176 Bioperl and you'd like to install anyway, or if all tests were fine, do:
178  >./Build install
180 This is what most experienced Bioperl users would do. However, if you're
181 concerned about a failed test and need assistance or advice then contact
182 bioperl-l@bioperl.org. (You could provide us the detailed results of the failed
183 test(s): see the `THE TEST SYSTEM' below for information on how to generate such
184 results.)
186 To './Build install' you need write permission in the perl5/site_perl/source
187 area (or similar, depending on your environment). Usually this will require
188 you becoming root, so you will want to talk to your systems manager if you
189 don't have the necessary privileges.
191 It is also straightforward to install the package outside of the this
192 standard Perl5 location. See INSTALLING BIOPERL IN A PERSONAL MODULE
193 AREA, below.
195 WHERE ARE THE MAN PAGES?
197 When using Makefile.PL (no longer covered in this documentation), we had
198 to disable the automatic creation of man pages because this step was
199 triggering a "line too long" error on some OSs due to shell constraints.
200 If you want man pages installed use the Build.PL installation process
201 discussed above.
203 EXTERNAL PROGRAMS
205 Bioperl can interface with some external programs for executing analyses.
206 These include clustalw and t_coffee for Multiple Sequence Alignment
207 (Bio::Tools::Run::Alignment::Clustalw and
208 Bio::Tools::Run::Alignment::TCoffee) and blastall, blastpgp, and
209 bl2seq for BLAST analyses (Bio::Tools::Run::StandAloneBlast), and
210 to all the programs in the EMBOSS suite (Bio::Factory::EMBOSS).
212     Environment Variables
214 Some modules which run external programs need certain environment
215 variables set. If you do not have a local copy of the specific executable
216 you do not need to set these variables. Additionally the modules will
217 attempt to locate the specific applications in your runtime PATH variable.
218 You may also need to set an environment variable to tell BioPerl about
219 your network configuration if your site uses a firewall.
221 Setting environment variables on unix means adding lines like the
222 following to your shell *rc file.
224    For bash or sh:
226  export BLASTDIR=/data1/blast
228    For csh or tcsh:
230  setenv BLASTDIR /data1/blast
232 Some environment variables include:
234 +------------------------------------------------------------------------+
235 | Env. Variable |                      Description                       |
236 |---------------+--------------------------------------------------------|
237 |               |Specifies where the NCBI blastall, blastpgp, bl2seq,    |
238 |BLASTDIR       |etc.. are located. A 'data' directory could also be     |
239 |               |present in this directory as well, you could put your   |
240 |               |blastable databases here.                               |
241 |---------------+--------------------------------------------------------|
242 |               |If one does not want to locate the data dir within the  |
243 |BLASTDATADIR or|same dir as where the BLASTDIR variable points, a       |
244 |BLASTDB        |BLASTDATADIR or BLASTDB variable can be set to point to |
245 |               |a dir where BLAST database indexes are located.         |
246 |---------------+--------------------------------------------------------|
247 |BLASTMAT       |The directory containing the substitution matrices such |
248 |               |as BLOSUM62.                                            |
249 |---------------+--------------------------------------------------------|
250 |CLUSTALDIR     |The directory where the clustalw executable is located. |
251 |---------------+--------------------------------------------------------|
252 |TCOFFEEDIR     |The directory where the t_coffee executable is located. |
253 |---------------+--------------------------------------------------------|
254 |               |If you access the internet via a proxy server then you  |
255 |               |can tell the Bioperl modules which require network      |
256 |               |access about this by using the http_proxy environment   |
257 |http_proxy     |variable. The value set includes the proxy address and  |
258 |               |the port, with optional username/password for           |
259 |               |authentication purposes                                 |
260 |               |(e.g. http://USERNAME:PASSWORD@proxy.example.com:8080). |
261 +------------------------------------------------------------------------+
263 INSTALLING BIOPERL SCRIPTS
265 Bioperl comes with a set of production-quality scripts that are
266 kept in the scripts/ directory. You can install these scripts if you'd
267 like, simply answer the questions during 'perl Build.PL'.
268 The installation directory can be specified by:
270  perl Build.PL
271  ./Build install --install_path script=/foo/scripts
273 By default they install to /usr/bin or similar, depending on platform.
275 INSTALLING BIOPERL IN A PERSONAL MODULE AREA
277 If you lack permission to install perl modules into the standard
278 site_perl/ system area you can configure Bioperl to install itself
279 anywhere you choose. Ideally this would be a personal perl directory or
280 standard place where you plan to put all your 'local' or personal perl
281 modules.
283    Example:
285  >perl Build.PL --install_base /home/users/dag
286  >./Build test
287  >./Build install
289 This tells perl to install all the various parts of bioperl in the desired
290 place, e.g. creating:
292    /home/users/dag/lib/perl5/Bio/Perl.pm
294 Then in your Bioperl script you would write:
296  use lib "/home/users/dag/lib/perl5/";
297  use Bio::Perl;
299 For more information on these sorts of custom installs see the documentation
300 for Module::Build.
302 If you are used to using something like:
304  >perl Makefile.PL PREFIX=/home/users/dag
306 You can get similar behaviour by using this instead:
308  >perl Build.PL --prefix /home/users/dag
310 For more information, see Module::Build::Cookbook documentation for
311 Installing_in_the_same_location_as_ExtUtils::MakeMaker
313 You can also use CPAN to install modules in your local directory. First
314 enter the CPAN shell, then set the arguments for the commands
315 "perl Makefile.PL" and "./Build install", like this:
317  >perl -e shell -MCPAN
318  cpan>o conf makepl_arg LIB=/home/users/dag/My_Local_Perl_Modules
319  cpan>o conf mbuild_install_arg "--install_path lib=/home/users/dag/My_Local_Perl_Modules"
320  cpan>o conf commit
322 INSTALLING BIOPERL MODULES THE HARD WAY
324 As a last resort, you can simply copy all files in Bio/ to any directory
325 in which you have write privileges. This is generally NOT recommended
326 since some modules may require special configuration (currently none do,
327 but don't rely on this).
329 You will need to set "use lib '/path/to/my/bioperl/modules';" in your perl
330 scripts so that you can access these modules if they are not installed in
331 the standard site_perl/ location. See above for an example.
333 To get manpage documentation to work correctly you will have to
334 configure man so that it looks in the proper directory. On most systems
335 this will just involve adding an additional directory to your $MANPATH
336 environment variable.
338 The installation of the Compile directory can be similarly redirected, but
339 execute the make commands from the Compile/SW directory.
341 If all else fails and you are unable to access the perl distribution
342 directories, ask your system administrator to place the files there for
343 you. You can always execute perl scripts in the same directory as the
344 location of the modules (Bio/ in the distribution) since perl always
345 checks the current working directory when looking for modules.
347 USING MODULES NOT INSTALLED IN THE STANDARD LOCATION
349 You can explicitly tell perl where to look for modules by using the
350 Lib module which comes standard with perl.
352    Example:
354  #!/usr/bin/perl
355  use lib "/home/users/dag/lib/perl5/";
356  use Bio::Perl;
357  #<...insert whizzy perl code here...>
359 Or, you can set the environmental variable PERL5LIB:
361    csh or tcsh:
363  setenv PERL5LIB /home/users/dag/lib/perl5/
365    bash or sh:
367  export PERL5LIB=/home/users/dag/lib/perl5/
369 THE TEST SYSTEM
371 The Bioperl test system is located in the t/ directory and is
372 automatically run whenever you execute the './Build test' command
373 (having previously run 'Perl Build.PL'; if you have already installed
374 Bioperl answer 'no' to script installation to get nicer test output
375 later).
376 Alternatively if you want to investigate the behavior of a specific test
377 such as the Seq test you would type:
379  >./Build test --test_files t/Seq.t --verbose
381 The ./ ensures you are using the Build script in the current directory to
382 make sure you are testing the modules in this directory not ones
383 installed elsewhere. The --test_files arguement can be used multiple times
384 to try a set of test scripts in one go. The --verbose arguement outputs
385 the detailed test results, instead of just the summary you see during
386 './Build test'.
388 If you are trying to learn how to use a module, often the test suite is a
389 good place to look. All good extreme programmers try and write a test
390 BEFORE they write the module to insure that their module behaves the way
391 they expect. You'll notice some 'ok' and 'skip' commands in a test, this
392 is part of the Perl test suite that signifies a passed test with an 'ok
393 N', where N is the test number. Alternatively you can tell Perl to skip
394 tests. This is useful when, for example, your test detects that the
395 network is not present and thus should skip, not fail, any tests that
396 require a network connection.
398 BUILDING THE OPTIONAL bioperl-ext PACKAGE
400 The bioperl-ext package contains C code and XS extensions for
401 various alignment and trace file modules (Bio::Tools::pSW for DNA
402 Smith-Waterman, Bio::Tools::dpAlign for protein Smith-Waterman,
403 Bio::SearchDist for EVD fitting of extreme value,
404 Bio::SeqIO::staden).
406 This Installation may work out-of-the box for most platforms except BSD
407 and Solaris boxes. For other platforms skip this next paragraph.  Of note,
408 the code for bioperl-ext has not been updated along with the rest of bioperl,
409 so one may expect to see some issues.  If so, please report them to the
410 BioPerl mailing list.
412     CONFIGURING for BSD and Solaris boxes
414 You should add the line -fPIC to the CFLAGS line in
415 Compile/SW/libs/makefile. This makes the compile generate position
416 independent code, which is required for these architectures. In addition,
417 on some Solaris boxes, the generated Makefile does not make the correct
418 -fPIC/-fpic flags for the C compiler that is used. This requires manual
419 editing of the generated Makefile to switch case. Try it out once, and if
420 you get errors, try editing the -fpic line
422     INSTALLATION
424 Move to the directory bioperl-ext. This is available as a separate package
425 released from ftp://bioperl.org/pub/bioperl/DIST. This is where the C
426 code and XS extension for the bp_sw module is held and execute these
427 commands: (possibly after making the change for BSD and Solaris, as
428 detailed above)
430  perl Makefile.PL   # makes the system specific makefile
431  make          # builds all the libaries
432  make test     # runs a short test
433  make install  # installs the package correctly.
435 This should install the compiled extension. The Bio::Tools::pSW
436 module will work cleanly now.