-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_dkbench
executable file
·118 lines (85 loc) · 3.86 KB
/
setup_dkbench
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/usr/bin/env perl
=head1 NAME
setup_dkbench - DKbench Perl CPU Benchmark utility setup script
=head1 DESCRIPTION
This is a setup script, part of the L<Benchmark::DKbench> distribution.
Refer to the distribution POD for more information on the DKbench suite:
perldoc Benchmark::DKbench
=head1 SYNOPSIS
Simple setup script to check/get the reference versions of CPAN modules and download
the Genbank data file required for the BioPerl benchmarks of the DKbench suite.
setup_dkbench [options]
Options:
--sudo : Will use sudo for cpanm calls.
--force : Will install reference CPAN module versions and re-download the genbank data.
--test : Will run the test suites for the CPAN module (default behavior is to skip).
--data=s : Data dir path to copy files from. Should not need if you installed DKbench.
--help : Print this help text and exit.
If you don't match the recommended Perl and CPAN module versions, the benchmarks
may show 'Fail' under Pass/Fail and scores may not be comparable to the baseline.
This might be perfectly fine for your purposes - in fact it might be intended if
you are benchmarking to compare different software instead of hardware.
This installer assumes you have at least cpanm (L<App::cpanminus>) already installed.
If not, on must systems you can do that with:
# System-wide with sudo:
curl -L https://cpanmin.us | perl - --sudo App::cpanminus
# Locally or system-wide when root
curl -L https://cpanmin.us | perl - App::cpanminus
You will also need to have a build enviroment set up (compiler, make etc). If you
want to add a couple of optional BioPerl bencharks you'd want an XML library in
addition. Example commands to have everything you might need installed with the
most popular pqckage managers (run as root or with sudo):
# Debian/Ubuntu etc
apt-get update
apt-get install wget build-essential perl cpanminus libxml-simple-perl
# CentOS/Redhat
yum update
yum install wget gcc make patch perl perl-App-cpanminus perl-XML-LibXML perl-XML-Parser
The above will have you ready for using the default (system) perl. If you want to
specifically install the reference perl version for this suite (currently 5.36.0),
the simplest way is using perlbrew (no need for root/sudo):
\curl -L https://install.perlbrew.pl | bash
source ~/perl5/perlbrew/etc/bashrc
perlbrew install perl-5.36.0 -n -j 4
perlbrew use perl-5.36.0
perlbrew install-cpanm
Note that the suite can be installed to as low as perl 5.12, however if you have a perl
version lower than 5.14 make sure you install L<IO::Socket::IP> 0.41 or lower first:
cpanm -n http://cpan.metacpan.org/authors/id/P/PE/PEVANS/IO-Socket-IP-0.41.tar.gz
Some benchmarks will report failure on "ancient" Perls.
=cut
use strict;
use warnings;
use Pod::Usage;
pod2usage({ -exitval => 'NOEXIT', -verbose => 1, -output => \*STDOUT, -noperldoc => 1});
use lib 'lib';
use Benchmark::DKbench::Setup;
use Getopt::Long;
GetOptions (
sudo => \my $use_sudo,
force => \my $force,
test => \my $test,
'data=s' => \my $data,
'help|h' => \my $help,
);
exit(1) if $help;
my $sudo = $use_sudo ? 'sudo' : '';
my $t = $test ? '' : '-n';
Benchmark::DKbench::Setup::fetch_genbank();
system "cp -r $data/* ".Benchmark::DKbench::Setup::datadir() if $data;
my @packages = Benchmark::DKbench::Setup::cpan_packages();
print $force ? "Installing reference cpan versions ...\n" : "Checking cpan modules ...\n";
foreach (@packages) {
m#/([a-z]+)(?:-([a-z]+))?(?:-([a-z]+))?(?:-([a-z]+))?[^/]+$#i;
my $mod = $1;
$mod .= "::$2" if $2;
$mod .= "::$3" if $3;
$mod .= "::$4" if $4;
my $ver = eval "use $mod; return \$${mod}::VERSION";
if (!$force && !$@) {
print "Skipping $mod (found version $ver)\n";
} else {
system "$sudo cpanm $t http://cpan.metacpan.org/authors/id/$_";
}
}
system "$sudo cpanm $t System::Info MCE::Loop Test::Harness Test::Output Test::Requires";