Using CVS for development of AIPS++ Code base
CVS For the Developer
Setup
A complete CVS manual is available at:
CVS Manual
Tools have been created to enable access to the CVS distribution in a very similar way to the interactions with the RCS distribution. However, you can always use the "standard" CVS commands to edit, update and build code.
This document will continue to be developed over the course of this test period. Please send any/all comments to Joe and Wes.
The following detail the steps to setting up your CVS distribution of AIPS++ and then some examples of interaction with the code base.
1) Generating your CVS password
Send the output of (NOTE: Do not use your normal password):
perl -e 'print crypt("yourpassword", "b6"), "\n";'
To Wes Young.
2) Setup your path and code tree
If you are working in only one CVS development then you can:
export CVSROOT=:pserver:yourname@polaris.cv.nrao.edu:/home/cvs
Put this into your .bashrc/.tcshrc file.
If you are working in multiple CVS development areas, you can use:
cvs login -d ":pserver..." to specify the CVS repository.
3) Login to CVS
You will need to do this once per machine. The password is
stored/encryped in ~/.cvspass. Copy your entries as needed.
Example:
charybdis<602>$ cvs login
Logging in to :pserver:jmcmulli@polaris.cv.nrao.edu:2401/home/cvs
CVS password:
4) Setup for AIPS++
Source the initialization file. For Socorro:
> . /aips++/daily/aipsinit.sh
Also note that the following lines in each site installation .aipsrc
will need to be modified:
inhale.cvsroot: :pserver:valid_account@cvs.cv.nrao.edu:/home/cvs
sneeze.machine.arch.logfile: /aips++/daily/arch/sneeze.log
All of the sneeze log lines should point to the cvs version of AIPS++.
Machine name and arch (e.g., gnu, gcc3, ntv, etc) should refer to
those locally supported.
5) Create your developer tree
In a directory of your choosing:
> mktree.cvs
This makes a CVS directory tree with src subdirectories. These
subdirectories point to the current up-to-date CVS tree. You can 'cp'
a file from the source directory and work on it as necessary; this is
effectively the programmers tree that RCS interaction provides.
Programmer Interactions
This section summarizes the basic tools needed for development.
Example 1 (glish)
> . /aips++/daily/aipsinit.sh
> cd aips++/code/trial/apps/dish/
> cvs update dish.g
#edit file and then test out changes
#when satisfied
> cvs commit dish.g
Example 2 (C++)
> . /aips++/daily/aipsinit.sh
> cd aips++/code/trial/apps/sditerator
> cvs update sditeratorDO.cc
> cvs update makefile
#edit file and then test out changes
#when satisfied
> cvs commit sditeratorDO.cc
Example 3 Build against different tags:
Do this at the top of your CVS code tree
(from mktree.cvs)
cvs update -r HEAD # this gets the current
cvs update -r AIPS2-stable-yyyymmdd # this gets stable
cvs update -r AIPS2-vX-X-Y # this get stable snapshot
Then do Example 2.
Example 4 Move a file
cp filename to new location
cvs remove filename from old location
cvs add filename @new location
cvs commit filename
Example 5 Get history on a file
cvs log -N filename #change log on file
cvs log -N #all files in directory recursively
cvs log -d ">yyyymmdd" filename #changes after date
Example 6 Get changes since a certain date
bash-2.05$ cvs diff -D 20031105 mydish_gbtcal.gp
Index: mydish_gbtcal.gp
============================================
RCS file:
/home/cvs/aips++/code/trial/apps/dish/mydish_gbtcal.gp,v
retrieving revision 19.3
diff -r19.3 mydish_gbtcal.gp
68a69,73
> public.dumb:=function() {
> print 'dumb function';
> return T;
> };
Example 7 Setup a notification for a subset of code
cvs watch add -a all filename
cvs watch remove -a all filename
Converting an existing RCS installation to CVS
a) . /home/aips++/aipsinit.sh
b) cd /home/aips++
c) Delete the code, rcs and slave directories in your AIPS++ root directory
d) cvs checkout -r stable -d code aips++/code
e) cd code/install/codemgmt
f) gmake
g) sneeze -l -m cumulative or
h) inhale.cvs -R stable -c (available tags are: weekly,
stable, AIPS2-v1-9-n (where n is the stable snapshot number), AIPS2-2004mmdd).
Some Standard CVS commands
cvs --help-commands #some help options
cvs --help-options
cvs -H
cd /aips++
cvs -n -q update #check what is new and old
cvs update [file(s)~E] #update changed file from repository
cvs commit [file(s)~E] #put changes back into repository
cvs add file(s) #add a file to the repository
cvs remove file(s) #remove a file from the repository
cvs log
cvs history
RCS-based Tools
There are currently two functions which map behavior in CVS to
the familiar RCS environment. Standard CVS commands may always be
used.
mktree.cvs constructs the development tree
inhale.cvs does the familiar checkout and sneeze
Beyond this, only standard CVS commands are used.
"Clean Installation"
One can install AIPS++ using CVS. It requires that several software packages be installed for a succesfull build, namely:
PgPlot
Tcl/Tk
X11
LessTif/OpenMotif
Xpm
Lapack
Blas
cfitsio
rpfits
fftw
cvsup
gcc-3.2.3
Aside from gcc, the packages maybe installed before or after running the configure.cvs script.
Cvsup will need to be installed for aupdate to work.
The actual installation proceeds as follow
Created a directory for AIPS++ to reside in, i.e.
mkdir /usr/local/aips++
cd /usr/local/aips++
cvs -d :pserver:anonymous@cvs.cv.nrao.edu:/home/cvs -r checkout -d code casa/code
cd code
chmod u+x install/configure.cvs
install/configure.cvs
Note: configure.cvs will ask several questions and have
you edit your local makedefs file. For most linux systems,
you only need to change the location of gcc (C++ROOT).
Also please note that you have to make sure that the following
lines exist in your makedefs and point to where your cfitsio library is (here for
example its /home/packages/cfitsio)
CFITSIOROOT := /home/packages/cfitsio
CFITSIOINCD := $(CFITSIOROOT)/include
CFITSIOLIBD := $(CFITSIOROOT)/lib
source ../aipsinit.$SHELL
choose your appropriate $SHELL :-) Normally you will want to add this
to your shell startup file
#### glish has to be built independently now
cd aips/glish
gmake
#### now make the casa libraries and binaries
cd ../../../
sneeze -l -m cumulative&
Note: the sneeze will take several hours to run.
aupdate data docs
Not all releases have a working configure.cvs. Currently only the main and protopipe branches will support this method of installation. Stables subsequent to SS4 will work.
--
JosephMcMullin - 01 Feb 2004