-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgotm.def
70 lines (53 loc) · 1.84 KB
/
gotm.def
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
Bootstrap: localimage
From: /home/singularity/baseOS.sif
####
##
## Authors: Carsten Lackner, Technische Universität Berlin <carsten.lackner@tu-berlin.de>
## Michael Wathen, Plymouth Marine Laboratory <miwa@pml.ac.uk>
##
## Definition file for building XIOS Singularity Containers
##
#####
%files
/home/singularity/gotm.zip
%post
BASE=/home/singularity
cd $BASE
unzip gotm.zip
echo "Cloning ERSEM"
#git clone -b master --single-branch https://github.com/pmlmodelling/ersem.git ersem
echo "Cloning FABM"
#git clone https://github.com/fabm-model/fabm.git fabm
echo "Cloning GOTM"
#git clone -b v6.0 --single-branch https://github.com/gotm-model/code.git gotm
#cd gotm && git submodule update --init --recursive && cd ..
GOTM_BASE=$BASE/gotm
FABM_BASE=$BASE/fabm
ERSEM_BASE=$BASE/ersem
#alias nc-config='/opt/netcdf/install/bin/nc-config'
#alias nf-config='/opt/netcdf/install/bin/nf-config'
NETCDF=/opt/netcdf/install
echo "Compiling gotm"
# baseOS does not know nc-config, we need to specify netcdf include and lib
mkdir /opt/gotm && cd /opt/gotm
cmake $GOTM_BASE -DFABM_BASE=$FABM_BASE -DFABM_ERSEM_BASE=$ERSEM_BASE -DNetCDF_INCLUDE_DIRS=$NETCDF/include -DNetCDF_LIBRARIES=$NETCDF/lib
#-DNetCDF_CONFIG_EXECUTABLE=$NETCDF/bin/nc-config
#-DNetCDF_INCLUDE_DIRS=$NETCDF/include
#-DNetCDF_LIBRARIES=$NETCDF/lib
make install -j $CPU
rm -r $GOTM_BASE
rm -r $FABM_BASE
rm -r $ERSEM_BASE
echo "Finished"
%environment
export GOTM_DIR=/home/singularity/gotm_build
export GOTM_HOME=$GOTM_DIR
%runscript
#!/bin/bash
/opt/gotm/gotm
%labels
Author carsten.lackner@tu-berlin.de
%help
The definition file used to build GOTM:
To build the container, run
singularity build gotm.sif /home/singularity/gotm.def