-
Notifications
You must be signed in to change notification settings - Fork 1
/
14_CGNS.conf
64 lines (55 loc) · 2.15 KB
/
14_CGNS.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
#! /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 CGNS"
CGNS="CMP"
VERSION_CGNS="3.2.1"
FICH_CGNS="v$VERSION_CGNS.tar.gz"
LNK_CGNS="https://github.com/CGNS/CGNS/archive/v$VERSION_CGNS.tar.gz"
BIN_CGNS="$PREFIX/lib/cgns"
}
# Set some vars
# this is unecessary if one want to do it manually
STEP2(){
if [ "$CGNS" = "CMP" ]||[ "$CGNS" = "USE" ]; then
SRC_CGNS="$PREFIX/src/CGNS-$VERSION_CGNS"
BUILD_CGNS="$SRC_CGNS/build"
fi
}
# Compile cgns
# you must have prepared the environment
# with appropriate exports and module load
# the simpliest way consists in
# cd $BUILD_CGNS
# cmake .. -DCMAKE_INSTALL_PREFIX:PATH="$BIN_CGNS" -DENABLE_FORTRAN:STRING=YES \
# -DMPI_C_COMPILER:FILEPATH="$CC" -DMPI_Fortran_COMPILER:FILEPATH="$FC" \
# -DMPIEXEC:FILEPATH="$BIN_OPENMPI/bin/mpiexec" -DENABLE_HDF5:BOOL=YES \
# -DHDF5_NEED_ZLIB:BOOL=YES -DHDF5_INCLUDE_PATH:PATH="$BIN_HDF5/include/" \
# -DHDF5_NEED_MPI:BOOL=YES -DHDF5_LIBRARY:FILEPATH="$BIN_HDF5/lib/libhdf5.a"
# make -j8
# make install
STEP5(){
trap STOP ERR
if [ "$CGNS" = "CMP" ]; then
echo -n "CGNS "
download "$FICH_CGNS" "$LNK_CGNS"
if [ ! -d "$BUILD_CGNS" ] ; then mkdir -p "$BUILD_CGNS" ; fi; cd "$BUILD_CGNS"
stage "Building : conf" "config.1.log"
cmake .. -DCMAKE_INSTALL_PREFIX:PATH="$BIN_CGNS" -DCGNS_ENABLE_FORTRAN:STRING=YES \
-DMPI_C_COMPILER:FILEPATH="$CC" -DMPI_Fortran_COMPILER:FILEPATH="$FC" -DMPIEXEC:FILEPATH="$BIN_OPENMPI/bin/mpiexec" \
$([[ ! "$VERSION_HDF5" == "NONE" ]] && echo " -DCGNS_ENABLE_HDF5:BOOL=YES -DHDF5_NEED_ZLIB:BOOL=YES -DHDF5_INCLUDE_PATH:PATH=$BIN_HDF5/include/") \
$([[ ! "$VERSION_HDF5" == "NONE" ]] && echo " -DHDF5_NEED_MPI:BOOL=YES -DHDF5_LIBRARY:FILEPATH=$BIN_HDF5/lib/libhdf5.a")
stage "make" "make.1.log"
make -j8
stage "install" "make.2.log"
if [ -d "$BIN_CGNS" ] ; then rm -r "$BIN_CGNS" ;fi ;mkdir -p "$BIN_CGNS"
make install
end_stage
echo -e " - \e[32m\e[1mOK\e[21m\e[0m"
fi
trap - ERR
}
"STEP$1" 2>/dev/null