DCS's CVS Notes

Setting up the CESR environment on Unix
---------------------------------------

If you are running csh or tcsh type:
  >   source /home/cesrulib/bin/cesrdef 

The resulting environment will have the following variables set:

CESR_CURRENT = /home/cesrulib/cesr_libs/current
CESR_DEVEL   = /home/cesrulib/cesr_libs/devel
CESR_CONST   = /home/cesrulib/constants
CESR_UTIL    = /home/cesrulib/cesr_libs/current/util
CESR_GMAKE   = /home/cesrulib/cesr_libs/current/Gmake
CESR_MOD     = /home/cesrulib/cesr_libs/current/modules
CESR_CVSSRC  = /home/cesrulib/cesr_libs/current/cvssrc
CESR_RUN     = /home/cesrulib/cesr_libs/current/run
CESR_LIB     = /home/cesrulib/cesr_libs/current
CESR_DOC     = /home/cesrulib/cesr_libs/doc
CESR_EXE     = /home/cesrulib/cesr_libs/current/bin
CESR_CVSROOT = /home/cesrulib/cesr_libs/cvsroot
CESR_PKG     = /home/cesrulib/cesr_libs/packages
CESR_CONFIG  = /home/cesrulib/cesr_libs/current/config
CESR_INC     = /home/cesrulib/cesr_libs/current/include

PKG_LIB      = /home/cesrulib/cesr_libs/packages/lib
PKG_MOD      = /home/cesrulib/cesr_libs/packages/modules


You will note that many of these variables point to 
the "current" tree which is the default when you scripts
the cesrdef/cesrdefs scripts.  Thus you will pick up 
versions of the libraries that are most recent, but perhaps 
not the most stable (eg, because you're developing new code), 
you would want to say

CESRLIB=devel; . /home/cesrulib/bin/cesrdefs    or 
set CESRLIB=devel; source /home/cesrulib/bin/cesrdef

This would result in the following definitions of the 
CESR environment variables:

CESR_DEVEL   = /home/cesrulib/cesr_libs/devel
CESR_CONST   = /home/cesrulib/constants
CESR_UTIL    = /home/cesrulib/cesr_libs/devel/util
CESR_GMAKE   = /home/cesrulib/cesr_libs/devel/Gmake
CESR_MOD     = /home/cesrulib/cesr_libs/devel/modules
CESR_CVSSRC  = /home/cesrulib/cesr_libs/devel/cvssrc
CESR_RUN     = /home/cesrulib/cesr_libs/devel/run
CESR_CURRENT = /home/cesrulib/cesr_libs/current
CESR_LIB     = /home/cesrulib/cesr_libs/devel
CESR_DOC     = /home/cesrulib/cesr_libs/doc
CESR_EXE     = /home/cesrulib/cesr_libs/devel/bin
CESR_CVSROOT = /home/cesrulib/cesr_libs/cvsroot
CESR_PKG     = /home/cesrulib/cesr_libs/packages
CESR_CONFIG  = /home/cesrulib/cesr_libs/devel/config
CESR_INC     = /home/cesrulib/cesr_libs/devel/include

PKG_LIB = /home/cesrulib/cesr_libs/packages/lib
PKG_MOD = /home/cesrulib/cesr_libs/packages/modules


How to check out your own development copy of bmad
--------------------------------------------------

Make a directory where you want to work and cd to it.  I will simply 
call this area "work" in all that follows.  Then do the following:

1)  Set up the CVSROOT environment variable to point to the CESR 
    repository
    
    setenv CVSROOT $CESR_CVSROOT

2)  Check out the bmad library (this can be done by anyone belonging 
    to the cesrcvs group).  This will put a copy of the entire bmad 
    directory tree in your work directory

    cvs co bmad

3)  Build bmad.  The makefile will automatically create lib, modules, and 
    other necessary directories at the same level as bmad in the directory 
    tree.

    cd bmad
    gmake

