-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.sh
executable file
·55 lines (49 loc) · 1.47 KB
/
build.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
54
55
#!/bin/sh
# You need to source the settings.sh file (source /path/to/GE/default/common/settings.sh)
# of your Open Cluster Scheduler or Grid Engine installation before building. "default"
# is the CELL name, which can be different in your installation.
if [ "$1" = "--drmaa" ]; then
if [ -z "$2" ]
then
echo "usage: $0 --drmaa <drmaa root>"
exit 1
else
if [ -d $2 ]
then
export CGO_LDFLAGS="-L$2/lib"
export CGO_CFLAGS="-I$2/include"
else
echo "$2 does not exist or is not a directory."
exit 1
fi
fi
elif [ "$1" = "--torque" ]; then
export CGO_CFLAGS='-DTORQUE -I/usr/include/torque'
elif [ "$1" = "--slurm" ]; then
export CGO_CFLAGS='-DSLURM'
if [ -n "$2" ]; then
SLURM_DRMAA_ROOT=$2
fi
if [ -n "$SLURM_DRMAA_ROOT" ]; then
export CGO_LDFLAGS="-L$SLURM_DRMAA_ROOT/lib"
export CGO_CFLAGS="-DSLURM -I$SLURM_DRMAA_ROOT/include"
fi
export LD_LIBRARY_PATH="$SLURM_DRMAA_ROOT/lib"
else
# Open Cluster Scheduler provides out-of-the-box compatibility.
if [ "$SGE_ROOT" = "" ]; then
echo "Please source your Open Cluster Scheduler / Grid Engine settings.(c)sh file"
exit 1
fi
ARCH=`$SGE_ROOT/util/arch`
export CGO_LDFLAGS="-L$SGE_ROOT/lib/$ARCH/"
export CGO_CFLAGS="-I$SGE_ROOT/include"
# adapt to Son of Grid Engine's header file changes
if [ "$1" = "--sog" ]; then
echo "SOG"
export CGO_CFLAGS="-DSOG -I$SGE_ROOT/include"
fi
fi
go test -v
go build -a
go install