EASY
CLEARCASE
MANUAL

in 7 lessons and exercises

For all ClearCase users

By
Ryad El Khatib

CNRM / GMAP / ALGO

ECCM 4.0

2007-05-09


Prefactory note

This document has been written in order to help people to use ClearCase.

Experience seems to show that the most efficient solution to start with ClearCase would be to learn a few basic commands and to practice as soon as possible with exercises.

Trying to follow this idea, this manual is composed of 7 lessons and exercises.

These exercises are very important : they are designed as a part of the lessons ! In other words, if you overpass the exercises, you will miss an important part of this manual.

Note also that these exercises are not trivial : they should draw your attention on different details that you should keep in mind when you are using ClearCase.

You will find a solution to the exercises at the end of this manual.

Those who think they are already experts in ClearCase usage ("gurus" excepted) are especially invited to control that they succeed in all the exercises.

Congratulations and thanks to the not-so-unknown one still in Sunshine who created the unexpected wish : without you, this manual may have never existed ...

Special thanks to Dominique Puech who kindly did the final dirty (?) job, and to the ClearCase Administrators who re-read and correct this TUC adverse manual (even the exercises).

Thanks to their chocolate box, too !

Special thanks to our persuasive Fatima Karbou who made me update this bloody documentation, seven years laters !!

To all others :
 
 

************ Welcome to ClearCase ! ************


Lessons & Exercises


Lesson n°1
 

What is ClearCase ? What is it for ?




ClearCase is a toolbox used at METEO-FRANCE in order to manage some source code.

The source code is stored in a database ; ClearCase provides at set of commands to handle the code in this database.

ClearCase software and the codes databases are installed on the machine named Merou.

If you want to modify the code, you must use ClearCase .

ClearCase is supervised by a ClearCase Administrator ; in case of any problem, you should ask him : his job is to be nice, competent and helpful.

At METEO-FRANCE, there are 2 ClearCase administrators ; their names are :
 

  Stephane MARTINEZ (office B310 ; telephone 85 47)

  Guillaume BEFFREY (office B308 ; telephone 85 79)
 
 

Prepare your environment




Before using ClearCase, you must prepare your environment :
 

    The variables LOGNAME should be set correctly.

  The following paths should be added to the PATH variable in your file .bash_profile :

    /usr/atria/bin

    /home/marp001/ccase/bin/users

  The variable EDITOR should be set to your favourite editor in your file .bash_profile
  The variable DISPLAY should be set properly in your file .bash_profile
        The following variables should be exported in your file
.bash_profile :

    export CCHOME=/home/marp001

    export CCGROUP=marp

    export CCMASTER=marp001

  Type : cc_init -p arp (This command is to be executed only once in your life.)
                Notice : the argument "-p" is a reminescence of an old-fashionned management.

     Tell your ClearCase administrator that you intend to modify the source code ;
      he will do something, and after he tells you it is okay, you will have to
logout then login again.
 
 

Exercise n°1

Prepare your ClearCase environment

Click here to get the solution




Lesson n°2

This lesson is exceptionally long
because important notions must be first explained
before entering ClearCase
 

How to reach the code within ClearCase ?


 

Notion of Release
 
 

Whenever the source code of a project has reached
a stable state of development, this source code is labelled
as a new release (or "cycle").




· The releases are named successively "CY01", "CY02", "CY03", etc.

Actually things are a bit more complicated, since both ECMWF and METEO-FRANCE develops on the same source code :

A release named "CYnn" is a common cycle between ECMWF and METEO-FRANCE.
But on each side of the Channel, from time to time, we have to deliver our own interim cycles before making a new common cycle. In the case of an interim cycle, the release is named :

· "CYnnTm" in the case of an interim cycle at METEO-FRANCE ("T" stands for "Toulouse")
· "CYnnR m" in the case of an interim cycle at ECMWF ("R" stands for "Reading").

Examples : CY16R3 is the third interim cycle at ECMWF, based on the common cycle CY16 ; CY15T4 is the fourth interim cycle at METEO-FRANCE, based on the common cycle CY15.

