| 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 |
|
|
|
| 25 |
|
|
<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 |
edhill |
1.1 |
|
| 38 |
|
|
<pre> |
| 39 |
edhill |
1.3 |
$ export CVSROOT=':pserver:cvsanon@mitgcm.org:/u/gcmpack' |
| 40 |
|
|
$ cvs login |
| 41 |
|
|
( enter the CVS password: "cvsanon" ) |
| 42 |
edhill |
1.9 |
$ cvs co 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 |
edhill |
1.9 |
$ cvs co MITgcm |
| 52 |
|
|
</pre> |
| 53 |
|
|
|
| 54 |
|
|
<p>A large amount of additional (optional!) content can be obtained from the |
| 55 |
|
|
MITgcm_contrib directory that can be checked out using: |
| 56 |
|
|
|
| 57 |
|
|
<pre> |
| 58 |
edhill |
1.10 |
$ cvs co MITgcm_contrib |
| 59 |
edhill |
1.9 |
</pre> |
| 60 |
|
|
|
| 61 |
|
|
In general, we do not recommend checking out all of MITgcm_contrib since |
| 62 |
|
|
it takes a long time to download (particularly from remote locations) and |
| 63 |
|
|
much of it is specific to certain setups (eg. high-res setups, |
| 64 |
|
|
in-development material that is not yet part of the "main" code, |
| 65 |
|
|
etc.).</p> |
| 66 |
edhill |
1.1 |
|
| 67 |
|
|
<p>Note that you will only need to perform the "cvs login" once. And for |
| 68 |
|
|
convenience, you may want to add the CVSROOT variable to your shell's |
| 69 |
|
|
environment (that is, define it within your "~/.bashrc" or "~/.chsrc" |
| 70 |
|
|
files).</p> |
| 71 |
|
|
|
| 72 |
|
|
|
| 73 |
|
|
<h4>Getting Parts of the Source "Tree"</h4> |
| 74 |
|
|
|
| 75 |
|
|
<p>The above commands demonstrate how to check out all of the MITgcm code |
| 76 |
edhill |
1.9 |
and the "contributed" (that is, unsupported by occasionally useful) |
| 77 |
|
|
information within the "MITgcm_contrib" directory. In many cases, this is |
| 78 |
|
|
overkill and can result in long download times. To reduce the volume of |
| 79 |
edhill |
1.1 |
information downloaded and thereby speedup the download times, one can |
| 80 |
|
|
select one of the following pre-defined "aliases" that will provide a |
| 81 |
|
|
sub-set of the entire MITgcm source "tree":</p> |
| 82 |
|
|
|
| 83 |
|
|
<table align="center" border="0" cellpadding="10" width="90%" summary="CVS |
| 84 |
|
|
aliases"> |
| 85 |
|
|
<tr bgcolor="#00cccc"> |
| 86 |
|
|
<td width="25%">Alias Name</td> |
| 87 |
|
|
<td>Information (directories) Contained</td> |
| 88 |
|
|
</tr> |
| 89 |
|
|
<tr bgcolor="#bbffdd"> |
| 90 |
|
|
<td width="25%">MITgcm_code</td> |
| 91 |
|
|
<td>Only the source code -- none of the verification examples.</td> |
| 92 |
|
|
</tr> |
| 93 |
|
|
<tr bgcolor="#bbddff"> |
| 94 |
|
|
<td width="25%">MITgcm_verif_basic</td> |
| 95 |
edhill |
1.2 |
<td>Source code plus a small set of the verification examples |
| 96 |
jmc |
1.11 |
("aim.5l_cs", "hs94.128x64x5", "ideal_2D_oce", "lab_sea", |
| 97 |
|
|
"tutorial_baroclinic_gyre", "tutorial_global_oce_latlon" |
| 98 |
|
|
and "tutorial_plume_on_slope").</td> |
| 99 |
|
|
</tr> |
| 100 |
|
|
<tr bgcolor="#bbffdd"> |
| 101 |
|
|
<td width="25%">MITgcm_tutorials</td> |
| 102 |
|
|
<td>Source code plus all of the tutorials examples.</td> |
| 103 |
|
|
</tr> |
| 104 |
|
|
<tr bgcolor="#bbddff"> |
| 105 |
|
|
<td width="25%">MITgcm_verif_all</td> |
| 106 |
|
|
<td>Source code plus all of the verification examples.</td> |
| 107 |
|
|
</tr> |
| 108 |
|
|
<!-- |
| 109 |
edhill |
1.1 |
<tr bgcolor="#bbffdd"> |
| 110 |
|
|
<td width="25%">MITgcm_verif_atmos</td> |
| 111 |
|
|
<td>Source code plus all of the atmospheric examples.</td> |
| 112 |
|
|
</tr> |
| 113 |
|
|
<tr bgcolor="#bbddff"> |
| 114 |
|
|
<td width="25%">MITgcm_verif_ocean</td> |
| 115 |
|
|
<td>Source code plus all of the oceanic examples.</td> |
| 116 |
|
|
</tr> |
| 117 |
|
|
<tr bgcolor="#bbddff"> |
| 118 |
|
|
<td width="25%"></td> |
| 119 |
|
|
<td></td> |
| 120 |
|
|
</tr> |
| 121 |
|
|
<tr bgcolor="#bbffdd"> |
| 122 |
|
|
<td width="25%"></td> |
| 123 |
|
|
<td></td> |
| 124 |
|
|
</tr> |
| 125 |
|
|
--> |
| 126 |
|
|
</table> |
| 127 |
|
|
|
| 128 |
edhill |
1.6 |
<p>It is important to note that the CVS aliases above cannot be used in |
| 129 |
edhill |
1.7 |
conjunction with the CVS <i>-d DIRNAME</i> option. However, the MITgcm |
| 130 |
edhill |
1.6 |
directories they create can be changed to a different name following the |
| 131 |
|
|
check-out:</p> |
| 132 |
|
|
<pre> |
| 133 |
|
|
$ cvs co MITgcm_verif_basic |
| 134 |
|
|
$ mv MITgcm MITgcm_verif_basic |
| 135 |
|
|
</pre> |
| 136 |
edhill |
1.1 |
|
| 137 |
|
|
<h4>Getting Specific Releases or "Checkpoints"</h4> |
| 138 |
|
|
|
| 139 |
|
|
<p>As shown within the <a |
| 140 |
edhill |
1.8 |
href="http://mitgcm.org/cgi-bin/viewcvs.cgi/MITgcm/doc/tag-index"> CVS |
| 141 |
edhill |
1.1 |
Code Browser</a>, the MITgcm code is continuously undergoing updates. At |
| 142 |
|
|
points during the development (typically, after work has been done and the |
| 143 |
|
|
source code has passed the <a href="testing/latest.html">verification |
| 144 |
|
|
tests</a>), a release or checkpoint "tag" is created. These tags are a |
| 145 |
|
|
convenient mechanism for referring to different times or points within the |
| 146 |
|
|
development. One can check out these versions using the "-r TAG_NAME" CVS |
| 147 |
|
|
option such as: </p> |
| 148 |
|
|
|
| 149 |
|
|
<pre> |
| 150 |
edhill |
1.3 |
$ cvs co -r release1_p5 MITgcm |
| 151 |
|
|
$ cvs co -r checkpoint52a_post MITgcm |
| 152 |
edhill |
1.1 |
</pre> |
| 153 |
|
|
|
| 154 |
|
|
<p>By default (that is, when no tag is specified), CVS will retrieve the |
| 155 |
|
|
latest version of all files.</p> |
| 156 |
|
|
|
| 157 |
|
|
|
| 158 |
|
|
<h4>Show changes that YOU have made</h4> |
| 159 |
|
|
|
| 160 |
|
|
<p>If you are running into difficulties it is very useful to see the changes |
| 161 |
|
|
that you yourself have made since obtaining the code. From within |
| 162 |
|
|
your working directory:</p> |
| 163 |
|
|
|
| 164 |
edhill |
1.3 |
<pre> |
| 165 |
|
|
cvs diff |
| 166 |
|
|
</pre> |
| 167 |
|
|
|
| 168 |
edhill |
1.1 |
|
| 169 |
|
|
<p>will show the differences between your version and the version that you |
| 170 |
|
|
checked out. It acts recursively on all directories below your current |
| 171 |
|
|
directory. You can limit the operation to just one file or directory by |
| 172 |
|
|
specifying those as arguments:</p> |
| 173 |
|
|
|
| 174 |
edhill |
1.3 |
<pre> |
| 175 |
|
|
cvs diff <i>file</i> |
| 176 |
|
|
</pre> |
| 177 |
|
|
|
| 178 |
edhill |
1.1 |
|
| 179 |
|
|
<h4>Show changes to the repository that you don't have</h4> |
| 180 |
|
|
|
| 181 |
|
|
<p>The source code evolves continuously and you should try to stay up to |
| 182 |
|
|
date. To see what needs to be updated:</p> |
| 183 |
|
|
|
| 184 |
edhill |
1.3 |
<pre> |
| 185 |
|
|
cvs -n update |
| 186 |
|
|
</pre> |
| 187 |
edhill |
1.1 |
|
| 188 |
|
|
<p>behaves just as "cvs update" but doesn't actually change anything. This |
| 189 |
|
|
is a useful way of summarizing the state of your code. The meaning of the |
| 190 |
|
|
output is summarized in the next topic.</p> |
| 191 |
|
|
|
| 192 |
|
|
<h4>Getting updates from the repository</h4> |
| 193 |
|
|
|
| 194 |
|
|
<p>You can download and merge updates from the repository to bring you |
| 195 |
|
|
working code up to date:</p> |
| 196 |
|
|
|
| 197 |
edhill |
1.3 |
<pre> |
| 198 |
|
|
cvs update -d -P |
| 199 |
|
|
</pre> |
| 200 |
edhill |
1.1 |
|
| 201 |
|
|
<p>will work recursively on all files in the current directory and below. |
| 202 |
|
|
To update just a specific file or directory:</p> |
| 203 |
|
|
|
| 204 |
edhill |
1.3 |
<pre> |
| 205 |
|
|
cvs update <i>file</i> |
| 206 |
|
|
</pre> |
| 207 |
edhill |
1.1 |
|
| 208 |
|
|
<p>You can also update to a specific version, just as you could check out |
| 209 |
|
|
a specific version.</p> |
| 210 |
|
|
|
| 211 |
edhill |
1.3 |
<pre> |
| 212 |
|
|
cvs update -d -P -r release1_p5 |
| 213 |
|
|
</pre> |
| 214 |
edhill |
1.1 |
|
| 215 |
|
|
<p>If you checked out a specific version and want to update to the very |
| 216 |
|
|
latest use the -A option will remove associated with a specific version as |
| 217 |
|
|
follows:</p> |
| 218 |
|
|
|
| 219 |
edhill |
1.3 |
<pre> |
| 220 |
|
|
cvs update -d -P -A |
| 221 |
|
|
</pre> |
| 222 |
edhill |
1.1 |
|
| 223 |
|
|
<p>"cvs update" produces output to the terminal with the following |
| 224 |
|
|
meanings:</p> |
| 225 |
|
|
|
| 226 |
|
|
<table align="center" border="0" cellpadding="10" width="90%" summary="CVS |
| 227 |
|
|
update codes"> |
| 228 |
|
|
<tr bgcolor="#00cccc"> |
| 229 |
|
|
<td width="20%">Return Code</td> |
| 230 |
|
|
<td>Description</td> |
| 231 |
|
|
</tr> |
| 232 |
|
|
<tr bgcolor="#bbffdd"> |
| 233 |
|
|
<td width="20%">U <i>file</i></td> |
| 234 |
|
|
<td>indicates that <i>file</i> was brought up to date with the |
| 235 |
|
|
repository or that it exists in the repository but not in your work |
| 236 |
|
|
space</td> |
| 237 |
|
|
</tr> |
| 238 |
|
|
<tr bgcolor="#bbddff"> |
| 239 |
|
|
<td width="20%">P <i>file</td> |
| 240 |
|
|
<td>does exactly as above but uses the "patch" method</td> |
| 241 |
|
|
</tr> |
| 242 |
|
|
<tr bgcolor="#bbffdd"> |
| 243 |
|
|
<td width="20%">M <i>file</i></td> |
| 244 |
|
|
<td>means the <i>file</i> was modified in your work space. Any |
| 245 |
|
|
additional changes from the repository were merged in |
| 246 |
|
|
successfully</td> |
| 247 |
|
|
</tr> |
| 248 |
|
|
</tr> |
| 249 |
|
|
<tr bgcolor="#bbddff"> |
| 250 |
|
|
<td width="20%">C <i>file</i></td> |
| 251 |
|
|
<td>means a merge is necessary because both the your copy and the |
| 252 |
|
|
repository have changed <b>but</b> there is a conflict between the |
| 253 |
|
|
changes</td> |
| 254 |
|
|
</tr> |
| 255 |
|
|
<tr bgcolor="#bbffdd"> |
| 256 |
|
|
<td width="20%">? <i>file</i></td> |
| 257 |
|
|
<td>means the file exists in your work space but not on the |
| 258 |
|
|
repository</td> |
| 259 |
|
|
</tr> |
| 260 |
|
|
</table> |
| 261 |
|
|
|
| 262 |
|
|
<p>When conflicts arise, the sections of code are both kept and surrounded |
| 263 |
|
|
by <<<<<, ===== and >>>>> indicators. You need to examine |
| 264 |
|
|
these lines of the files and resolve the conflict.</p> |
| 265 |
|
|
|
| 266 |
|
|
<h4>Wow! CVS is so good, where can I learn more?</h4> |
| 267 |
|
|
|
| 268 |
|
|
<p>The <a href="http://www.loria.fr/~molli/cvs/doc/cvs_toc.html">basic |
| 269 |
|
|
manual</a> is a good reference. There is also an <a |
| 270 |
|
|
href="http://web.mit.edu/afs/athena.mit.edu/project/gnu/doc/html/cvs_toc.html">online |
| 271 |
|
|
tutorial</a> as well as an <a |
| 272 |
|
|
href="http://www.loria.fr/~molli/cvs/cvstrain/cvstrain.html">training |
| 273 |
|
|
manual</a>. For those who prefer the good old fashioned book there's <a |
| 274 |
|
|
href="http://cvsbook.red-bean.com/">"Open Source Development With |
| 275 |
|
|
CVS"</a>.</p> |
| 276 |
|
|
|
| 277 |
|
|
</body> |
| 278 |
|
|
</html> |
| 279 |
|
|
|