-
Notifications
You must be signed in to change notification settings - Fork 1
/
19_SATURNE.conf
84 lines (72 loc) · 2.88 KB
/
19_SATURNE.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#! /bin/bash
shopt -s expand_aliases
# Set the version number
# and where to download the package
# this is unecessary if one want to do it manually
STEP0(){
SATURNE="CMP"
VERSION_SATURNE=${VERSION_SATURNE:="3.2.1"}
LIST_PKG="$LIST_PKG SATURNE"
BIN_SATURNE=$PREFIX/code_saturne
}
# Set some vars
# this is unecessary if one want to do it manually
STEP2(){
FICH_SATURNE="code_saturne-$VERSION_SATURNE.tar.gz"
LNK_SATURNE="http://code-saturne.org/cms/sites/default/files/releases/code_saturne-$VERSION_SATURNE.tar.gz"
SRC_SATURNE=$PREFIX/src/code_saturne-$VERSION_SATURNE
BUILD_SATURNE=$SRC_SATURNE/build
}
# Compile code_saturne
# you must have prepared the environment
# with appropriate exports and module load
# the simpliest way consists in
# cd $BUILD_SATURNE
# ./configure --prefix=$BIN_SATURNE --without-libxml2 --with-mpi=$BIN_OPENMPI \
# --disable-gui --without-salome-gui --without-salome-kernel --disable-openmp \
# --without-scotch --without-hdf5 --without-metis --with-cgns=$BIN_CGNS \
# --with-blas CPPFLAGS="-lm" --disable-shared
# make -j8
# make install
STEP7(){
trap STOP ERR
if [ "$SATURNE" = "CMP" ]; then
echo -n "CODE_SATURNE"
download "$FICH_SATURNE" "$LNK_SATURNE"
if [ ! -d "$BUILD_SATURNE" ] ; then mkdir -p "$BUILD_SATURNE" ; fi ;cd "$BUILD_SATURNE"
stage "Building : conf" "config.1.log"
export FC="$S_FC"
../configure --prefix="$BIN_SATURNE" --without-libxml2 --with-mpi="$BIN_OPENMPI"\
--disable-gui --without-salome-gui --without-salome-kernel --enable-relocatable\
$([[ "$OPENMP" == "YES" ]] && echo "--enable-openmp") \
$([[ "$OPENMP" == "NO" ]] && echo "--disable-openmp") \
$([[ ! "$VERSION_SCOTCH" == "NONE" ]] && echo "--with-scotch=$BIN_SCOTCH") \
$([[ "$VERSION_SCOTCH" == "NONE" ]] && echo "--without-scotch") \
$([[ ! "$VERSION_HDF5" == "NONE" ]] && echo "--with-hdf5=$BIN_HDF5") \
$([[ "$VERSION_HDF5" == "NONE" ]] && echo "--without-hdf5") \
$([[ ! "$VERSION_PARMETIS" == "NONE" ]] && echo "--with-metis=$BIN_PARMETIS") \
$([[ "$VERSION_PARMETIS" == "NONE" ]] && echo "--without-metis") \
$([[ ! "$VERSION_CGNS" == "NONE" ]] && echo "--with-cgns=$BIN_CGNS") \
$([[ "$VERSION_CGNS" == "NONE" ]] && echo "--without-cgns") \
--with-blas CPPFLAGS="-lm" \
--disable-shared $EXTRA_CONF
stage "make" "make.1.log"
make -j8
# stage "docs" "make.2.log" # <------------------------ If you want docs
# make pdf
stage "install" "make.3.log"
if [ -d "$BIN_SATURNE" ] ; then rm -r "$BIN_SATURNE" ;fi ;mkdir -p "$BIN_SATURNE"
make install
# stage "pdf" "make.4.log" # <------------------------- If you want docs
# make install-pdf
end_stage
echo -e " - \e[32m\e[1mOK\e[21m\e[0m"
fi
trap - ERR
}
STEP9(){
echo "if [ -f /etc/bash_completion ] && ! shopt -oq posix; then"
echo " . $BIN_SATURNE/etc/bash_completion.d/code_saturne"
echo "fi"
}
"STEP$1" 2>/dev/null