-
Notifications
You must be signed in to change notification settings - Fork 0
/
chamois-singularity-debian-bullseye.def
167 lines (149 loc) · 7.83 KB
/
chamois-singularity-debian-bullseye.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
BootStrap: docker
From: debian:bullseye
%setup
# THESE ARE DIRECTORIES REQUIRED FOR COMMON HPC BINDS
mkdir $SINGULARITY_ROOTFS/scratch
mkdir $SINGULARITY_ROOTFS/data
# THIS IS THE DIRECTORY FOR ALL MOOSE RELATED BINARIES
mkdir $SINGULARITY_ROOTFS/projects
# COPY MOOSE
cp -r ${MOOSE_DIR} ${SINGULARITY_ROOTFS}/projects/moose/
# COPY CHAMOIS APP
cp -r ${CHAMOIS_DIR} ${SINGULARITY_ROOTFS}/projects/chamois/
# COPY MARMOT FOR CONSTITUTIVE MODELS
cp -r ${MARMOT_DIR} ${SINGULARITY_ROOTFS}/projects/marmot/
%post
#################################################################################
# #
# MAKE PARALLEL JOBS #
# #
#################################################################################
if [ -n "${MAKE_JOBS+set}" ];
then
echo "Using ${MAKE_JOBS} make jobs"
else
MAKE_JOBS=1
echo "Using ${MAKE_JOBS} make jobs"
echo "Set \$SINGULARITYENV_MAKE_JOBS to determine the number of make jobs"
fi
#################################################################################
# #
# BASIC SOFTWARE #
# #
#################################################################################
apt-get update
apt-get -y upgrade
apt-get -y install apt-utils apt-file vim less gcc g++ make wget openssh-client \
flex bison gfortran git cmake infiniband-diags ibverbs-utils libibverbs-dev \
libpng-dev
#################################################################################
# #
# PYTHON 3.9 #
# #
#################################################################################
apt-get -y install python3 python-dev python3-distutils python3-apt
#################################################################################
# #
# EIGEN LATEST #
# #
#################################################################################
cd $SINGULARITY_TMPDIR
git clone https://gitlab.com/libeigen/eigen.git
cd eigen
mkdir build
cd build
cmake -DBUILD_TESTING=OFF ../
make install
#################################################################################
# #
# FASTOR LATEST #
# #
#################################################################################
cd $SINGULARITY_TMPDIR
git clone https://github.com/romeric/Fastor.git
cd Fastor
cmake -DBUILD_TESTING=OFF .
make install
#################################################################################
# #
# OPENMPI 4.0.2 #
# #
#################################################################################
cd $SINGULARITY_TMPDIR
wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.2.tar.gz
tar xzf openmpi-4.0.2.tar.gz
cd openmpi-4.0.2
./configure --prefix=/usr/local
make -j $MAKE_JOBS install
ldconfig
#################################################################################
# #
# CLEANUP #
# #
#################################################################################
apt-get clean
#################################################################################
# #
# ENV. VARS #
# #
#################################################################################
export CC=mpicc
export CXX=mpicxx
export F90=mpif90
export F77=mpif77
export FC=mpif90
#################################################################################
# BUILD PETSC #
# (1) BUILD LIBMESH #
# (LIBMESH OPT ONLY) #
#################################################################################
cd /projects/moose
./scripts/update_and_rebuild_petsc.sh
METHODS=opt ./scripts/update_and_rebuild_libmesh.sh
#################################################################################
# #
# (2) BUILD MARMOT #
# #
#################################################################################
cd /projects/marmot
mkdir build_debian11_gcc10
cd build_debian11_gcc10
cmake \
-DCORE_MODULES='MarmotMechanicsCore;MarmotCosseratCore;MarmotMicromorphicCore' \
-DMATERIAL_MODULES='all' \
-DELEMENT_MODULES='none' \
../
make -j $MAKE_JOBS install
#################################################################################
# #
# (3) BUILD CHAMOIS #
# #
#################################################################################
cd /projects/chamois
make clean
make -B -j $MAKE_JOBS
#################################################################################
# #
# (optional) DELETE GIT REPOS #
# #
#################################################################################
if [ -n "${DELETE_GIT+set}" ];
then
cd /projects/moose
echo "Deleting .git repositories"
find . -maxdepth 10 -type d -name '.git' -prune -exec rm -rf {} +
fi
%environment
# LOCALE
export LC_ALL=C
# SET COMPILERS FOR MOOSE
export CC=mpicc
export CXX=mpicxx
export F90=mpif90
export F77=mpif77
export FC=mpif90
# ENSURE THAT NO OPENMP PARALLELIZATION IS USED
# THIS USUALLY A GOOD IDEA FOR MPI PARALLELIZATION
export OMP_NUM_THREADS=1
%labels
Maintainer matthiasneuner