-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmuffin3.install.Ubuntu.tex
More file actions
279 lines (216 loc) · 10.1 KB
/
Copy pathmuffin3.install.Ubuntu.tex
File metadata and controls
279 lines (216 loc) · 10.1 KB
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
%----------------------------------------------------------------------------------------
%----------------------------------------------------------------------------------------
%----------------------------------------------------------------------------------------
\documentclass[10pt,twoside]{article}
\usepackage[paper=letterpaper,portrait=true,margin=1.5cm,ignorehead,footnotesep=1cm]{geometry}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{paralist}
\usepackage{caption}
\usepackage{float}
\usepackage{wasysym}
\usepackage{enumitem}
\linespread{1.1}
\setlength{\pltopsep}{2.5pt}
\setlength{\plparsep}{2.5pt}
\setlength{\partopsep}{2.5pt}
\setlength{\parskip}{2.5pt}
\setitemize{noitemsep}
\setenumerate{noitemsep}
%\addtolength{\oddsidemargin}{1.0cm}
%\addtolength{\bottommargin}{1.0cm}
\title{\textit{muffin} (branch: \textbf{master.python3}) installation HOW-TO\vspace{-8mm}}
\author{}
\date{\today}
\usepackage[normalem]{ulem}
\begin{document}
%----------------------------------------------------------------------------------------
% --- BEGIN DOCUMENT --------------------------------------------------------------------
%----------------------------------------------------------------------------------------
\maketitle
%----------------------------------------------------------------------------------------
% --- cupcate ---------------------------------------------------------------------------
%----------------------------------------------------------------------------------------
\noindent This is a brief guide to installing \textbf{cGENIE.muffin} (branch: \textbf{master.python3}) under \textbf{Ubuntu}.
These instructions are valid for a fresh install of \textbf{Ubuntu} distribution version 22.04 LTS ('Jammy Jellyfish'). For a different distribution or more established installation, different or fewer respectively components may be needed to be installed and may require a little trial-and-error.
Instructions are given step-by-step, although not all the components need be installed in this order. Note that the various \textbf{netCDF} component version numbers may not be the current releases. The most recent versions can almost certainly be substituted (but not tested here) with the caveat that you may not be able to mix-and-match very old with very new libraries.
%------------------------------------------------
\vspace{1mm}\noindent\rule{4cm}{0.1mm}
%------------------------------------------------
\subsection{Preparation}
\vspace{1mm}
Get hold of a computer with \textbf{Ubuntu} installed on it. Make sure you have plugged in the network cable. Log in. Obtain a strong cup of coffee.
%------------------------------------------------
\vspace{1mm}\noindent\rule{4cm}{0.1mm}
%------------------------------------------------
\subsection{Installation}
\vspace{1mm}
\begin{enumerate}[noitemsep]
\vspace{4pt}
\item \textbf{Get the code!}
\vspace{2pt}
\\You may as well start off by cloning\footnote{If your system does not know what \textbf{git} is (it should be present by default on Ubuntu 22.04): \texttt{sudo apt install git}} the \textbf{muffin} code (although you could equally do this last).
From your home directory:
\vspace{-2pt}
\begin{verbatim}
git clone https://github.com/derpycode/cgenie.muffin.git
\end{verbatim}
\end{enumerate}
\vspace{4pt}
\noindent Then ... the following installation steps\footnote{They need not be installed in this order (and some may already exist on your system).} are in approximately the order you would encounter if you went straight to running the model test (\texttt{make testbiogem}) only having cloned the code-base and not accomplished anything particularly constructive.
%------------------------------------------------
\begin{enumerate}[noitemsep]
\setcounter{enumi}{1}
\item \textbf{make}
\vspace{-2pt}
\begin{verbatim}
sudo apt install make
\end{verbatim}
\vspace{4pt}
\item \textbf{gfortran} [FORTRAN compiler]
\vspace{-2pt}
\begin{verbatim}
sudo apt install gfortran
\end{verbatim}
\end{enumerate}
%------------------------------------------------
... and then stupid XML support, a 'xml2-config utility' (and the 'libxml2 development package') ... just because ... and then followed by a cascade of library dependencies ...
%------------------------------------------------
\newpage
%------------------------------------------------
%------------------------------------------------
\begin{enumerate}[noitemsep]
\setcounter{enumi}{3}
\item \textbf{xsltproc} ['\textit{a command line tool for applying XSLT style-sheets to XML documents}']\footnote{In the \textbf{cupcake} release we do not need this :)}
\vspace{-2pt}
\begin{verbatim}
sudo apt install xsltproc
\end{verbatim}
\vspace{2pt}
\item \textbf{libxml2-dev}
\vspace{-2pt}
\begin{verbatim}
sudo apt install libxml2-dev
\end{verbatim}
\vspace{2pt}
\item \textbf{m4}
\vspace{-2pt}
\begin{verbatim}
sudo apt install m4
\end{verbatim}
\vspace{2pt}
\item \textbf{libcurl4-openssl-dev}
\vspace{-2pt}
\begin{verbatim}
sudo apt install libcurl4-openssl-dev
\end{verbatim}
\vspace{2pt}
\item \textbf{libz-dev}
\vspace{-2pt}
\begin{verbatim}
sudo apt install libz-dev
\end{verbatim}
\vspace{2pt}
\item \textbf{libhdf5-dev}
\vspace{-2pt}
\begin{verbatim}
sudo apt install libhdf5-dev
\end{verbatim}
(If your system cannot find the \texttt{libhdf5-dev} package, try: \texttt{sudo apt update -y} first)
\end{enumerate}
%------------------------------------------------
\noindent Now(!) you are ready for \textbf{netCDF}. These libraries come rather inconveniently in multiple parts ... first we need to install the main \textbf{netCDF} \textbf{C} libraries and then the \textbf{FORTRAN} libraries that depend on the \textbf{C} libraries\footnote{The examples given are for the most recent versions of the libraries. For details/most recent version, see: \textit{https://www.unidata.ucar.edu/software/netcdf/}}\footnote{(From some random convenient download/temporary directory.)} \footnote{In \textbf{master.python3}, you no longer need the \textbf{C++} libraries :o)}.
\vspace{2pt}
%------------------------------------------------
\begin{enumerate}[noitemsep]
\setcounter{enumi}{9}
\vspace{4pt}
\item \textbf{netcdf-c} [netCDF C libraries]
\vspace{-2pt}
\begin{verbatim}
wget https://downloads.unidata.ucar.edu/netcdf-c/4.9.2/netcdf-c-4.9.2.tar.gz
tar xzf netcdf-c-4.9.2.tar.gz
cd netcdf-c-4.9.2
./configure
\end{verbatim}
At this point, you may well see: '\textit{configure: error: Can't find or link to the hdf5 library. Use --disable-hdf5, or see config.log for errors}' because the \textbf{ndf5} libraries you have just only just installed, mysteriously cannot be located ... You need to add their paths, e.g., for Ubuntu 22.04:
\vspace{-2pt}
\begin{verbatim}
export LDFLAGS="-L/usr/lib/x86_64-linux-gnu/hdf5/serial/lib"
export CFLAGS="-I/usr/lib/x86_64-linux-gnu/hdf5/serial/include"
\end{verbatim}
(If you need to find where \textbf{hdf5} is hiding: \texttt{dpkg -L libhdf5-dev}).
\vspace{2pt}
\\Repeat \texttt{./configure} if necessary and continue:
\vspace{-2pt}
\begin{verbatim}
make check
sudo make install
\end{verbatim}
\vspace{-2pt}
(\texttt{cd ..})
\end{enumerate}
%------------------------------------------------
\noindent For the next step, it can be that the libraries you have just installed cannot be 'found'. You can force an update of the library link cache by:
\vspace{-2pt}
\begin{verbatim}
sudo ldconfig
\end{verbatim}
%------------------------------------------------
\newpage
%------------------------------------------------
%------------------------------------------------
\begin{enumerate}[noitemsep]
\setcounter{enumi}{10}
\item \textbf{netcdf-fortran} [netCDF FORTRAN libraries]
\vspace{-2pt}
\begin{verbatim}
wget https://downloads.unidata.ucar.edu/ ...
... netcdf-fortran/4.6.1/netcdf-fortran-4.6.1.tar.gz
tar xzf netcdf-fortran-4.6.1.tar.gz
cd netcdf-fortran-4.6.1
./configure
make check
sudo make install
\end{verbatim}
\vspace{-2pt}
(\texttt{cd ..})
\end{enumerate}
%------------------------------------------------
%------------------------------------------------
\vspace{1mm}\noindent\rule{4cm}{0.1mm}
%------------------------------------------------
\noindent That is is for the basic installation!
%------------------------------------------------
\vspace{-1mm}\noindent\rule{4cm}{0.1mm}
%------------------------------------------------
%------------------------------------------------
%
\subsection{Testing muffin}
First, from \texttt{cgenie.muffin} make sure that you are on the correct branch:
\vspace{-5pt}\begin{verbatim}
git checkout master.python3
\end{verbatim}\vspace{-5pt}
\vspace{2mm}
\noindent To test the code installation -- change directory to \texttt{cgenie.muffin/genie-main} and type:
\vspace{-5pt}\begin{verbatim}
make testbiogem
\end{verbatim}\vspace{-5pt}
This compiles a carbon cycle enabled configuration of \textbf{muffin} and runs a short test, comparing the results against those of a pre-run experiment (also downloaded alongside the model source code). It serves to check that you have the software environment correctly configured.
\vspace{2mm}
\noindent If when running \texttt{make testbiogem} you run into issues, specifically: libraries that cannot be 'found', try forcing an update of the library link cache (the not found libraries may be links to the 'real' library and somehow this link is not working/found):
\vspace{-2pt}
\begin{verbatim}
sudo ldconfig
\end{verbatim}
If you are still unsuccessful at this point ... double-check the software and directory environment settings in \texttt{user.mak} (or \texttt{user.sh}) and for a \textbf{netCDF} error, check the value of the \texttt{NETCDF\_DIR} environment variable. (Refer to the FAQ section for addition fault-finding tips.) If environment variables are changed: before re-trying the test, you will need to type:
\vspace{-5pt}\begin{verbatim}
make cleanall
\end{verbatim}\vspace{-5pt}
%------------------------------------------------
\vspace{1mm}\noindent\rule{4cm}{0.2mm}
%------------------------------------------------
%----------------------------------------------------------------------------------------
% --- END DOCUMENT ----------------------------------------------------------------------
%----------------------------------------------------------------------------------------
\end{document}