On May, 9th, 2007, the latest release was "CY32T2".

Notice : at this stage, the source code delivered as a new release is currently called a main release.
 


  Notion of User

Anybody can work on a release of a project to modify the source code ... but different persons may need to modify the same subroutine of the same release : to avoid any conflict,
 
 

ClearCase recognizes each one that modify the source code
by its user name



(ClearCase uses the standard environment variable LOGNAME of your environment).

Furthermore, there is something like a special "user", named "public" : anybody can easily look at the source code of this special "user", while the other users are rather private : let's say that at this state of knowledge of ClearCase, you cannot see the source codes of your colleagues except this special colleague named "public"...

Among other things, the "public" user is the place where you will find the main release of a project.
So if you do not want to modify the code, but just look at it, you just need to reach the code of this "public" user.
 

  Notion of Branch

Any user may have to work on different subjects at the same time, and so any user may have to modify the same code for different reasons ... In order to avoid any conflicts within all your modifications of code,
 
 

ClearCase invites you to create " branches"
to label the topics of your modifications.



Each branch you will create will be given a name by yourself.

For each release of each project, there is one very famous branch that you will always have to cope with ; the ClearCase administrators belong it (user name : marp001) and the branch name is always "bf" (stands for "bugfix") : this branch contains the fixes of remaining bugs that have been found after a cycle has been released.

On the user "public", you will be also able to find this branch "bf".
 

  Notion of View
 
 

For ClearCase, a view is
a part of the database that you can see,
once you have defined :

-> the release,

-> the user,

-> the branch.



When you want to make a modification, you will define a view as the background of your modification ; that way, you will not modify the database, but you will add data into the database.

Notice : there is no user nor branch related to the main release of a project, since the main release represents the common background of all users.

The following picture should help you understand the evolution of a release :
 
 


 
 

Exercise n°2

For each topic I am working on, which cycle should I use ?

Click here to get the solution


Lesson n°3
 

Visiting the code

Taking into account the 3 notions defining a view, you are now able to visit the code by getting a view ; to start, you can visit the code of the user "public" by using the following command :

cc_getview -r [release] -u public

At the end, to leave ClearCase, the command is :

. cc_quit ("dot" "space" "cc_quit")

In between, remember that you are under a UNIX session, so :
 
 

you can use UNIX commands !
 

Exercise n°3

Instead of using the source code browser, navigate in the code of ARPEGE cycle 32T0 ;
for example, look at the subroutine scan2h.F90 ; then leave ClearCase.

Click here to get the solution


Lesson n°4

Preparation of a personal view



To create a modification in the code, you should first create a view of yours, using the following command :

cc_getpack -u [user_branch_name] -r [release] -b [reference_branch_name]

At this stage, you have not started any modification, and so your view is seeing the main flow of the selected release of the selected reference branch.

Note that the arguments of u, r and b of cc_getpack are similar to the ones of gmkpack

Let's see it on an example : for instant, let's create a view on cycle 32T0 matching its bugfix  ; the related branch will be named "ainda"...

Type : cc_getpack -r 32T0 -b bf -u ainda

Answer :

Do you want to create view arp_mrpm602_CY32T0_ainda ? [y/n]

Type : y

Answer :

 >  Creating the view arp_mrpm602_CY32T0_ainda ...
Created view.
Host-local path: merou:/home/mrpm602/sto/view/arp_mrpm602_CY32T0_ainda.vws
Global path:     /home/mrpm602/sto/view/arp_mrpm602_CY32T0_ainda.vws
It has the following rights:
User : mrpm602  : rwx
Group: marp     : r-x
Other:          : r-x
 >  Creating associated branch for project ald ...
Created branch type "mrpm602_CY32T0_ainda".
 >  Creating associated branch for project arp ...
Created branch type "mrpm602_CY32T0_ainda".
 >  Creating associated branch for project bla ...
Created branch type "mrpm602_CY32T0_ainda".
 >  Creating associated branch for project mpa ...
Created branch type "mrpm602_CY32T0_ainda".
 >  Creating associated branch for project mse ...