4)  Now you will want to get Etienne's libraries and modules into your 
    local area.  I suggest just copying them:

    cd ..    (ie, return to the work directory)
    cp /home/cesrulib/temp/lib/lib*.a  lib
    cp /home/cesrulib/temp/modules/*.mod modules
    cp /home/cesrulib/temp/modules_g/*.mod modules_g

5)  Now make a directory where you will want to build a particular program 
    and possibly make special versions of specific routines (eg, bmad replacement 
    routines from this area should be picked up in preference to those in the 
    bmad library).  I will call this directory job.
  
    mkdir job
    cd job
    cp $CESR_GMAKE/M.job Makefile

    You will want to edit Makefile to add "forest" to the LOCAL_LIBS list.  
    You will note that bmad, dcslib, and cesr_utils are already listed as 
    part of the CESR_LIBS and the numerical recipes library is part of the 
    PKG_LIBS.  These 3 variables provide the CESR library search list for 
    the linker.

6)  Write a test program in this area and as well as any subroutines/functions 
    in their own files.  Now build an executable:

    gmake

    Two executables (regular and debug) and the corresponding map files 
    will appear in the bin directory (parallel to bmad and job) -->

    work/bin/job.exe
    work/bin/job_g.exe
    work/bin/job.exe.map
    work/bin/job_g.exe.map

7)  Try them out. 

    ladebug <file>
    dxladebug <file>

8)  At this point you can edit code in the bmad area or put new code into 
    the job area for testing and continue your development.  Let me know 
    if I've left any nasty bugs lying around for you (I know things aren't 
    perfect yet).  If you have code that you want to make part of the 
    offical bmad, I will show you how to put it into the CVS repository when 
    I get back.

   
    In bmad dir: 
      cvs ci
    
    CVS commands: in code dir:
      cvs delete <file>
      cvs add <file>
   
   cvs update

-------------------------------------------------------------------
Documentation:

For CVS help:

1) man cvs 
2) cvs --help 
3) Look at some CLEO documentation:
       CBX93-121    
  http://www.lns.cornell.edu/restricted/CBX/1993/CBX93-121/section3_3.html

Also see CSN94-331 

For info on other features (RCS, CPP,...):
  http://www.lns.cornell.edu/restricted/CBX/1993/CBX93-121/section3_4.html

-------------------------------------------------------------------

    gmake               -- Make both debug and production
    gmake debug         -- Make just debug
    gmake production    -- Make just production

-------------------------------------------------------------------

    cvs co <module>    ! [cvs checkout] Initialize: Create new directories, etc.
    cvs update         ! update all local files. Also used to show what you
                       !   have changed.
    cvs update <file>  ! update <file>
    cvs -n update      ! No update. Just show what has been changed.
    cvs -n update -d   ! Same as above except show delected directories.
    cvs ci             ! [cvs commit]
    cvs status         ! show status of every file. This is the long form.
    cvs status <file>  ! show status of a file.
    cvs add <file>
    cvs remove <file>
    cvs release
    cvs diff           ! show differences between local and repository files
    cvs diff <file>    ! show differences between local and repository.

-------------------------------------------------------------------

CVS commands are:
        add          Add a new file/directory to the repository
        admin        Administration front end for rcs
        annotate     Show last revision where each line was modified
        checkout     Checkout sources for editing
        commit       Check files into the repository
        diff         Show differences between revisions
        edit         Get ready to edit a watched file
        editors      See who is editing a watched file
        export       Export sources from CVS, similar to checkout
        history      Show repository access history
        import       Import sources into CVS, using vendor branches
        init         Create a CVS repository if it doesn't exist
        log          Print out history information for files
        login        Prompt for password for authenticating server.
        logout       Removes entry in .cvspass for remote repository.
        rdiff        Create 'patch' format diffs between releases
        release      Indicate that a Module is no longer in use
        remove       Remove an entry from the repository
        rtag         Add a symbolic tag to a module
        status       Display status information on checked out files
        tag          Add a symbolic tag to checked out version of files
        unedit       Undo an edit command
        update       Bring work tree in sync with repository
        watch        Set watches
        watchers     See who is watching a file

Mike Forster
Last modified: Thu May 29 16:25:00 EDT 2003