-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.pl
64 lines (54 loc) · 1.49 KB
/
setup.pl
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
#! /usr/bin/perl
# setupscript
# setupscript for the exciting code
$num_args = $#ARGV + 1;
if ($num_args == 0) {
print "---------------------------------------------------------\n";
opendir(PDIR, "build/platforms") || die("Cannot open directory");
@makeincfiles= sort(readdir(PDIR));
$count=1;
#print @makeincfiles;
@fileslist=[];
foreach $file (@makeincfiles){
$platform="";
if($file=~ m/make\.inc\.(.+$)/)
{ $platform=$1;
print $count." ".$platform;
print ("\n");
$count++;
push(@fileslist,$file);
if ($count%20==0) {
print "type enter for more";
$wait=<>;
}
}
}
print "\nEnter the number of the platform that suites your system best: ";
$sel=<>;
if ($sel>$count-1 || $sel<1 || $sel=~m/^$/ || $sel!~m/^\d+$/) {
print "\ntry again\n\n";
exit;
}else{
print "\nYou use the makefile from:\n\n build/platforms/" . @fileslist[$sel];
print "\n\nIf the compilation fails, edit \"build/make.inc\" and execute \"make\" again.\n"
}
$filename="build/platforms/" . @fileslist[$sel];
@args=("cp",$filename,"build/make.inc");
$return= system(@args);
$selected=0;
while($selected==0){
print "\nIf you have MPI installed you can build exciting with k-point parallelization support.\n\n";
print "Build MPI binary ? (yes/No) ";
$MPI=<>;
if($MPI=~m/yes/i){
$selected=1;
system("echo \"BUILDMPI=true\">>build/make.inc");
}elsif($MPI=~m/no/i) {
system("echo \"BUILDMPI=false\">>build/make.inc");
$selected=1;
}else{
print "please choose yes or no";
$selected=0;
}
}
}