Created branch type "mrpm602_CY32T0_ainda".
 >  Creating associated branch for project obt ...
Created branch type "mrpm602_CY32T0_ainda".
 >  Creating associated branch for project odb ...
Created branch type "mrpm602_CY32T0_ainda".
 >  Creating associated branch for project sat ...
Created branch type "mrpm602_CY32T0_ainda".
 >  Creating associated branch for project scr ...
Created branch type "mrpm602_CY32T0_ainda".
 >  Creating associated branch for project sur ...
Created branch type "mrpm602_CY32T0_ainda".
 >  Creating associated branch for project tal ...
Created branch type "mrpm602_CY32T0_ainda".
 >  Creating associated branch for project tfl ...
Created branch type "mrpm602_CY32T0_ainda".
 >  Creating associated branch for project uti ...
Created branch type "mrpm602_CY32T0_ainda".
 >  Creating associated branch for project xrd ...
Created branch type "mrpm602_CY32T0_ainda".

 >
 >  View : arp_mrpm602_CY32T0_ainda
 >  Path : /home/marp001/dev/arp
 >
 >  Rule  Selection                     Action
 >    1.  CHECKEDOUT
 >    2.  mrpm602_CY32T0_ainda
 >    3.  CY32T0_bf.01                  [write to mrpm602_CY32T0_ainda]
 >    4.  CY32T0                        [write to mrpm602_CY32T0_ainda]
 >    5.  MAIN                          [write to mrpm602_CY32T0_ainda]
 >
 > Available projects for branch mrpm602_CY32T0_ainda:
 >  ald arp bla mpa mse obt odb sat scr sur tal tfl uti xrd
 >
merou:/home/marp001/dev =>

Comment :
ClearCase creates the view "arp_mrpm602_CY32T0_ainda" (because I am the user mrpm602) with the following rules, by order of decreasing priority :

1. CHECKEDOUT
2. mrpm602_CY32T0_ainda
3. CY32T0_bf.01
4.  CY32T0
5. MAIN

* Note that at this moment the version of the bugfix is 01.
This bugfix can change, but anyhow your modifications would remain related to the version 01 of the bugfix.

Exercise n°4

Make a view on cycle 32T1 + bugfix.

Click here to get the solution


Lesson n°5

Making a modification in the code



As we have seen in exercise n° 3, you can view the code by using any editor of your choice ; but since the database is read-only, at this stage, you cannot modify the code.

To modify the code, you should use the following special command :

cc_edit -f [element]

This command is implicitly using your favourite editor, as defined in your file .bash_profile
 
 

Exercise n°5

Modify the subroutine suct0.F90 in the branch 'ainda'

Click here to get the solution


Lesson n°6
 

Controls on the modifications of a branch



There are several commands that can help you control your modifications ; let's see 2 of them :

cc_list
displays the list of the modified elements of the current branch. Note that this comand lists recursively the modified files starting from the current directory (like scanpack does, for gmkpack).

cc_diff -h -f [element]
can show you all the different versions recorded by ClearCase on the selected element.
 
 

Exercise n°6

How many modified elements is there in the
bugfix of cycle 32T0 ?

Control that the subroutine ppreq.F90 is in the bugfix of cycle 32T0,

and show up the differences on this subroutine
between the main cycle 32T0 and its bugfix, using cc_diff

Click here to get the solution


Lesson n°7
 

Compilation



There are no compilers on the machine where ClearCase is installed.
To compile your modset you have to choose another machine where you will export and compile your modifications.

Fortunately this can be done easily by a procedure named cc_export which is linked to gmkpack :

cc_export -b [-c]

-b : to export the whole branch

-c : to create a compilation pack with gmkpack on the target machine (TORI per default) if it does not exist already.

Notice : uses remote shell ; so before running cc_export you have to add merou.meteo.fr in the file .rhosts of TORI

Example : let's make a pack of the bugfix of cycle 32T0 :

cc_getpack -r 32T0

Answer :
 >  Enter the selected view:

Type :
1

