duneeasyconfig.sh 1.74 KB
Newer Older
Praetorius, Simon's avatar
Praetorius, Simon committed
1
2
#!/bin/bash

Praetorius, Simon's avatar
Praetorius, Simon committed
3
if [[ $# -ne 2 ]]; then
Praetorius, Simon's avatar
Praetorius, Simon committed
4
  echo "usage: $0 dune-module (core|staging|extensions|...)"
Praetorius, Simon's avatar
Praetorius, Simon committed
5
  exit 1
Praetorius, Simon's avatar
Praetorius, Simon committed
6
7
fi

Praetorius, Simon's avatar
Praetorius, Simon committed
8
9
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." >/dev/null && pwd )"

Praetorius, Simon's avatar
Praetorius, Simon committed
10
11
12
13
14
15
MODULE=$1
GROUP=$2

TOOLCHAIN="foss"
TOOLCHAIN_VERSION="2018a"

Praetorius, Simon's avatar
Praetorius, Simon committed
16
OUT_DIR=${DIR}/modules
Praetorius, Simon's avatar
Praetorius, Simon committed
17
mkdir -p ${DIR}/modules/d/${MODULE}
Praetorius, Simon's avatar
Praetorius, Simon committed
18
19
20
21
22
23
24
25
26
27
28
29

GIT_REPO="https://gitlab.dune-project.org/${GROUP}/${MODULE}.git"
GIT_DIR="/tmp/${USER}/dune/${GROUP}/${MODULE}"

mkdir -p ${GIT_DIR}
rm -rf ${GIT_DIR}
module load git
git clone ${GIT_REPO} ${GIT_DIR}
cd ${GIT_DIR}

# parse dune-module file
VERSION=`date +%Y.%m.%d`
30
DEPENDENCIES=$(python ${DIR}/tools/parse_dune.module.py ${GIT_DIR}/dune.module)
Praetorius, Simon's avatar
Praetorius, Simon committed
31

Praetorius, Simon's avatar
Praetorius, Simon committed
32
git archive --format=tar.gz --prefix=${MODULE}-v${VERSION}/ HEAD > ${DIR}/modules/d/${MODULE}/${MODULE}-v${VERSION}.tar.gz
Praetorius, Simon's avatar
Praetorius, Simon committed
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

EASYCONFIG="${OUT_DIR}/${MODULE}-${VERSION}-${TOOLCHAIN}-${TOOLCHAIN_VERSION}.eb"
cat >${EASYCONFIG} <<EOL
name = '${MODULE}'
version = '${VERSION}'

homepage = 'http://www.dune-project.org'
description = """DUNE, the Distributed and Unified Numerics Environment is a modular toolbox for solving partial differential equations (PDEs) with grid-based methods."""

toolchain = {'name': '${TOOLCHAIN}', 'version': '${TOOLCHAIN_VERSION}'}

sources = ['${MODULE}-v${VERSION}.tar.gz']
dependencies = [
${DEPENDENCIES}
]

easyblock = 'CMakeMake'

start_dir = '%(builddir)s'
configopts = ' -DCMAKE_BUILD_TYPE=Release \${CMAKE_FLAGS}'
srcdir = './%(namelower)s-v%(version)s/'

sanity_check_paths = {
56
  'files': ['lib/dunecontrol/%(namelower)s/dune.module'],
Praetorius, Simon's avatar
Praetorius, Simon committed
57
58
59
60
61
62
63
64
65
66
  'dirs': ['include/dune/']
}

modextrapaths = { 'DUNE_CONTROL_PATH': '.', 'CMAKE_PREFIX_PATH': '.' }
moduleclass = 'dune'
EOL

module unload git
module load EasyBuild

Praetorius, Simon's avatar
Praetorius, Simon committed
67
cd ${DIR}
68
eb ${EASYCONFIG} --moduleclasses=dune --inject-checksums
Praetorius, Simon's avatar
Praetorius, Simon committed
69
70
rm ${EASYCONFIG}.bak_*