forked from csoderlund/SyMAP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsymap
More file actions
executable file
·106 lines (88 loc) · 2.51 KB
/
symap
File metadata and controls
executable file
·106 lines (88 loc) · 2.51 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
#!/usr/bin/env perl
# symap
# Does not require the Java 3D libraries. Everything runs except the 3d display.
# Read command line parameters to set memory and a few SyMAP parameters.
# CAS506 removed command line args for platform, didn't work
# was attaching jar file that do not exist
my $maxmem="2048m";
print ">>>> SyMAP with no 3D ($maxmem) <<<<\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 ($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 -classpath java/jar/$jar";
#$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";
if ($allArgs =~ /-p\s+\d+/)
{
$allArgs =~ s/(-p)\s+(\d+)/$1$2/;
}
$cmd .= " $main $allArgs";
system($cmd);
#############################################
# note two tabs after each option
sub usage
{
print <<END;
Usage: ./symap [options]
-r : read-only mode (used by viewSymap)
-c string : filename of config file (to use instead of symap.config)
Alignment:
-p N : number of CPUs to use
-s : print stats for debugging
-o : use original draft ordering algorithm
END
}
#############################################
# should only be called for platform linux
sub getWordSize
{
my $uname = `uname -i`; # illegal option on mac
if ($uname =~ /i386/)
{
return "32";
}
return "64";
}