Answer :
>
 >  View : arp_mrpm602_CY32T0_ainda
 >  Path : /home/marp001/dev/arp
 >
 >  Rule  Selection                     Action
 >    1.  CHECKEDOUT
 >    2.  mrpm602_CY32T0_ainda
 >    3.  CY32T0_bf.01                  [write to mrpm602_CY32T0_ainda]
 >    4.  CY32T0                        [write to mrpm602_CY32T0_ainda]
 >    5.  MAIN                          [write to mrpm602_CY32T0_ainda]
 >
 > Available projects for branch mrpm602_CY32T0_ainda:
 >  ald arp bla mpa mse obt odb sat scr sur tal tfl uti xrd
 >
merou:/home/marp001/dev

Type :
cc_export -b -c

Answer :

host specificities ...
distant pack identification ...
start remote creation : gmkpack -f /mf/dp/marp/marp001/packs -u ainda -r 32t0 -b bf -v 01 -l SX8RV20 -p aldodb
/cnrm/gp/mrpm/mrpm602/public/bin/gmkpack.6.2.3/util/gmkpack starts.
Creating pack /cnrm/gp/mrpm/mrpm602/pack/ainda upon /mf/dp/marp/marp001/packs/cy32t0_bf.01.SX8RV20.x.pack ...
Architecture file directory :
.gmkfile/
copy SX8R.MF.x from directory /cnrm/gp/mrpm/mrpm602/public/bin/gmkpack.6.2.3/arch
Programs system directories :
sys
sys/odb98.x -> /mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/sys/odb98.x
sys/bl95.x -> /mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/sys/bl95.x
Basic directories :
src
src/local
lib
bin -> /work/mrpm602/SXbin/ainda/bin
Unsatisfied external references directories :
src/unsxref/quiet
src/unsxref/verbose
Sources control directory :
src/.gmak
Sources view :
local
inter.1
main
Links :
src/inter.1 -> /mf/dp/marp/marp001/packs/cy32t0_bf.01.SX8RV20.x.pack/src/local
src/main -> /mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local
Background source descriptors files :
inter.1.sds
main.sds
"main" tree for ald ...
"main" tree for arp ...
"main" tree for bla ...
no tree for coh
"main" tree for mpa ...
"main" tree for mse ...
"main" tree for odb ...
no tree for ost
"main" tree for sat ...
"main" tree for sur ...
"main" tree for tal ...
"main" tree for tfl ...
"main" tree for uti ...
"main" tree for xrd ...
libarp.inter.1.a -> /mf/dp/marp/marp001/packs/cy32t0_bf.01.SX8RV20.x.pack/lib/libarp.local.a
liboulan-uti.inter.1.a -> /mf/dp/marp/marp001/packs/cy32t0_bf.01.SX8RV20.x.pack/lib/liboulan-uti.local.a
libsat.inter.1.a -> /mf/dp/marp/marp001/packs/cy32t0_bf.01.SX8RV20.x.pack/lib/libsat.local.a
libuti.inter.1.a -> /mf/dp/marp/marp001/packs/cy32t0_bf.01.SX8RV20.x.pack/lib/libuti.local.a
libald.main.a -> /mf/dp/marp/marp001/tampon/lib/ald/al32/al32t0_main.01.SX8RV20.x.a
libarp.main.a -> /mf/dp/marp/marp001/tampon/lib/arp/cy32/cy32t0_main.01.SX8RV20.x.a
libbator-uti.main.a -> /mf/dp/marp/marp001/tampon/lib/uti/ut32/ut32t0_bator-main.01.SX8RV20.x.a
libbla.main.a -> /mf/dp/marp/marp001/tampon/lib/bla/bl32/bl32t0_main.01.SX8RV20.x.a
libcma-odb.main.a -> /mf/dp/marp/marp001/tampon/lib/odb/od32/od32t0_cma-main.01.SX8RV20.x.a
libdummyald.main.a -> /mf/dp/marp/marp001/tampon/lib/ald/al32/al32t0_dummy-main.01.SX8RV20.x.a
libdummybla.main.a -> /mf/dp/marp/marp001/tampon/lib/bla/bl32/bl32t0_dummy-main.01.SX8RV20.x.a
libdummympa.main.a -> /mf/dp/marp/marp001/tampon/lib/mpa/mp32/mp32t0_dummy-main.01.SX8RV20.x.a
libdummymse.main.a -> /mf/dp/marp/marp001/tampon/lib/mse/ms32/ms32t0_dummy-main.01.SX8RV20.x.a
libdummyodb.main.a -> /mf/dp/marp/marp001/tampon/lib/odb/od32/od32t0_dummy-main.01.SX8RV20.x.a
libdummysat.main.a -> /mf/dp/marp/marp001/tampon/lib/sat/sa32/sa32t0_dummy-main.01.SX8RV20.x.a
libdummytal.main.a -> /mf/dp/marp/marp001/tampon/lib/tal/ta32/ta32t0_dummy-main.01.SX8RV20.x.a
libextrtovs-uti.main.a -> /mf/dp/marp/marp001/tampon/lib/uti/ut32/ut32t0_extrtovs-main.01.SX8RV20.x.a
libfcq-uti.main.a -> /mf/dp/marp/marp001/tampon/lib/uti/ut32/ut32t0_fcq-main.01.SX8RV20.x.a
libgrib-uti.main.a -> /mf/dp/marp/marp001/tampon/lib/uti/ut32/ut32t0_grib-main.01.SX8RV20.x.a
libmain-odb.main.a -> /mf/dp/marp/marp001/tampon/lib/odb/od32/od32t0_main-main.01.SX8RV20.x.a
libmpa.main.a -> /mf/dp/marp/marp001/tampon/lib/mpa/mp32/mp32t0_main.01.SX8RV20.x.a
libmse.main.a -> /mf/dp/marp/marp001/tampon/lib/mse/ms32/ms32t0_main.01.SX8RV20.x.a
libmtocomp-odb.main.a -> /mf/dp/marp/marp001/tampon/lib/odb/od32/od32t0_mtocomp-main.01.SX8RV20.x.a
libodb.main.a -> /mf/dp/marp/marp001/tampon/lib/odb/od32/od32t0_main.01.SX8RV20.x.a
liboulan-uti.main.a -> /mf/dp/marp/marp001/tampon/lib/uti/ut32/ut32t0_oulan-main.01.SX8RV20.x.a
libport-odb.main.a -> /mf/dp/marp/marp001/tampon/lib/odb/od32/od32t0_port-main.01.SX8RV20.x.a
libpregpssol-uti.main.a -> /mf/dp/marp/marp001/tampon/lib/uti/ut32/ut32t0_pregpssol-main.01.SX8RV20.x.a
libprescat-uti.main.a -> /mf/dp/marp/marp001/tampon/lib/uti/ut32/ut32t0_prescat-main.01.SX8RV20.x.a
libprograms-ald.main.a -> /mf/dp/marp/marp001/tampon/lib/ald/al32/al32t0_programs-main.01.SX8RV20.x.a
libsat.main.a -> /mf/dp/marp/marp001/tampon/lib/sat/sa32/sa32t0_main.01.SX8RV20.x.a
libscr-odb.main.a -> /mf/dp/marp/marp001/tampon/lib/odb/od32/od32t0_scr-main.01.SX8RV20.x.a
libsur.main.a -> /mf/dp/marp/marp001/tampon/lib/sur/sr32/sr32t0_main.01.SX8RV20.x.a
libtal.main.a -> /mf/dp/marp/marp001/tampon/lib/tal/ta32/ta32t0_main.01.SX8RV20.x.a
libtfl.main.a -> /mf/dp/marp/marp001/tampon/lib/tfl/tf32/tf32t0_main.01.SX8RV20.x.a
libunsxref-verbose.main.a -> /mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/lib/libunsxref-verbose.local.a
libuti.main.a -> /mf/dp/marp/marp001/tampon/lib/uti/ut32/ut32t0_main.01.SX8RV20.x.a
libxrd.main.a -> /mf/dp/marp/marp001/tampon/lib/xrd/xr32/xr32t0_main.01.SX8RV20.x.a
Background include/module paths ...
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/ald/module
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/arp/module
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/mpa/chem/internals
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/mpa/chem/module
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/mpa/conv/module
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/mpa/micro/module
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/mpa/turb/module
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/mse/module
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/odb/module
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/sat/module
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/sur/module
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/tal/module
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/tfl/module
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/uti/module
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/uti/prescat/module
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/xrd/fa
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/xrd/module
-I/mf/dp/marp/marp001/packs/cy32t0_bf.01.SX8RV20.x.pack/src/local/.intfb/arp
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/bla/library
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/bla/old2new
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/bla/C_code
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/odb/aux
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/odb/lib
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/odb/tools
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/xrd/support
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/xrd/svipc
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/xrd/utilities
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/odb/ddl.CCMA
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/odb/ddl.ECMA
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/odb/ddl.ECMASCR
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/odb/ddl.MTOCOMP
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/arp/ald_inc/function
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/arp/ald_inc/namelist
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/arp/common
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/arp/function
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/arp/namelist
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/bla/include
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/mpa/chem/interface
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/mpa/chem/internals
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/mpa/conv/interface
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/mpa/micro/interface
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/mpa/turb/interface
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/mse/interface
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/odb/include
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/odb/interface
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/sat/interface
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/sur/function
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/sur/interface
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/tal/interface
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/tfl/interface
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/uti/include
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/uti/namelist
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/xrd/ddh
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/xrd/fa
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/xrd/include
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/xrd/lfi
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/xrd/svipc/include
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/.intfb/ald
-I/mf/dp/marp/marp001/packs/cy32t0_main.01.SX8RV20.x.pack/src/local/.intfb/arp
done.
Genesis :
/cnrm/gp/mrpm/mrpm602/public/bin/gmkpack.6.2.3/util/gmkpack -f /mf/dp/marp/marp001/packs -r cy32t0 -b bf -v 01 -u ainda -l SX8RV20 -o x -p aldodb

