-
Notifications
You must be signed in to change notification settings - Fork 1
/
11_METIS.conf
57 lines (50 loc) · 1.51 KB
/
11_METIS.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
#! /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 METIS"
METIS="CMP"
VERSION_METIS="5.1.0"
FICH_METIS="metis-$VERSION_METIS.tar.gz"
LNK_METIS="http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-$VERSION_METIS.tar.gz"
BIN_METIS="$PREFIX/lib/metis"
}
# Set some vars
# this is unecessary if one want to do it manually
STEP2(){
if [ "$METIS" = "CMP" ]||[ ! "$VERSION_METIS" = "USE" ]; then
SRC_METIS="$PREFIX/src/metis-$VERSION_METIS"
BUILD_METIS="$SRC_METIS"
fi
}
# Compile metis
# you must have prepared the environment
# with appropriate exports and module load
# the simpliest way consists in
# cd $BUILD_METIS
# make config openmp=0 prefix="$BIN_METIS" shared=1 cc="$CC"
# make
# make install
STEP5(){
trap STOP ERR
if [ "$METIS" = "CMP" ]; then
echo -n "METIS "
download "$FICH_METIS" "$LNK_METIS"
if [ ! -d "$BUILD_METIS" ] ; then mkdir -p "$BUILD_METIS" ; fi ; cd "$BUILD_METIS"
stage "Building : conf" "make.1.log"
make config $([[ "$OPENMP" == "YES" ]] && echo "openmp=1") \
$([[ "$OPENMP" == "NO" ]] && echo "openmp=0") \
prefix="$BIN_METIS" shared=1 cc="$CC"
stage "make" "make.2.log"
make
stage "install" "make.3.log"
if [ -d "$BIN_METIS" ] ; then rm -r "$BIN_METIS" ;fi ;mkdir -p "$BIN_METIS"
make install
end_stage
echo -e " - \e[32m\e[1mOK\e[21m\e[0m"
fi
trap - ERR
}
"STEP$1" 2>/dev/null