forked from CovertLab/WholeCell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·47 lines (41 loc) · 1.42 KB
/
run.sh
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
#!/bin/sh
#
# Compiles and runs tests. Arguments:
# 1. target name (e.g. "runMediumTests" for runMediumTests.m)
# 2. path to MATLAB Compiler Runtime (e.g. "/share/apps/MATLAB/MATLAB_Compiler_Runtime/v714")
# 3. File to write MATLAB stdout
pathToBuildAndBuild=$1
if [[ $pathToBuildAndBuild =~ "^(.*?)/([^/]+)$" ]]
then
build=${BASH_REMATCH[2]}
pathToBuild=${BASH_REMATCH[1]}
else
build=$pathToBuildAndBuild
pathToBuild='bin'
fi
if [ ! -f "$build.m" ]
then
echo No such file: $build.m
exit 1
fi
echo Running $build...
export MCR_CACHE_ROOT=/tmp/mcr_cache_$$
export XAPPLRESDIR=/usr/local/bin/MATLAB/MATLAB_Compiler_Runtime/v716/X11/app-defaults
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/bin/MATLAB/MATLAB_Compiler_Runtime/v716/runtime/glnxa64:/usr/local/bin/MATLAB/MATLAB_Compiler_Runtime/v716/sys/os/glnxa64:/usr/local/bin/MATLAB/MATLAB_Compiler_Runtime/v716/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:/usr/local/bin/MATLAB/MATLAB_Compiler_Runtime/v716/sys/java/jre/glnxa64/jre/lib/amd64/server:/usr/local/bin/MATLAB/MATLAB_Compiler_Runtime/v716/sys/java/jre/glnxa64/jre/lib/amd64
mkdir -p $MCR_CACHE_ROOT
rm -rf $MCR_CACHE_ROOT/*
pathToRunTime=$2
outFile=$3
shift; shift; shift;
if [ "$outFile" == "" ]; then
$pathToBuild/$build/run_$build.sh $pathToRunTime
else
$pathToBuild/$build/run_$build.sh $pathToRunTime $* | tee $outFile
fi
status=$?
rm -rf $MCR_CACHE_ROOT
if [[ $status -ne 0 ]]
then
exit 1
fi
exit 0