Prepare script(s) ...

>  copy compilation and load script on /cnrm/gp/mrpm/mrpm602/pack/ainda/ics_aldodb ...
/cnrm/gp/mrpm/mrpm602/public/bin/gmkpack.6.2.3/util/gmkpack ends.
Start export work to pack "ainda"
 >  arp/setup/suct0.F90 copied
arp/
arp/setup/
arp/setup/suct0.F90
Start remote work to pack "ainda"
Trying krb4 rcp...
trying normal rcp (/usr/bin/rcp)
arp/
arp/setup/
arp/setup/suct0.F90
End remote work
End cc_export.

Comment : On TORI you have now a pack named 'ainda' which matches your ClearCase view 'ainda'.

Notice : cc_export has other options ; here are some of them :

-l files_list : instead of -b, to export a list of source files (files_list is the file containing this list)
-f filename : instead of -b, to export a single source file
-v : instead of -b, to export the whole view
-h [host_name] : to export to the machine host_name (like lxgmapXX)
-P [Pack_name] : to export to the pack Pack_name


Exercise n°7

Export the file scan2h.F90 from your branch 'ainda' to the pack 'ainda'

Click here to get the solution


Before sailing away ...

You have been presented the basic ClearCase commands.

You are now gently invited to read the manual :
TRANSPARENT USE OF CLEARCASE to learn more !



