Go to Notes and Further References, Exercises, top,

Private Development: SRT commands
Creating Test Release
  • newrel -t development dir
    • Creates a test release in dir based on development Base Release.
    • Can also base on Frozen Release.
  • addpkg -h
    • Adds a package that you want to modify.
    • srt will get using cvs to get the code.
    • -h means get it from the head i.e. development.
    • Repeat as required.
  • lnkpkg
    • Links in a dependent package (can use srt tool depend to see what is).
    • Repeat as required.
  • rmpkg
    • Removes a package you no longer need.

Private Development: SRT commands
Selecting A Test Release
  • srt_setup -a
    • Sets SRT_PRIVATE_CONTEXT to current directory and adds to environment.
    • So you can have multiple test releases and switch between them.
  • srt_setup -d
    • Removes private release from environment (but doesn't touch any files!)
    • Sets SRT_PRIVATE_CONTEXT to ./
  • Caution
    • If in doubt check setting of SRT_PRIVATE_CONTEXT
    • Don't have it set if working with the Base Release!
    • Make sure its set when working privately!
Selecting A Base Release
  • srt_setup
    • Sets SRT_PUBLIC_CONTEXT to the default Base Release (held in SRT_BASE_RELEASE)
  • srt_setup SRT_BASE_RELEASE=version
    • Sets SRT_PUBLIC_CONTEXT to the specified Base Release e.g. R1.1.0

Notes and Further References

None so far.


Before running any exercises see tutorial preparation.

To create a test release, first decide a name. For the purposes of this exercise call it MyTest and assume that it is to be created in the directory called <myname> that you own. Carry out the following steps:-

  1. Move to your working directory:-
      cd <myname>
  2. Create the release:-
      newrel -t development MyTest
    This will create the subdirectory MyTest and set up some subdirectories ready for srt.

  3. Now
      cd MyTest
      srt_setup -a
    This defines the environmental variable $SRT_PRIVATE_CONTEXT that will point to <myname>/MyTest.

  4. Initially the Test Release is empty; everything will still come from the development Base Release, so the next thing to do is to add the package that you want to modify, but this will involve pulling a copy out of the Repository as explained in the cvs. This should be done automatically when you use the addpkg command.

  5. Now you can add the packages you want to modify, in your case its only Demo:-
      addpkg -h Demo
    and should see cvs copying them into your Demo subdirectory.

    If this fails it may be that anonymous cvs read access has not been enabled so, as explained in the Remote cvs access slide:-

    setenv CVSROOT :pserver:anonymous@minoscvs.fnal.gov:/cvs/minoscvs/rep1 cvs login If you don't know it, ask someone else in MINOS the password.

    Now try the addpkg command again.

  6. Next build the Demo library libDemo.so:- gmake Demo.all If you want to confirm the library really has been built type:-
      ls -l $SRT_PRIVATE_CONTEXT/lib/$SRT_SUBDIR/libDemo.so
    SRT places libraries below the lib/ directory in a subdirectory that
    is specific to the platform and compiler.  For example $SRT_SUBDIR =
    Linux2.4-GCC means the Linux kernel 2.4 running the gcc compiler.

  7. Finally run loon just to confirm that it is working:- cd ../ loon -q $MINOS_TUTORIAL_MACROS/run_EventDump.C $MINOS_TUTORIAL_DATA/F00018143_0000.mdaq.root Although loon has not been rebuilt, thanks to the wonderful world of dynamic libraries, it should load your libDemo.so instead of the standard on. Of course, at this stage it is identical to the standard one but at least it confirms that you build produced a valid library.

Once you logged out the $SRT_PRIVATE_CONTEXT variable will no longer be defined. As explained in the slide above when you log back in you will have to remember to:- cd <myname>/MyTest srt_setup -a

Restoring the Original Demo Package

If at any time you want to go back the original Demo package, then the easiest way is to:-
  1. cd <myname>/MyTest/Demo
  2. rm *.cxx *.h
  3. cvs update
    (CVS will update all the missing *.cxx and *.h by getting fresh copies from the Repository).
  4. cd ../
  5. gmake Demo.all
Contact: Nick West <n.west1@physics.ox.ac.uk>
Security, Privacy, Legal Fermi National Accelerator Laboratory