-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.rtm
executable file
·190 lines (164 loc) · 5.54 KB
/
build.rtm
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
#!/bin/bash
# -*- shell-script -*-
#-----------------------------------------------------------------------
#XALT: A tool that tracks users jobs and environments on a cluster.
#Copyright (C) 2013-2014 University of Texas at Austin Copyright (C)
#2013-2014 University of Tennessee
#
# This library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA
#-----------------------------------------------------------------------
PKG_VERSION=`cat .version`
echo Making Version: $PKG_VERSION
runMe()
{
local cmdA=("$@")
local j
local jj
local i
local ignoreError
local j=0
for i in "${cmdA[@]}" ; do
ignoreError=
if [ "x${i:0:1}" = x- ]; then
i=${i:1}
ignoreError=1
fi
j=$((j+1))
jj=$(printf "%02d" $j)
echo
echo "%%---------------------------------%%"
echo " " $jj: $i
echo "%%---------------------------------%%"
echo
eval $i
if [ -z "$ignoreError" -a $? != 0 ]; then
break
fi
done
}
if [ -z "$SYSHOST" ]; then
myhost=$(hostname -f)
myhost=${myhost%.tacc.utexas.edu}
myhost=${myhost%.local}
first=${myhost%%.*}
if [ "$first" = xalt ]; then
export SYSHOST=xalt
else
export SYSHOST=${myhost#*.}
fi
fi
SETUP_CMD=
echo SYSHOST: $SYSHOST
case $SYSHOST in
rios | jedrik | lmod-test | xalt-lmod)
echo "Building on $SYSHOST using rios rules"
SUDO="sudo"
base="/opt/apps"
CONF_OPTS="--with-etcDir=/opt/moduleData --with-syshostConfig=nth_name:2 --with-config=Config/rtm_config.py"
;;
vmijo)
echo "Building on vmijo"
SUDO="sudo"
base="/opt/apps"
CONF_OPTS="--with-etcDir=/opt/moduleData --with-syshostConfig=nth_name:2 --with-config=Config/rtm_config.py \
--prefix=/opt/apps/xalt/$PKG_VERSION --with-siteControlledPrefix=yes"
;;
xalt)
echo "Building xalt"
base="$HOME/l/pkg"
CONF_OPTS="--with-etcDir=$HOME/l/moduleData --with-syshostConfig=nth_name:2 --with-config=Config/TACC_config.py"
;;
maverick)
echo "Building maverick"
base="$HOME/l/pkg"
CONF_OPTS="CXX=$PWD/g++.sh --with-etcDir=$HOME/l/moduleData --with-syshostConfig=nth_name:2 --with-config=Config/TACC_config.py --with-transmission=syslog --with-MySQL=no --with-cxxLDLibraryPath=/opt/apps/gcc/4.9.1/lib64:/opt/apps/gcc/4.9.1/lib"
MAKE_OPTS="CXX=$PWD/g++.sh"
SETUP_CMD="module unload $LMOD_FAMILY_MPI $LMOD_FAMILY_COMPILER xalt"
;;
maverick2)
echo "Building maverick2"
base="$HOME/l/pkg"
CONF_OPTS="--with-syshostConfig=nth_name:2 --with-config=Config/TACC_config.py --with-transmission=file --with-MySQL=no --with-trackGPU=yes"
SETUP_CMD="module unload $LMOD_FAMILY_MPI $LMOD_FAMILY_COMPILER xalt"
;;
stampede2)
echo "Building s2"
base="$HOME/l/pkg"
CONF_OPTS=" --with-etcDir=$HOME/l/moduleData --with-syshostConfig=nth_name:2 --with-config=Config/TACC_config.py --with-transmission=file --with-MySQL=no"
SETUP_CMD="module unload $LMOD_FAMILY_MPI $LMOD_FAMILY_COMPILER xalt"
;;
frontera)
echo "Building $SYSHOST"
base="$HOME/l/pkg"
CONF_OPTS=" --with-etcDir=$HOME/l/moduleData --with-syshostConfig=nth_name:2 --with-config=Config/TACC_config.py --with-transmission=file --with-MySQL=no"
SETUP_CMD="module unload $LMOD_FAMILY_MPI $LMOD_FAMILY_COMPILER xalt"
;;
longhorn)
echo "Building $SYSHOST"
base="$HOME/l/pkg"
CONF_OPTS=" --with-etcDir=$HOME/l/moduleData --with-syshostConfig=nth_name:2 --with-config=Config/TACC_config.py --with-transmission=file --with-MySQL=no --with-trackGPU=yes"
SETUP_CMD="module unload $LMOD_FAMILY_MPI $LMOD_FAMILY_COMPILER xalt"
;;
ls5 )
echo "Building ls5"
base="$HOME/l/pkg"
EXTRA=""
if [ "$USER" = swtools ]; then
EXTRA="--with-xaltFilePrefix=/scratch/projects/XALT"
fi
CONF_OPTS="--with-syshostConfig=hardcode:ls5 --with-config=Config/TACC_config.py --with-transmission=file --with-MySQL=no $EXTRA" #--with-trackGPU=yes
SETUP_CMD="module unload $LMOD_FAMILY_MPI $LMOD_FAMILY_COMPILER xalt"
;;
gligar.os)
echo "gligar.os"
base="$HOME/l/pkg"
SETUP_CMD="module load mysqlclient/1.3.7-foss-2016a-Python-2.7.11"
CONF_OPTS="--with-etcDir=$HOME/l/moduleData --with-syshostConfig=nth_name:2 --with-config=Config/UGENT_config.py --with-transmission=file"
;;
*)
echo "default"
base="$HOME/l/pkg"
;;
esac
BASE_DIR=$base
pkgName=xalt
PKG=$BASE_DIR
$SUDO rm -rf $PKG/xalt/$PKG_VERSION
MAKE=make
command -v remake 2>&1 > /dev/null
if [ "$?" = 0 ]; then
MAKE=remake
fi
unset LD_PRELOAD
unload_xalt ()
{
type module > /dev/null 2>&1
if [ "$?" = 0 ]; then
echo "module unload xalt"
module unload xalt
fi
}
cmdA=("unload_xalt"
"-$MAKE distclean"
"-rm -rf $PKG/xalt/$PKG_VERSION"
"-rm -f src/*.o src/*.d libuuid/src/*.o"
"$SETUP_CMD"
"./configure --prefix=$PKG $CONF_OPTS"
"$SUDO $MAKE $MAKE_OPTS install"
"$SUDO $MAKE $MAKE_OPTS Inst_TACC"
"rm -f config.log"
)
runMe "${cmdA[@]}"