-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure
executable file
·54 lines (41 loc) · 1.01 KB
/
configure
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
#!/usr/bin/env perl
use 5.006;
use strict;
use warnings;
use Data::Dumper;
sub shell ($@) {
my ($cmd, $dry_run) = @_;
print "$cmd\n";
system($cmd) == 0 or
die "ERROR: failed to run command: ", trim($cmd), "\n";
}
sub trim ($) {
my $cmd = shift;
$cmd =~ s/\n.*/.../s;
$cmd;
}
my $cur_usr = `printf \${SUDO_USER:-\$(whoami)}`;
my $cur_sys = `cat /etc/*-release | sed -r "s/^ID=(.*)\$/\\1/;tA;d;:A;s/^\\"(.*)\\"\$/\\1/" | tr -d '\n'`;
my %config = (
'centos' => {'CMD' => 'yum'},
'ubuntu' => {'CMD' => 'apt-get'},
);
my @exec_list = (
'CUDA_Kit_List',
);
sub CUDA_Kit_List{
my $fun_name=(caller(0))[3];
$fun_name =~ s/^.+:://;
my %tmp_rumtime_list = (
'CUDA' => 'cuda_*_*_linux.run',
'CUDNN' => 'cudnn-*.tgz',
);
foreach my $tmp_sys (keys %config){
$config{$tmp_sys}{$fun_name} = {%tmp_rumtime_list};
}
}
foreach my $tmp_fun (@exec_list){
printf "Exec -> [ %s ]\n", $tmp_fun;
eval "$tmp_fun()";
}
print Dumper(%config);