forked from csoderlund/SyMAP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewSymap
More file actions
executable file
·127 lines (105 loc) · 2.67 KB
/
viewSymap
File metadata and controls
executable file
·127 lines (105 loc) · 2.67 KB
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
119
120
121
122
123
124
125
126
127
#!/usr/bin/env perl
# symap read-only
# Does not require the Java 3D libraries. Everything runs except the 3d display.
# Read command line parameters to set memory and CPU limits.
my $maxmem="2048m";
print ">>>> SyMAP with query and view without 3D <<<<\n";
my $allArgs = join(" ",@ARGV);
if ($allArgs =~ /-h/)
{
usage();
exit(0);
}
if ($allArgs =~ /-m\s*(\d+)m?/)
{
$maxmem = $1."m";
print "\nusing memory $maxmem\n\n";
}
my $uname = `uname`;
my $platform = "";
my $word;
if ($allArgs =~ /-linux/i)
{
$platform = "linux";
$word = getWordSize();
}
elsif ($allArgs =~ /-mac/i)
{
$platform = "mac";
}
elsif ($uname =~ /darwin/i)
{
$platform = "mac";
$word = "64"; # setting not used
}
elsif ($uname =~ /linux/i)
{
$platform = "linux";
$word = getWordSize();
}
else
{
print "Unable to determine platform; call with either '-linux' or '-mac'\n";
exit(0);
}
my $libpath="";
if ($platform eq "linux")
{
if ($word eq "64")
{
$libpath="-Djava.library.path=java/lib/amd64/";
}
else
{
$libpath="-Djava.library.path=java/lib/i386/";
}
}
else
{
$libpath=" -Djava.library.path=java/lib/osx -Dj3d.reng=jogl ";
}
my $jar = "symap.jar";
my $main ="symapCE.ProjectManagerFrame";
my $cmd = "java -Xmx$maxmem $libpath ";
$cmd .= " -classpath java/jar/$jar:java/jar/mysql-connector-java-5.0.8-bin.jar:java/jar/mysql-connector-mxj-gpl-5-0-9.jar:java/jar/mysql-connector-mxj-gpl-5-0-9-db-files.jar:java/jar/biojava.jar:java/jar/aspectjrt.jar:java/jar/freehep-graphicsio-2.1.1.jar:java/jar/freehep-graphicsio-svg-2.1.1.jar:java/jar/freehep-graphics2d-2.1.1.jar:java/jar/freehep-util-2.0.2.jar:java/jar/freehep-io-2.0.2.jar:java/jar/freehep-xml-2.1.1.jar:java/jar/freehep-export-2.1.1.jar:java/jar/freehep-swing-2.0.3.jar:java/jar/freehep-graphicsio-ps-2.1.1.jar:java/jar/freehep-graphicsio-pdf-2.1.1.jar";
# Get rid of args not used by app, and format the -p with no space
$allArgs =~ s/-32//;
$allArgs =~ s/-64//;
$allArgs =~ s/-m\S+//i;
$allArgs =~ s/-mac//i;
$allArgs =~ s/-linux//i;
if ($allArgs =~ /-p\s+\d+/)
{
$allArgs =~ s/(-p)\s+(\d+)/$1$2/;
}
if ($allArgs !~ /-r/) { $allArgs .= " -r";}
$cmd .= " $main $allArgs";
system($cmd);
#############################################
# note two tabs after each option
sub usage
{
print <<END;
Usage: ./viewSymap [options]
Use 'symap -h' for options
END
}
#############################################
# should only be called for platform linux
sub getWordSize
{
if ($allArgs =~ /-32/)
{
return "32";
}
elsif ($allArgs =~ /-64/)
{
return "64";
}
my $uname = `uname -i`; # illegal option on mac
if ($uname =~ /i386/)
{
return "32";
}
return "64";
}