-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·53 lines (44 loc) · 1.39 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
48
49
50
51
52
53
#!/bin/bash
DIR=$(dirname "$0")
LIB="$DIR/build/src/libompdart.so"
PLUGIN="ompdart"
CFLAGS=-fopenmp
COMMAND="clang $CFLAGS -Xclang -load -Xclang $LIB -Xclang -plugin -Xclang $PLUGIN"
while [ "$1" != "" ]; do
case $1 in
-h | --help )
shift;
COMMAND="$COMMAND -Xclang -plugin-arg-$PLUGIN -Xclang --help"
;;
-i | --input)
shift;
COMMAND="$COMMAND -c $1"
shift;
;;
-o | --output)
shift;
COMMAND="$COMMAND -Xclang -plugin-arg-$PLUGIN -Xclang --output -Xclang -plugin-arg-$PLUGIN -Xclang $1"
shift;
;;
-a | --aggresive-cross-function)
shift;
COMMAND="$COMMAND -Xclang -plugin-arg-$PLUGIN -Xclang -a"
shift;
;;
-d | --debug)
shift;
COMMAND="gdb --args $COMMAND"
;;
* )
break;
;;
esac
done
INFILENAME=$1
OUTFILENAME=$2
set -x
$COMMAND
# help
# clang -Xclang -load -Xclang $LIB -Xclang -plugin -Xclang $PLUGIN -Xclang -plugin-arg-$PLUGIN -Xclang --help -fopenmp -c $FILENAME
# clang -Xclang -load -Xclang $LIB -Xclang -plugin -Xclang $PLUGIN -Xclang -plugin-arg-$PLUGIN -Xclang --output -Xclang -plugin-arg-$PLUGIN -Xclang "$OUTFILENAME" -fopenmp -c $INFILENAME
# gdb --args clang -Xclang -load -Xclang $LIB -Xclang -plugin -Xclang $PLUGIN -fopenmp -c $FILENAME