| 1 | package Bio::Installer::PAML; | ||||||||||||||||||||||||||||
| 2 | 1 | $Bio::Installer::PAML::VERSION = '1.7.2'; | |||||||||||||||||||||||||||
| 3 | 1 | ▶ | use utf8; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use vars qw(@ISA %DEFAULTS); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use Bio::Root::Root; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use Bio::Installer::Generic; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 1 | @ISA = qw(Bio::Installer::Generic ); | |||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | # ABSTRACT: DESCRIPTION of Object | ||||||||||||||||||||||||||||
| 15 | # AUTHOR: Albert Vilella <avilella@gmail.com> | ||||||||||||||||||||||||||||
| 16 | # OWNER: Albert Vilella <avilella@gmail.com> | ||||||||||||||||||||||||||||
| 17 | # LICENSE: Perl_5 | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | BEGIN { | ||||||||||||||||||||||||||||
| 21 | 1 | ▶ | %DEFAULTS = ( 'ORIGIN_DOWNLOAD_DIR' => 'http://abacus.gene.ucl.ac.uk/software/', | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 22 | 'BIN_FOLDER' => 'src', | ||||||||||||||||||||||||||||
| 23 | 'DESTINATION_DOWNLOAD_DIR' => '/tmp', | ||||||||||||||||||||||||||||
| 24 | 'DESTINATION_INSTALL_DIR' => "$ENV{'HOME'}", | ||||||||||||||||||||||||||||
| 25 | 'PACKAGE_NAME' => 'paml4a.tar.gz', | ||||||||||||||||||||||||||||
| 26 | 'DIRECTORY_NAME' => 'paml4', | ||||||||||||||||||||||||||||
| 27 | 'ENV_NAME' => 'PAMLDIR', | ||||||||||||||||||||||||||||
| 28 | ); | ||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | sub get_default { | ||||||||||||||||||||||||||||
| 34 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
get_default: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 35 | 0 | my $param = shift; | |||||||||||||||||||||||||||
| 36 | 0 | return $DEFAULTS{$param}; | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | sub install{ | ||||||||||||||||||||||||||||
| 42 | 0 | ▶ | my ($self,@args) = @_; | ||||||||||||||||||||||||||
|
Subroutine
install: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 43 | 0 | $self->_decompress; | |||||||||||||||||||||||||||
| 44 | 0 | $self->_tweak_paml_makefile; | |||||||||||||||||||||||||||
| 45 | 0 | $self->_execute_paml_makefile; | |||||||||||||||||||||||||||
| 46 | 0 | $self->_remember_env; | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | sub _execute_paml_makefile{ | ||||||||||||||||||||||||||||
| 52 | 0 | ▶ | my ($self,@args) = @_; | ||||||||||||||||||||||||||
|
Subroutine
_execute_paml_makefile: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||
| 53 | 0 | my $call; | |||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 0 | my $destination = $self->destination_install_dir . "/" . $self->directory_name . "/src"; | |||||||||||||||||||||||||||
| 56 | 0 | ▶ | chdir $destination or $self->throw("Cant cd to $destination"); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 57 | 0 | print "\n\nCompiling now... (this might take a while)\n\n"; | |||||||||||||||||||||||||||
| 58 | 0 | ▶ | if (($^O =~ /dec_osf|linux|unix|bsd|solaris|darwin/i)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 59 | 0 | $call = "make"; | |||||||||||||||||||||||||||
| 60 | 0 | ▶ | system("$call") == 0 or $self->throw("Error when trying to run make"); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 61 | } else { | ||||||||||||||||||||||||||||
| 62 | 0 | $self->throw("_execute_paml_makefile not yet implemented in this platform"); | |||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | sub _tweak_paml_makefile{ | ||||||||||||||||||||||||||||
| 69 | 0 | ▶ | my ($self,@args) = @_; | ||||||||||||||||||||||||||
|
Subroutine
_tweak_paml_makefile: not called CC=13 SCAR=52.0
| |||||||||||||||||||||||||||||
| 70 | 0 | my $gcc3; | |||||||||||||||||||||||||||
| 71 | 0 | my $return = qx/gcc -v 2>&1/; | |||||||||||||||||||||||||||
| 72 | 0 | ▶ | if ($return =~ /version 3/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 73 | 0 | $return = `cat /proc/cpuinfo`; | |||||||||||||||||||||||||||
| 74 | 0 | ▶ | if( ($return =~ /mmx/) || ($return =~ /3dnow/)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$return =~ /mmx/ or $return =~ /3dnow/
MC/DC0%0/2
$return =~ /mmx/ or $return =~ /3dnow/
$return =~ /mmx/
$return =~ /3dnow/
Truth table0%0/3
A or B
A= $return =~ /mmx/B= $return =~ /3dnow/
| |||||||||||||||||||||||||||||
| 75 | 0 | my $destination = $self->destination_install_dir . "/" . $self->directory_name . "/src"; | |||||||||||||||||||||||||||
| 76 | 0 | ▶ | chdir $destination or $self->throw("Cant cd to $destination"); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 77 | 0 | my $new = "Makefile"; | |||||||||||||||||||||||||||
| 78 | 0 | ▶ | open(OLD, "< Makefile.UNIX") or $self->throw("can't open Makefile.UNIX"); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 79 | 0 | ▶ | open(NEW, "> $new") or $self->throw("can't open $new"); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 80 | 0 | ▶ | while (<OLD>) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 81 | # change $_, then... | ||||||||||||||||||||||||||||
| 82 | 0 | $_ =~ s/CFLAGS = -O3/\# CFLAGS = -O3/g; | |||||||||||||||||||||||||||
| 83 | 0 | ▶ | if( $return =~ /3dnow/ ) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 84 | 0 | $_ =~ s/#CFLAGS = -march=athlon -mcpu=athlon -O4 -funroll-loops -fomit-frame-pointer -finline-functions/CFLAGS = -march=athlon -mcpu=athlon -O4 -funroll-loops -fomit-frame-pointer -finline-functions/g; | |||||||||||||||||||||||||||
| 85 | } elsif( $return =~ /mmx/ ) { | ||||||||||||||||||||||||||||
| 86 | 0 | $_ =~ s/#CFLAGS = -march=pentiumpro -mcpu=pentiumpro -O4 -funroll-loops -fomit-frame-pointer -finline-functions/CFLAGS = -march=pentiumpro -mcpu=pentiumpro -O4 -funroll-loops -fomit-frame-pointer -finline-functions/g; | |||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||
| 88 | 0 | ▶ | print NEW $_ or $self->throw("can't write $new"); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||
| 90 | 0 | ▶ | close(OLD) or $self->throw("can't close Makefile.UNIX"); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 91 | 0 | ▶ | close(NEW) or $self->throw("can't close $new"); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||
| 99 | 1 | 1; | |||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||
| 101 | __END__ | ||||||||||||||||||||||||||||