Among all the other ClearCase commands, let me draw your attention to some of them which are often useful :

cc_help
In-line manual of the ClearCase commands

cc_add
To create a new element in your branch

option -k of cc_edit together with cc_put
To limit the number of "Checked_out/Checked_in" operations you may do on an element (in order to limit the number of versions you will create on this element)

cc_merge
To merge your modifications with somebody else's

cc_popul
To update your branch with elements contained in a directory of yours

cc_rmlast
To remove the last version you have created on an element in your branch

cc_rmbranch
To remove completely an element in your branch

cc_rmview
To remove a view

cc_update
To update a default value for the project and the release when you want to get a view

cc_versions
To get the list of your views.

Last notice : when you create a view, ClearCase creates a lot of files in your user. As a consequence, you should remove the views you have created once they become old-fashionned, in order not to overpass your quota of files ! From time to time, control your quota by typing quota -v , and remove files inside the directory : $HOME/ccase/tmp
 
 

Have much fun with ClearCase,

and never forget that

  the ClearCase Administrators 

are here to help you !


Solutions of the exercises


Exercise n°1

In case of any problem, ask your ClearCase administrator.
Note that the command cc_init -p arp will create 2 new directories : ~/sto/ and ~/ccase/ in your home directory :
 
 

you should never change
what are inside the directories ~/sto/ and ~/ccase/
(except 
~/ccase/tmp)
otherwise you may get into serious problems !

