Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 330 lines (288 sloc) 13.528 kb
81f0263 @jafingerhut Add env-batch.sh, nearly identical to env.sh except for a few variabl…
authored
1 # Define paths to the executables you want to use on your system, or just
2 # leave them without a path name if the commands you want are already in
3 # your command path.
4
5 # Try to make the bash scripts for compiling and running work on all
6 # of these:
7
8 # * Linux
9 # * Mac OS X
10 # * Windows + Cygwin, started from within a bash session, not from a
11 # Windows command prompt
12
13 # SEP=SEParator. String to use in separating components of a file's
14 # path name. '/' for Linux/Unix, '\' for Windows.
15
16 # PSEP=Path SEParator. String to use in separating paths in a list of
17 # paths. ':' for Linux/Unix, ';' for Windows.
18
19 # On Windows+Cygwin, it appears that these characters are only needed
20 # in classpath arguments to the Java run time.
21
22 OS=`uname -o 2>/dev/null`
23 if [ $? -ne 0 ]
24 then
25 # Option -o does not exist in Mac OS X default version of uname
26 # command.
27 OS=`uname -s 2>/dev/null`
28 fi
29 #echo "Debug OS=:${OS}:"
30 if [ "$OS" == "Cygwin" ]
31 then
32 SEP='\'
33 PSEP=';'
34
35 ######################################################################
36 # Windows+Cygwin Java
37 ######################################################################
38 # Example paths I used successfully on Windows+Cygwin for some JVMs.
39
40 # The JVM_TYPE is intended to be used as an argument to
41 # measureproc if you want to get GC statistics, e.g.
42 # measureproc --jvm-gc-stats "${JVM_TYPE}" ...
43 JVM_TYPE="jrockit"
44 JAVA_BIN="/cygdrive/c/Program Files/Java/jrmc-4.0.1-1.6.0/bin"
45 #JVM_TYPE="hotspot"
46 #JAVA_BIN="/cygdrive/c/Program Files/Java/jdk1.6.0_21/bin"
47 JAVAC="${JAVA_BIN}/javac"
48 JAVA="${JAVA_BIN}/java"
49
50 ######################################################################
51 # Windows+Cygwin Clojure
52 ######################################################################
53
54 HOME_DIR=`cygpath -w "$HOME"`
55 if [ "${CLJ_VERSION:=clj-1.2}" == "clj-1.2" ]
56 then
57 # Let default Clojure version be 1.2.0 if none is specified.
58 CLOJURE_JAR_DIR=`cygpath -w "${HOME_DIR}/lein/swank-clj-1.2.0/lib"`
59 CLOJURE_CLASSPATH_PART1=`cygpath -w "${CLOJURE_JAR_DIR}/clojure-1.2.0.jar"`
60 CLOJURE_CLASSPATH_PART2=`cygpath -w "${CLOJURE_JAR_DIR}/clojure-contrib-1.2.0.jar"`
61 CLOJURE_CLASSPATH="${CLOJURE_CLASSPATH_PART1};${CLOJURE_CLASSPATH_PART2}"
62 elif [ "$CLJ_VERSION" == "clj-1.2.1" ]
63 then
64 CLOJURE_JAR_DIR=`cygpath -w "${HOME_DIR}/lein/clj-1.2.1/lib"`
65 CLOJURE_CLASSPATH=`cygpath -w "${CLOJURE_JAR_DIR}/clojure-1.2.1.jar"`
66 elif [ "$CLJ_VERSION" == "clj-1.3-alpha1" ]
67 then
68 CLOJURE_JAR_DIR=`cygpath -w "${HOME_DIR}/lein/clj-1.3.0-alpha1/lib"`
69 CLOJURE_CLASSPATH=`cygpath -w "${CLOJURE_JAR_DIR}/clojure-1.3.0-alpha1.jar"`
70 elif [ "$CLJ_VERSION" == "clj-1.3-alpha3" ]
71 then
72 CLOJURE_JAR_DIR=`cygpath -w "${HOME_DIR}/lein/clj-1.3.0-alpha3/lib"`
73 CLOJURE_CLASSPATH=`cygpath -w "${CLOJURE_JAR_DIR}/clojure-1.3.0-alpha3.jar"`
74 elif [ "$CLJ_VERSION" == "clj-1.3-alpha4" ]
75 then
76 CLOJURE_JAR_DIR=`cygpath -w "${HOME_DIR}/lein/clj-1.3.0-alpha4/lib"`
77 CLOJURE_CLASSPATH=`cygpath -w "${CLOJURE_JAR_DIR}/clojure-1.3.0-alpha4.jar"`
78 elif [ "$CLJ_VERSION" == "clj-1.3-alpha5" ]
79 then
80 CLOJURE_JAR_DIR=`cygpath -w "${HOME_DIR}/lein/clj-1.3.0-alpha5/lib"`
81 CLOJURE_CLASSPATH=`cygpath -w "${CLOJURE_JAR_DIR}/clojure-1.3.0-alpha5.jar"`
82 elif [ "$CLJ_VERSION" == "clj-1.3-alpha6" ]
83 then
84 CLOJURE_JAR_DIR=`cygpath -w "${HOME_DIR}/lein/clj-1.3.0-alpha6/lib"`
85 CLOJURE_CLASSPATH=`cygpath -w "${CLOJURE_JAR_DIR}/clojure-1.3.0-alpha6.jar"`
05a3f15 @jafingerhut Minor updates to some files
authored
86 elif [ "$CLJ_VERSION" == "clj-1.3-beta1" ]
87 then
88 CLOJURE_JAR_DIR=`cygpath -w "${HOME_DIR}/lein/clj-1.3.0-beta1/lib"`
89 CLOJURE_CLASSPATH=`cygpath -w "${CLOJURE_JAR_DIR}/clojure-1.3.0-beta1.jar"`
90 elif [ "$CLJ_VERSION" == "clj-1.3-beta2" ]
91 then
92 CLOJURE_JAR_DIR=`cygpath -w "${HOME_DIR}/lein/clj-1.3.0-beta2/lib"`
93 CLOJURE_CLASSPATH=`cygpath -w "${CLOJURE_JAR_DIR}/clojure-1.3.0-beta2.jar"`
94 elif [ "$CLJ_VERSION" == "clj-1.3-beta3" ]
95 then
96 CLOJURE_JAR_DIR=`cygpath -w "${HOME_DIR}/lein/clj-1.3.0-beta3/lib"`
97 CLOJURE_CLASSPATH=`cygpath -w "${CLOJURE_JAR_DIR}/clojure-1.3.0-beta3.jar"`
98 elif [ "$CLJ_VERSION" == "clj-1.3.0" ]
99 then
100 CLOJURE_JAR_DIR=`cygpath -w "${HOME_DIR}/lein/clj-1.3.0/lib"`
101 CLOJURE_CLASSPATH=`cygpath -w "${CLOJURE_JAR_DIR}/clojure-1.3.0.jar"`
8a4e931 @jafingerhut Make same updates to env-batch.sh as I recently made to env.sh
authored
102 elif [ "$CLJ_VERSION" == "clj-1.3-latest" ]
103 then
104 CLOJURE_JAR_DIR=`cygpath -w "${HOME_DIR}/clj/clojure"`
105 CLOJURE_CLASSPATH=`cygpath -w "${CLOJURE_JAR_DIR}/clojure-1.3.0-master-SNAPSHOT.jar"`
81f0263 @jafingerhut Add env-batch.sh, nearly identical to env.sh except for a few variabl…
authored
106 else
05a3f15 @jafingerhut Minor updates to some files
authored
107 1>&2 echo "$0: CLJ_VERSION='${CLJ_VERSION}' must be one of: clj-1.2 clj-1.2.1 clj-1.3-alpha1 clj-1.3-alpha3 clj-1.3-alpha4 clj-1.3-alpha5 clj-1.3-alpha6 clj-1.3-beta1 clj-1.3-beta2 clj-1.3-beta3 clj-1.3.0 clj-1.3-latest"
81f0263 @jafingerhut Add env-batch.sh, nearly identical to env.sh except for a few variabl…
authored
108 exit 1
109 fi
110
111 # Platform-specific form of Clojure object file directory
112 PS_CLJ_OBJ_DIR=".${SEP}obj${SEP}${CLJ_VERSION}"
113 PS_FULL_CLJ_CLASSPATH="${CLOJURE_CLASSPATH}${PSEP}${PS_CLJ_OBJ_DIR}"
114 # Unix form, still useful in some places on Cygwin
115 CLJ_OBJ_DIR="./obj/${CLJ_VERSION}"
116
117 ######################################################################
118 # Windows+Cygwin SBCL
119 ######################################################################
120 # The mandelbrot benchmark requires SBCL built with threading enabled.
121 # TBD: Is threading implemented in SBCL for Windows yet? Test it.
122 #
123 # These lines worked for me on Windows+Cygwin with SBCL 1.0.37
124 # installed from the binary available here:
125 # http://www.sbcl.org/platform-table.html
126 SBCL="/cygdrive/c/Program Files/Steel Bank Common Lisp/1.0.37/sbcl"
127 export SBCL_HOME="C:\Program Files\Steel Bank Common Lisp\1.0.37"
128
129 ######################################################################
130 # Windows+Cygwin GHC
131 ######################################################################
132 # Glasgow Haskell Compiler location
133 # There is no ghc package available in Cygwin as of Sep 2010.
134 GHC="ghc"
135
136 ######################################################################
137 # Linux/MacOS Perl
138 ######################################################################
139 PERL="perl"
140
141 elif [ "$OS" == "GNU/Linux" -o "$OS" == "Darwin" ]
142 then
143 SEP='/'
144 PSEP=':'
145
146 ######################################################################
147 # Linux/MacOS Java
148 ######################################################################
149 # The JVM_TYPE is intended to be used as an argument to
150 # measureproc if you want to get GC statistics, e.g.
151 # measureproc --jvm-gc-stats "${JVM_TYPE}" ...
152 JVM_TYPE="hotspot"
153 JAVAC="javac"
154 JAVA="java"
155
156 ######################################################################
157 # Linux/MacOS Clojure
158 ######################################################################
159
160 if [ "${CLJ_VERSION:=clj-1.2}" == "clj-1.2" ]
161 then
162 # Let default Clojure version be 1.2.0 if none is specified.
163 CLOJURE_JAR_DIR="${HOME}/lein/swank-clj-1.2.0/lib"
164 CLOJURE_CLASSPATH="${CLOJURE_JAR_DIR}/clojure-1.2.0.jar:${CLOJURE_JAR_DIR}/clojure-contrib-1.2.0.jar"
165 elif [ "$CLJ_VERSION" == "clj-1.2.1" ]
166 then
167 CLOJURE_JAR_DIR="${HOME}/lein/clj-1.2.1/lib"
168 CLOJURE_CLASSPATH="${CLOJURE_JAR_DIR}/clojure-1.2.1.jar"
169 elif [ "$CLJ_VERSION" == "clj-1.3-alpha1" ]
170 then
171 CLOJURE_JAR_DIR="${HOME}/lein/clj-1.3.0-alpha1/lib"
172 CLOJURE_CLASSPATH="${CLOJURE_JAR_DIR}/clojure-1.3.0-alpha1.jar"
173 elif [ "$CLJ_VERSION" == "clj-1.3-alpha3" ]
174 then
175 CLOJURE_JAR_DIR="${HOME}/lein/clj-1.3.0-alpha3/lib"
176 CLOJURE_CLASSPATH="${CLOJURE_JAR_DIR}/clojure-1.3.0-alpha3.jar"
177 elif [ "$CLJ_VERSION" == "clj-1.3-alpha4" ]
178 then
179 CLOJURE_JAR_DIR="${HOME}/lein/clj-1.3.0-alpha4/lib"
180 CLOJURE_CLASSPATH="${CLOJURE_JAR_DIR}/clojure-1.3.0-alpha4.jar"
181 elif [ "$CLJ_VERSION" == "clj-1.3-alpha5" ]
182 then
183 CLOJURE_JAR_DIR="${HOME}/lein/clj-1.3.0-alpha5/lib"
184 CLOJURE_CLASSPATH="${CLOJURE_JAR_DIR}/clojure-1.3.0-alpha5.jar"
185 elif [ "$CLJ_VERSION" == "clj-1.3-alpha6" ]
186 then
187 CLOJURE_JAR_DIR="${HOME}/lein/clj-1.3.0-alpha6/lib"
188 CLOJURE_CLASSPATH="${CLOJURE_JAR_DIR}/clojure-1.3.0-alpha6.jar"
05a3f15 @jafingerhut Minor updates to some files
authored
189 elif [ "$CLJ_VERSION" == "clj-1.3-beta1" ]
190 then
191 CLOJURE_JAR_DIR="${HOME}/lein/clj-1.3.0-beta1/lib"
192 CLOJURE_CLASSPATH="${CLOJURE_JAR_DIR}/clojure-1.3.0-beta1.jar"
193 elif [ "$CLJ_VERSION" == "clj-1.3-beta2" ]
194 then
195 CLOJURE_JAR_DIR="${HOME}/lein/clj-1.3.0-beta2/lib"
196 CLOJURE_CLASSPATH="${CLOJURE_JAR_DIR}/clojure-1.3.0-beta2.jar"
197 elif [ "$CLJ_VERSION" == "clj-1.3-beta3" ]
198 then
199 CLOJURE_JAR_DIR="${HOME}/lein/clj-1.3.0-beta3/lib"
200 CLOJURE_CLASSPATH="${CLOJURE_JAR_DIR}/clojure-1.3.0-beta3.jar"
201 elif [ "$CLJ_VERSION" == "clj-1.3.0" ]
202 then
203 CLOJURE_JAR_DIR="${HOME}/lein/clj-1.3.0/lib"
204 CLOJURE_CLASSPATH="${CLOJURE_JAR_DIR}/clojure-1.3.0.jar"
8a4e931 @jafingerhut Make same updates to env-batch.sh as I recently made to env.sh
authored
205 elif [ "$CLJ_VERSION" == "clj-1.3-latest" ]
206 then
207 CLOJURE_JAR_DIR="${HOME}/clj/clojure"
208 CLOJURE_CLASSPATH="${CLOJURE_JAR_DIR}/clojure-1.3.0-master-SNAPSHOT.jar"
81f0263 @jafingerhut Add env-batch.sh, nearly identical to env.sh except for a few variabl…
authored
209 else
05a3f15 @jafingerhut Minor updates to some files
authored
210 1>&2 echo "$0: CLJ_VERSION='${CLJ_VERSION}' must be one of: clj-1.2 clj-1.2.1 clj-1.3-alpha1 clj-1.3-alpha3 clj-1.3-alpha4 clj-1.3-alpha5 clj-1.3-alpha6 clj-1.3-beta1 clj-1.3-beta2 clj-1.3-beta3 clj-1.3.0 clj-1.3-latest"
81f0263 @jafingerhut Add env-batch.sh, nearly identical to env.sh except for a few variabl…
authored
211 exit 1
212 fi
213
214 # Platform-specific form of Clojure object file directory
215 PS_CLJ_OBJ_DIR=".${SEP}obj${SEP}${CLJ_VERSION}"
216 PS_FULL_CLJ_CLASSPATH="${CLOJURE_CLASSPATH}${PSEP}${PS_CLJ_OBJ_DIR}"
217 CLJ_OBJ_DIR="./obj/${CLJ_VERSION}"
218
219 ######################################################################
220 # Linux/MacOS SBCL
221 ######################################################################
222 # The mandelbrot benchmark requires SBCL built with threading enabled.
223 # On a Mac, one way to get this is to install MacPorts, and then this
224 # to get the threaded version of SBCL:
225 #
226 # sudo port install sbcl@+threads
227 #
228 # I've used these lines with success on my Mac with sbcl installed via
229 # MacPorts.
230 SBCL="sbcl"
231
232 ######################################################################
233 # Linux/MacOS GHC
234 ######################################################################
235 # Glasgow Haskell Compiler location
236 GHC="ghc"
237
238 ######################################################################
239 # Linux/MacOS Perl
240 ######################################################################
241 PERL="perl"
242
243 ######################################################################
244 # Linux/MacOS Scala
245 ######################################################################
246 SCALAC="$HOME/sw/scala-2.8.1.final/bin/scalac"
247 PS_SCALA_OBJ_DIR=".${SEP}obj${SEP}scala"
248 SCALA_JAR_DIR="$HOME/sw/scala-2.8.1.final/lib"
249 SCALA_CLASSPATH="${SCALA_JAR_DIR}/scala-library.jar"
250 PS_FULL_SCALA_CLASSPATH="${SCALA_CLASSPATH}${PSEP}${PS_SCALA_OBJ_DIR}"
251
252 ######################################################################
253 # Linux/MacOS Perl
254 ######################################################################
255 JRUBY="$HOME/sw/jruby-1.5.6/bin/jruby"
256
257 else
258 2>&1 echo "In script env.sh: Unknown output from 'uname -o' command:" $OS
259 2>&1 echo "Aborting."
260 exit 1
261 fi
262
263
264 ######################################################################
265 # Common arguments for all measureproc runs:
266
267 # Using the arguments below for MP_COMMON_ARGS will cause all
268 # measurement results to be appended to an XML file $HOME/results.xml,
269 # creating it if it does not exist. This file can be converted to a
270 # CSV file, easy to import into spreadsheet programs, by running this
271 # command:
272
273 # bin/xmltable2csv $HOME/results.xml > results.csv
274
275 MP_COMMON_ARGS="--xml --log-file $HOME/results.xml"
276 #MP_COMMON_ARGS=
277
278 ######################################################################
279 # Common arguments for all measureproc runs that measure JVM runs:
280
281 # Using the longest list of arguments below for MP_ARGS_FOR_JVM_RUN
282 # will cause as many measurement details to be printed about the JVM,
283 # the OS, and garbage collection as measureproc is able to record.
284 # You might not want all of that information printed for interactive
285 # use.
286
287 MP_ARGS_FOR_JVM_RUN="--jvm-info server --jvm-gc-stats ${JVM_TYPE}"
288 #MP_ARGS_FOR_JVM_RUN="--jvm-gc-stats ${JVM_TYPE}"
289 #MP_ARGS_FOR_JVM_RUN=
290
291
292 JAVA_OBJ_DIR="./obj/java"
293 GHC_OBJ_DIR="./obj/ghc"
294 SBCL_OBJ_DIR="./obj/sbcl"
295 SCALA_OBJ_DIR="./obj/scala"
296 GCC_OBJ_DIR="./obj/gcc"
297
298 # Choose your style of Java profiling, if any.
299 #JAVA_PROFILING="-Xprof"
300 #JAVA_PROFILING="-Xrunhprof"
301 HPROF_OPTS="cpu=samples,depth=20,thread=y"
302 #JAVA_PROFILING="-agentlib:hprof=${HPROF_OPTS}"
303 JAVA_PROFILING=
304
305
306 ######################################################################
307 # Miscellaneous scripting commands
308 ######################################################################
309
310 CP="/bin/cp"
311 RM="/bin/rm"
312 DIFF="diff -c"
313
314 # On Windows, some programs produce \r\n for line endings, whereas
315 # others produces \n only. Ignore trailing carriage returns on input.
316 CMP="diff --strip-trailing-cr --brief"
317 #CMP="cmp"
ef8c8fb @jafingerhut batch.sh now deletes output files that match the expected output files
authored
318
319 cmp_and_rm_2nd_if_correct()
320 {
321 local F1="$1"
322 local F2="$2"
323 ${CMP} "${F1}" "${F2}"
324 local cmp_exit_status=$?
325 if [ $cmp_exit_status == 0 ]
326 then
327 ${RM} "${F2}"
328 fi
329 }
Something went wrong with that request. Please try again.