1 |
edhill |
1.1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
2 |
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
3 |
|
|
|
4 |
|
|
<html xmlns="http://www.w3.org/1999/xhtml"> |
5 |
|
|
<head> |
6 |
|
|
<meta name="generator" content="HTML Tidy, see www.w3.org" /> |
7 |
|
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> |
8 |
|
|
<base href="http:/mitgcm.org" /> |
9 |
|
|
|
10 |
|
|
<!-- Hinting for menu generation --> |
11 |
|
|
<meta name="add_name_0" content="Source Code" /> |
12 |
|
|
<meta name="add_name_1" content="Using CVS" /> |
13 |
|
|
<meta name="add_name_2" content="" /> |
14 |
|
|
<meta name="add_title" content="Using CVS" /> |
15 |
|
|
<!-- Hinting for menu generation --> |
16 |
|
|
|
17 |
|
|
<style type="text/css"> |
18 |
|
|
span.c2 {font-size: 110%} |
19 |
|
|
div.c1 {text-align: center} |
20 |
|
|
</style> |
21 |
|
|
</head> |
22 |
|
|
|
23 |
|
|
<body> |
24 |
jmc |
1.15 |
|
25 |
edhill |
1.1 |
<center> |
26 |
|
|
<h3>Obtaining the MITgcm Source using CVS</h3> |
27 |
|
|
</center> |
28 |
|
|
|
29 |
|
|
<h4>Using CVS "pserver" for Anonymous Access</h4> |
30 |
|
|
|
31 |
|
|
<p>The most convenient way to get local copies of the MITgcm source code is |
32 |
|
|
to use the CVS "pserver" mechanism. This method only allows you to "check |
33 |
|
|
out" (or obtain a local copy) of the source. It does not provide a |
34 |
|
|
mechanism for "committing" or "checking in" changes (please see below). |
35 |
edhill |
1.3 |
Using CVS pserver from the command line requires just a three commands. |
36 |
|
|
Using a Bourne, "bash", or "sh-compatible" shell they are:</p> |
37 |
jmc |
1.14 |
|
38 |
edhill |
1.1 |
<pre> |
39 |
edhill |
1.3 |
$ export CVSROOT=':pserver:cvsanon@mitgcm.org:/u/gcmpack' |
40 |
jmc |
1.14 |
$ cvs login |
41 |
edhill |
1.3 |
( enter the CVS password: "cvsanon" ) |
42 |
jmc |
1.14 |
$ cvs co -P MITgcm |
43 |
edhill |
1.3 |
</pre> |
44 |
|
|
|
45 |
|
|
<p>Using a "C", "csh", or "tcsh" shell the commands are:</p> |
46 |
|
|
|
47 |
|
|
<pre> |
48 |
|
|
$ setenv CVSROOT ':pserver:cvsanon@mitgcm.org:/u/gcmpack' |
49 |
|
|
$ cvs login |
50 |
|
|
( enter the CVS password: "cvsanon" ) |
51 |
jmc |
1.14 |
$ cvs co -P MITgcm |
52 |
edhill |
1.9 |
</pre> |
53 |
|
|
|
54 |
jmc |
1.14 |
<p>using the "-P" option to check-out ("<i>cvs co -P</i>") prevents |
55 |
|
|
to download unnecessary empty directories.</p> |
56 |
|
|
|
57 |
dimitri |
1.16 |
|
58 |
|
|
<p>Note that it is possible to checkout code without "cvs login" and without |
59 |
|
|
setting any shell environment variables by specifying the pserver name and |
60 |
|
|
password in one line, for example:</p> |
61 |
|
|
|
62 |
|
|
<pre> |
63 |
|
|
$ cvs -d :pserver:cvsanon:cvsanon@mitgcm.org:/u/gcmpack co -P MITgcm |
64 |
|
|
</pre> |
65 |
|
|
|
66 |
jmc |
1.14 |
<p>A large amount of additional (optional!) content is available |
67 |
|
|
from the <i>MITgcm_contrib</i> directory; much of it is specific to certain |
68 |
|
|
setups (eg. high-res setups, in-development material that is not yet part |
69 |
|
|
of the "main" code, etc ...). |
70 |
|
|
But rather than checking out the full content of MITgcm_contrib |
71 |
|
|
("<i>cvs co -P MITgcm_contrib</i>"), which takes a long time to download |
72 |
|
|
(particularly from remote locations), we recommend to download only the |
73 |
|
|
specific part of interest, e.g.: "<i>submesoscale</i>" directory, |
74 |
|
|
which can be checked out using:</p> |
75 |
edhill |
1.9 |
|
76 |
|
|
<pre> |
77 |
jmc |
1.14 |
$ cvs co -P MITgcm_contrib/submesoscale |
78 |
edhill |
1.9 |
</pre> |
79 |
|
|
|
80 |
edhill |
1.1 |
<p>Note that you will only need to perform the "cvs login" once. And for |
81 |
|
|
convenience, you may want to add the CVSROOT variable to your shell's |
82 |
|
|
environment (that is, define it within your "~/.bashrc" or "~/.chsrc" |
83 |
|
|
files).</p> |
84 |
|
|
|
85 |
|
|
|
86 |
|
|
<h4>Getting Parts of the Source "Tree"</h4> |
87 |
|
|
|
88 |
|
|
<p>The above commands demonstrate how to check out all of the MITgcm code |
89 |
jmc |
1.14 |
and the "contributed" (that is, unsupported but occasionally useful) |
90 |
|
|
information within the "<i>MITgcm_contrib</i>" directory. In many cases, |
91 |
|
|
this is overkill and can result in long download times. |
92 |
|
|
To reduce the volume of information downloaded and thereby speedup the |
93 |
|
|
download times, one can select one of the following pre-defined "aliases" |
94 |
|
|
that will provide a sub-set of the entire MITgcm source "tree":</p> |
95 |
edhill |
1.1 |
|
96 |
|
|
<table align="center" border="0" cellpadding="10" width="90%" summary="CVS |
97 |
|
|
aliases"> |
98 |
|
|
<tr bgcolor="#00cccc"> |
99 |
|
|
<td width="25%">Alias Name</td> |
100 |
|
|
<td>Information (directories) Contained</td> |
101 |
|
|
</tr> |
102 |
|
|
<tr bgcolor="#bbffdd"> |
103 |
|
|
<td width="25%">MITgcm_code</td> |
104 |
|
|
<td>Only the source code -- none of the verification examples.</td> |
105 |
|
|
</tr> |
106 |
|
|
<tr bgcolor="#bbddff"> |
107 |
|
|
<td width="25%">MITgcm_verif_basic</td> |
108 |
edhill |
1.2 |
<td>Source code plus a small set of the verification examples |
109 |
jmc |
1.11 |
("aim.5l_cs", "hs94.128x64x5", "ideal_2D_oce", "lab_sea", |
110 |
|
|
"tutorial_baroclinic_gyre", "tutorial_global_oce_latlon" |
111 |
|
|
and "tutorial_plume_on_slope").</td> |
112 |
|
|
</tr> |
113 |
|
|
<tr bgcolor="#bbffdd"> |
114 |
|
|
<td width="25%">MITgcm_tutorials</td> |
115 |
|
|
<td>Source code plus all of the tutorials examples.</td> |
116 |
|
|
</tr> |
117 |
|
|
<tr bgcolor="#bbddff"> |
118 |
|
|
<td width="25%">MITgcm_verif_all</td> |
119 |
|
|
<td>Source code plus all of the verification examples.</td> |
120 |
|
|
</tr> |
121 |
|
|
<!-- |
122 |
edhill |
1.1 |
<tr bgcolor="#bbffdd"> |
123 |
|
|
<td width="25%">MITgcm_verif_atmos</td> |
124 |
|
|
<td>Source code plus all of the atmospheric examples.</td> |
125 |
|
|
</tr> |
126 |
|
|
<tr bgcolor="#bbddff"> |
127 |
|
|
<td width="25%">MITgcm_verif_ocean</td> |
128 |
|
|
<td>Source code plus all of the oceanic examples.</td> |
129 |
|
|
</tr> |
130 |
|
|
<tr bgcolor="#bbddff"> |
131 |
|
|
<td width="25%"></td> |
132 |
|
|
<td></td> |
133 |
|
|
</tr> |
134 |
|
|
<tr bgcolor="#bbffdd"> |
135 |
|
|
<td width="25%"></td> |
136 |
|
|
<td></td> |
137 |
|
|
</tr> |
138 |
|
|
--> |
139 |
|
|
</table> |
140 |
|
|
|
141 |
edhill |
1.6 |
<p>It is important to note that the CVS aliases above cannot be used in |
142 |
edhill |
1.7 |
conjunction with the CVS <i>-d DIRNAME</i> option. However, the MITgcm |
143 |
edhill |
1.6 |
directories they create can be changed to a different name following the |
144 |
|
|
check-out:</p> |
145 |
|
|
<pre> |
146 |
jmc |
1.14 |
$ cvs co -P MITgcm_verif_basic |
147 |
edhill |
1.6 |
$ mv MITgcm MITgcm_verif_basic |
148 |
|
|
</pre> |
149 |
edhill |
1.1 |
|
150 |
|
|
<h4>Getting Specific Releases or "Checkpoints"</h4> |
151 |
jmc |
1.15 |
|
152 |
|
|
<p>As shown within the |
153 |
jmc |
1.12 |
<!-- <a href="http://mitgcm.org/cgi-bin/viewcvs.cgi/MITgcm/doc/tag-index">CVS Code Browser</a> --> |
154 |
|
|
<a href="http://mitgcm.org/viewvc/MITgcm/MITgcm/doc/tag-index">CVS Code Browser</a> |
155 |
|
|
, the MITgcm code is continuously undergoing updates. At |
156 |
edhill |
1.1 |
points during the development (typically, after work has been done and the |
157 |
jmc |
1.12 |
source code has passed the <a href="./testing.html">verification |
158 |
edhill |
1.1 |
tests</a>), a release or checkpoint "tag" is created. These tags are a |
159 |
|
|
convenient mechanism for referring to different times or points within the |
160 |
|
|
development. One can check out these versions using the "-r TAG_NAME" CVS |
161 |
|
|
option such as: </p> |
162 |
|
|
|
163 |
|
|
<pre> |
164 |
jmc |
1.14 |
$ cvs co -P -r release1_p5 MITgcm |
165 |
|
|
$ cvs co -P -r checkpoint52a_post MITgcm |
166 |
edhill |
1.1 |
</pre> |
167 |
|
|
|
168 |
|
|
<p>By default (that is, when no tag is specified), CVS will retrieve the |
169 |
jmc |
1.15 |
latest version of all files. To download an older version corresponding |
170 |
|
|
to a specific time, e.g., May 1rst, 2008, at 5pm, one can use the "-D" |
171 |
|
|
CVS option as follows: </p> |
172 |
edhill |
1.1 |
|
173 |
jmc |
1.15 |
<pre> |
174 |
|
|
$ cvs co -P -D "2008-05-01 17:00" MITgcm |
175 |
|
|
</pre> |
176 |
edhill |
1.1 |
|
177 |
|
|
<h4>Show changes that YOU have made</h4> |
178 |
|
|
|
179 |
|
|
<p>If you are running into difficulties it is very useful to see the changes |
180 |
|
|
that you yourself have made since obtaining the code. From within |
181 |
|
|
your working directory:</p> |
182 |
|
|
|
183 |
edhill |
1.3 |
<pre> |
184 |
|
|
cvs diff |
185 |
|
|
</pre> |
186 |
|
|
|
187 |
edhill |
1.1 |
|
188 |
|
|
<p>will show the differences between your version and the version that you |
189 |
|
|
checked out. It acts recursively on all directories below your current |
190 |
|
|
directory. You can limit the operation to just one file or directory by |
191 |
|
|
specifying those as arguments:</p> |
192 |
|
|
|
193 |
edhill |
1.3 |
<pre> |
194 |
|
|
cvs diff <i>file</i> |
195 |
|
|
</pre> |
196 |
|
|
|
197 |
edhill |
1.1 |
|
198 |
|
|
<h4>Show changes to the repository that you don't have</h4> |
199 |
|
|
|
200 |
|
|
<p>The source code evolves continuously and you should try to stay up to |
201 |
|
|
date. To see what needs to be updated:</p> |
202 |
|
|
|
203 |
edhill |
1.3 |
<pre> |
204 |
|
|
cvs -n update |
205 |
|
|
</pre> |
206 |
edhill |
1.1 |
|
207 |
|
|
<p>behaves just as "cvs update" but doesn't actually change anything. This |
208 |
|
|
is a useful way of summarizing the state of your code. The meaning of the |
209 |
|
|
output is summarized in the next topic.</p> |
210 |
|
|
|
211 |
|
|
<h4>Getting updates from the repository</h4> |
212 |
|
|
|
213 |
|
|
<p>You can download and merge updates from the repository to bring you |
214 |
|
|
working code up to date:</p> |
215 |
|
|
|
216 |
edhill |
1.3 |
<pre> |
217 |
|
|
cvs update -d -P |
218 |
|
|
</pre> |
219 |
edhill |
1.1 |
|
220 |
|
|
<p>will work recursively on all files in the current directory and below. |
221 |
|
|
To update just a specific file or directory:</p> |
222 |
|
|
|
223 |
edhill |
1.3 |
<pre> |
224 |
|
|
cvs update <i>file</i> |
225 |
|
|
</pre> |
226 |
edhill |
1.1 |
|
227 |
|
|
<p>You can also update to a specific version, just as you could check out |
228 |
|
|
a specific version.</p> |
229 |
|
|
|
230 |
edhill |
1.3 |
<pre> |
231 |
|
|
cvs update -d -P -r release1_p5 |
232 |
|
|
</pre> |
233 |
edhill |
1.1 |
|
234 |
|
|
<p>If you checked out a specific version and want to update to the very |
235 |
|
|
latest use the -A option will remove associated with a specific version as |
236 |
|
|
follows:</p> |
237 |
|
|
|
238 |
edhill |
1.3 |
<pre> |
239 |
|
|
cvs update -d -P -A |
240 |
|
|
</pre> |
241 |
edhill |
1.1 |
|
242 |
|
|
<p>"cvs update" produces output to the terminal with the following |
243 |
|
|
meanings:</p> |
244 |
jmc |
1.15 |
|
245 |
edhill |
1.1 |
<table align="center" border="0" cellpadding="10" width="90%" summary="CVS |
246 |
|
|
update codes"> |
247 |
|
|
<tr bgcolor="#00cccc"> |
248 |
|
|
<td width="20%">Return Code</td> |
249 |
|
|
<td>Description</td> |
250 |
|
|
</tr> |
251 |
|
|
<tr bgcolor="#bbffdd"> |
252 |
|
|
<td width="20%">U <i>file</i></td> |
253 |
|
|
<td>indicates that <i>file</i> was brought up to date with the |
254 |
|
|
repository or that it exists in the repository but not in your work |
255 |
|
|
space</td> |
256 |
|
|
</tr> |
257 |
|
|
<tr bgcolor="#bbddff"> |
258 |
|
|
<td width="20%">P <i>file</td> |
259 |
|
|
<td>does exactly as above but uses the "patch" method</td> |
260 |
|
|
</tr> |
261 |
|
|
<tr bgcolor="#bbffdd"> |
262 |
|
|
<td width="20%">M <i>file</i></td> |
263 |
|
|
<td>means the <i>file</i> was modified in your work space. Any |
264 |
|
|
additional changes from the repository were merged in |
265 |
|
|
successfully</td> |
266 |
|
|
</tr> |
267 |
|
|
</tr> |
268 |
|
|
<tr bgcolor="#bbddff"> |
269 |
|
|
<td width="20%">C <i>file</i></td> |
270 |
|
|
<td>means a merge is necessary because both the your copy and the |
271 |
|
|
repository have changed <b>but</b> there is a conflict between the |
272 |
|
|
changes</td> |
273 |
|
|
</tr> |
274 |
|
|
<tr bgcolor="#bbffdd"> |
275 |
|
|
<td width="20%">? <i>file</i></td> |
276 |
|
|
<td>means the file exists in your work space but not on the |
277 |
|
|
repository</td> |
278 |
|
|
</tr> |
279 |
|
|
</table> |
280 |
|
|
|
281 |
|
|
<p>When conflicts arise, the sections of code are both kept and surrounded |
282 |
|
|
by <<<<<, ===== and >>>>> indicators. You need to examine |
283 |
|
|
these lines of the files and resolve the conflict.</p> |
284 |
|
|
|
285 |
|
|
<h4>Wow! CVS is so good, where can I learn more?</h4> |
286 |
|
|
|
287 |
jmc |
1.15 |
<p>The <a |
288 |
|
|
href="http://web.mit.edu/afs/athena.mit.edu/project/gnu/doc/html/cvs_toc.html">basic |
289 |
jmc |
1.13 |
manual</a> is a good reference. |
290 |
|
|
For those who prefer the good old fashioned book there's |
291 |
|
|
<a href="http://cvsbook.red-bean.com/">"Open Source Development With CVS"</a>.</p> |
292 |
edhill |
1.1 |
|
293 |
|
|
</body> |
294 |
|
|
</html> |
295 |
|
|
|