Click here to go to the next lesson


Exercise n°2

This is a question you should ask to your supervisor.

In general, if your topic of work is pure technical development, it is recommanded to work on the most recent cycle, in order to reduce the problems of merging afterwards ; on the opposite, if your topic of work is a scientific study, it may be better to work on an older cycle that may be more stable.

Anyhow, ask your supervisor.

Click here to go to the next lesson


Exercise n°3

Type : cc_getview -r CY32T0 -u public

Answer :

 >  Available views for project arp and release CY32T0:
 >     0 : exit
 >     1 : arp_public_CY32T0
 >     2 : arp_public_CY32T0_bf
 >     3 : arp_public_CY32T0_mrpm631nan
 >  Enter the selected view:


Comment :

ClearCase invites you to choose one of the available public views of the release "CY32T0" by selecting a number.

First of all, note that the name of a view is composed of a now-arbitrary prefix 'arp' and the famous 3 elements :

arp_$user_$release_$branch

(The only exception is the main release [1] that has no branch extension... though it is considered here has a view ! You'd better imagine that here is missing the branch extension "_main")

You can recognize [2] as the famous "bugfix" , while there are also other public views ...

Type : 1

Answer :
 >
 >  View : arp_public_CY32T0
 >  Path : /home/marp001/dev/arp
 >
 >  Rule  Selection                     Action
 >    1.  CY32T0                        [read-only]
 >
 > Available projects for branch public_CY32T0:
 >  ald arp bla mpa mse obt odb sat scr sur tal tfl uti xrd
 >
merou:/home/marp001/dev =>

Comment :

You are now in the view arp_public_CY32T0 ; you can navigate in the code using any UNIX command !

Example :

Type :
ls

Answer :

ald  bla  man  mpa  obt  old  sat  sct  ssm  tal   tfl  uti
arp  coh  moc  mse  odb  ost  scr  ssa  sur  test  tov  xrd

Comment :

These are the main directories of the code.

Now let's search for scan2h.F90 :

Type : find arp -name "scan2h.F90"

Answer :

arp/control/scan2h.F90

Now let's view scan2h.F90 with an editor, for instance vi :

Type :
vi
arp/control/scan2h.F90

Etc, etc ...
But you will not be allowed to modify or remove an element, because the file system of the database is Read-only !

Finally, to leave the view :

Type :
. cc_quit

Click here to go to the next lesson


Exercise n°4

If you are already in a view, leave it by typing :
. cc_quit

(Note that you should not create a view within a view).

Let's create the branch toto :

Type : cc_getpack -r 32T1 -b bf -u toto

Click here to go to the next lesson


Exercise n°5


Type :

cd arp/setup
cc_edit -f suct0.F90

Comment :

ClearCase might inform you whether other people have modified this subroutine on top of this release already. This should not stop you.

Now here you are editing ... For instance, let's add at the end the following line :
WRITE(NULOUT,*) 'toto footprints!'
Then save and quit

Answer :

Checked out "suct0.F90" from version "/main/mrpm602_CY32T0_ainda/1".
Checked in "suct0.F90" version "/main/mrpm602_CY32T0_ainda/2".

Comment :

The element you have modified has been "checked out" : you got a copy for modifications.
Then you modified this copy, and finally, the element has been "checked in" : you have recorded your
modification in the database.

Click here to go to the next lesson


Exercise n°6

Type :

. cc_quit

cc_getview -r32T0 -upublic

2

cc_list

Answer :

arp/adiab/lacone.F90
arp/canari
arp/canari/can1.F90
arp/canari/caprsurf.F90
arp/canari/carcli.F90
arp/pp_obs/hoptl.F90
arp/pp_obs/ppreq.F90
arp/setup/sulap.F90
sat/rttov/rttov_calcbt_ad.F90
sat/rttov/rttov_calcbt.F90
sat/rttov/rttov_calcbt_tl.F90
uti/combi/stat.F90
uti/oulan/ext_gpssol.F
uti/oulan/ext_radomeh.F

Comment :

ClearCase lists all the elements of the branch public_CY32T0_bf
You can see 1 directory and 13 files, and among them : ppreq.F90
Note that the presence of a directory means that one or more files have been created.


Type :

cd arp/pp_obs
cc_diff -h -f ppreq.F90

Answer :

  >  ppreq.F90 versions:
 >    0:  cancel
 >    1:  1 (CY20, CY19T2, CY19T1, CY19, CY18T3, CY18T2, CY18T1, CY18T0, CY18)
 >    2:  marp001_CY20_cy21/1
 >    3:  2 (CY21T2, CY21T1, CY21)
 >    4:  marp001_CY21T2_cy22/1
 >    5:  3 (CY23T1, CY23, CY22T2, CY22T1, CY22)
 >    6:  marp001_CY23T1_cy24/1
 >    7:  4 (CY25T2, CY25T1, CY25, CY24T2, CY24T1, CY24)
 >    8:  marp001_CY25T2_cy26/1
 >    9:  5 (CY27, CY26T1, CY26)
 >   10:  marp001_CY27_cy28/1
 >   11:  6 (CY28T3, CY28T2, CY28T1, CY28T0, CY28)
 >   12:  marp001_CY28T3_cy29/1
 >   13:  7 (CY32T1, CY32T0, CY32, CY31T2, CY31T1, CY31T0, CY31, CY30T1, CY30, CY29T4, CY29T3, CY29T2, CY29T1, CY29)
 >   14:  marp001_CY31T1_op1NEC/1 (CY31T1_op1NEC.13, CY31T1_op1NEC.12, CY31T1_op1NEC.11, CY31T1_op1NEC.10)
 >   15:  marp001_CY32T0_bf/1 (CY32T0_bf.01)
 >   16:  marp001_CY32T1_bf/1 (CY32T1_bf.02, CY32T1_bf.01)
 >   17:  marp003_CY32T0_TEST2/1
 >   18:  marp003_CY32T0_TEST3/1
 >   19:  marp003_CY32T0_TEST4/1
 >   20:  marp003_CY32T0_firefly/1
 >   21:  marp003_CY32T0_popvob/1
 >   22:  marp003_CY32T0_popvob2/1
 >   23:  marp003_CY32T0_popvob3/1
 >   24:  marp003_CY32T0_popvob4/1
 >   25:  marp003_CY32T0_popvob5/1
 >  Selected versions (0 for exit):

Comment :

ClearCase invites you to select the numbers corresponding to the versions of the element you wish to compare ; in this case, we want to compare the versions "main release cycle 32T0" and "bugfix cycle 32T0" :

Type :
13 15

Answer is a new window opening " xcompare" :
 

xcompare window




Comment :

ClearCase opens a window displaying the two versions ; you can navigate to examine the differences.

Click here to go to the next lesson



Exercise n°7

Type :

cd arp/control
cc_export -f scan2h.F90

Answer :

host specificities ...
distant pack identification ...
Start export work to pack "ainda"
 >  arp/control/scan2h.F90 copied
arp/
arp/control/
arp/control/scan2h.F90
Start remote work to pack "ainda"
Trying krb4 rcp...
trying normal rcp (/usr/bin/rcp)
arp/
arp/control/
arp/control/scan2h.F90
End remote work
End cc_export.

Click here to return to the top of document