-
Notifications
You must be signed in to change notification settings - Fork 1
/
15_SCOTCH.conf
62 lines (55 loc) · 1.9 KB
/
15_SCOTCH.conf
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
#! /bin/bash
shopt -s expand_aliases
# If user version set the version number
# and where to download the package
# this is unecessary if one want to do it manually
STEP1(){
LIST_PKG="$LIST_PKG SCOTCH"
SCOTCH="CMP"
VERSION_SCOTCH="6.0.0"
FICH_SCOTCH="scotch_$VERSION_SCOTCH.tar.gz"
LNK_SCOTCH="https://gforge.inria.fr/frs/download.php/file/31831/scotch_$VERSION_SCOTCH.tar.gz"
BIN_SCOTCH="$PREFIX/lib/scotch"
}
# Set some vars
# this is unecessary if one want to do it manually
STEP2(){
if [ "$SCOTCH" = "CMP" ]||[ "$SCOTCH" = "USE" ]; then
SRC_SCOTCH="$PREFIX/src/scotch_$VERSION_SCOTCH"
BUILD_SCOTCH="$SRC_SCOTCH/src"
fi
}
# Compile hdf5
# you must have prepared the environment
# with appropriate exports and module load
# the simpliest way consists in
# cd $BUILD_SCOTCH
# create Makefile.inc inspired by the content of RESSOURCES
# make -j8 ptscotch
# make prefix="$BIN_SCOTCH" install
STEP5(){
trap STOP ERR
if [ "$SCOTCH" = "CMP" ]; then
echo -n "SCOTCH "
download "$FICH_SCOTCH" "$LNK_SCOTCH"
if [ ! -d "$BUILD_SCOTCH" ] ; then mkdir -p "$BUILD_SCOTCH" ; fi ;cd "$BUILD_SCOTCH"
stage "Building : conf" "config.1.log"
NCFLAGS=$(echo "$CFLAGS" $([[ "$OPENMP" == "YES" ]] && echo " -DCOMMON_PTHREAD "))
tac "$SCRIPTPATH/RESSOURCES" \
| grep 'MAKEFILE.IN.SCOTCH BEGIN' -B 50 -m1 | tac\
| grep 'MAKEFILE.IN.SCOTCH END' -B 50 -m1 | head -n-1 | tail -n+2 \
| sed "s:#CFLAGS#:$NCFLAGS:g" \
| sed "s:#LDFLAGS#:$LDFLAGS:g" \
| sed "s:#S_CC#:$S_CC:g" \
| sed "s:#P_CC#:$P_CC:g" > ./Makefile.inc
stage "make" "make.1.log"
make -j8 ptscotch
stage "install" "make.2.log"
if [ -d "$BIN_SCOTCH" ] ; then rm -r "$BIN_SCOTCH" ;fi ;mkdir -p "$BIN_SCOTCH"
make prefix="$BIN_SCOTCH" install
end_stage
echo -e " - \e[32m\e[1mOK\e[21m\e[0m"
fi
trap - ERR
}
"STEP$1" 2>/dev/null