-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path10.build-final.sh
executable file
·82 lines (67 loc) · 2.24 KB
/
10.build-final.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
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
#!/bin/bash
PREFIX="lcc"
LOG="$PWD/single.log"
set -o pipefail
# ------------------------------------------------------------------------------
if [ -z "$AMS_ROOT_V9" ]; then
echo "ERROR: This installation script works only in the Infinity environment!"
exit 1
fi
module add qt:5.15.3
# ------------------------------------
# determine number of available CPUs if not specified
if [ -z "$N" ]; then
N=1
type nproc &> /dev/null
if type nproc &> /dev/null; then
N=`nproc --all`
fi
if [ "$N" -gt 8 ]; then
N=8
fi
fi
# ------------------------------------------------------------------------------
# run pre-installation hook if available
if [ -f ./preinstall-hook ]; then
source ./preinstall-hook || exit 1
fi
# names ------------------------------
NAME="cats"
ARCH="m64-ub22"
MODE="single"
echo ""
echo "Build: $NAME:$VERS:$ARCH:$MODE"
echo ""
# build and install software ---------
cmake -DCMAKE_INSTALL_PREFIX="$SOFTREPO/$PREFIX/$NAME/$VERS/$ARCH/$MODE" . | tee $LOG
make -j "$N" install | tee -a $LOG
if [ $? -ne 0 ]; then exit 1; fi
# RT#1262217
cp /usr/lib/x86_64-linux-gnu/libgfortran.so.4 $SOFTREPO/$PREFIX/$NAME/$VERS/$ARCH/$MODE/lib/
cp /usr/lib/x86_64-linux-gnu/libopenblas.so.0 $SOFTREPO/$PREFIX/$NAME/$VERS/$ARCH/$MODE/lib/
# prepare build file -----------------
SOFTBLDS="$SOFTREPO/$PREFIX/_ams_bundle/blds/"
cd $SOFTBLDS || exit 1
VERIDX=`ams-bundle newverindex $NAME:$VERS:$ARCH:$MODE`
cat > $NAME:$VERS:$ARCH:$MODE.bld << EOF
<?xml version="1.0" encoding="UTF-8"?>
<!-- Advanced Module System (AMS) build file -->
<build name="$NAME" ver="$VERS" arch="$ARCH" mode="$MODE" verindx="$VERIDX">
<setup>
<variable name="AMS_PACKAGE_DIR" value="$PREFIX/$NAME/$VERS/$ARCH/$MODE" operation="set" priority="modaction"/>
<variable name="PATH" value="\$SOFTREPO/$PREFIX/$NAME/$VERS/$ARCH/$MODE/bin" operation="prepend"/>
</setup>
<deps>
<dep name="libfftw3-dev" type="deb"/>
<dep name="libreadline8-dev" type="deb"/>
<dep name="qt:5.15.3" type="sync"/>
</deps>
</build>
EOF
if [ $? -ne 0 ]; then exit 1; fi
echo ""
echo "Rebuilding bundle ..."
ams-bundle rebuild | tee -a $LOG
if [ $? -ne 0 ]; then exit 1; fi
echo "LOG: $LOG"
echo ""