forked from areinsvo/p2z-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathO2GBuild.script
executable file
·51 lines (41 loc) · 1.22 KB
/
O2GBuild.script
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
#! /bin/bash
if [ $# -eq 2 ]; then
ompaccInter=$1
inputFile="$2"
elif [ $# -eq 1 ]; then
ompaccInter=$1
inputFile="propagate-toz-test_OpenACC.c"
else
ompaccInter=0
inputFile="propagate-toz-test_OpenACC.c"
fi
if [ ! -f "./src/$inputFile" ]; then
echo "input file, ./src/$inputFile does not exits; exit"
exit
fi
verLevel=0
if [ "$openarc" == "" ] || [ ! -d "${openarc}" ]; then
echo "Environment variable, openarc, should be set to use this script; exit"
exit
fi
openarcrt="${openarc}/openarcrt"
openarclib="${openarc}/lib"
if [ ! -f "openarcConf.txt" ]; then
cp "openarcConf_NORMAL.txt" "openarcConf.txt"
fi
if [ ! -d ./bin ]; then
mkdir bin
fi
if [ "$openarcrt" != "" ]; then
mv "openarcConf.txt" "openarcConf.txt_tmp"
cat "openarcConf.txt_tmp" | sed "s|__openarcrt__|${openarcrt}|g" > "openarcConf.txt"
rm "openarcConf.txt_tmp"
fi
java -classpath $openarclib/cetus.jar:$openarclib/antlr.jar openacc.exec.ACC2GPUDriver -verbosity=${verLevel} -ompaccInter=${ompaccInter} -gpuConfFile=openarcConf.txt ./src/$inputFile
echo ""
echo "====> To compile the translated output file:"
echo "\$ make COMPILER=openarc MODE=acc"
echo ""
echo "====> To run the compiled binary:"
echo "\$ cd bin; propagate_openarc_acc"
echo ""