CERN Accelerating science

This website is no longer maintained. Its content may be obsolete. Please visit http://home.cern/ for current CERN information.

Howto make an upgraded package visible in a release

Author: Jakub Moscicki

Date: 16 Aug 2001

Common procedures for local installation of upgraded packages


1. Introduction

You can test a new or upgraded package against other packages in any Anaphe release just using the standard environment setup (following the instructions in the release notes). Typically for csh it looks like:
echo setting up environment for Anaphe version: $1
setenv LHCXXTOP /afs/cern.ch/sw/lhcxx
source $LHCXXTOP/share/LHCXX/${1}/install/sharedstart.csh 
Such a setup uses the libraries and header files of Anaphe packages released under common Anaphe version: $1 (any number like 3.6.0). Now suppose that you have upgraded your package and you want to see if other packages which use/depend on this package still work correctly. However your upgraded package is not visible in the old release which still uses the old version. Common procedures how to make a new version of your package visible to other packages of a given Anaphe release are described below.

2. Create local mirror of AFS release tree

The following script makes a local copy of AFS installed Anaphe release. MY_TOP variable indicates local directory (corresponding to LHCXXTOP). Note that only symbolic links are copied so this operation is fast and does not waste disk space. Symbolic links point back to original AFS installation.
#!/bin/csh -f

if($#argv < 1) then
echo Usage: mkrel anaphe_version
echo creates a local release from existing afs release
echo example: mkrel 3.6.2
exit 0
endif

echo creating local Anaphe release for version: $1

#----
setenv LHCXXTOP /afs/cern.ch/sw/lhcxx
source $LHCXXTOP/share/LHCXX/${1}/install/sharedstart.csh 
#----

setenv MY_TOP /home/moscicki/scratch

cd ${MY_TOP}/specific/${PLATF}
mkdir $1

( cd $LHCXX_REL_DIR/..; tar -cf - $1 | ( cd ${MY_TOP}/specific/${PLATF} ; tar xf - ) )

3. Set up the environment to use local release tree

Source this script to override LHCXXTOP and LHCXX_REL_DIR. Again you need to change the hardcoded path to your local directory.

# prepare regular enviroment for Anaphe version $1
setenv LHCXXTOP /afs/cern.ch/sw/lhcxx
source $LHCXXTOP/share/LHCXX/${1}/install/sharedstart.csh 

# now we have PLATF defined

setenv GLOBAL_LHCXX_REL_DIR $LHCXX_REL_DIR

setenv LHCXXTOP /home/moscicki/scratch
setenv LHCXX_REL_DIR ${LHCXXTOP}/specific/${PLATF}/$1

4. Install your package to the local 'specific' directory

The main makefile of your package should support specinstall target (this is standard Anaphe procedure). Since LHCXX_REL_DIR and LHCXXTOP now point to your local tree you should specinstall your package there. For example, FML with symbolic version number TEST should be installed like this:
 gmake specinstall "FML_VERSION=TEST"

5. Override new package version in the local release.

Unless you change it, the links in your local mirror of release directory point back to AFS release. The following script changes the links.

#!/bin/csh -f

if($#argv < 2) then
echo Usage: mklinks package_name version
echo replaces lib and include links in current release dir
echo LHCXX_REL_DIR = $LHCXX_REL_DIR
echo example: mklinks FML 1.1.1.1
exit 0
endif

setenv PACKAGE_DIR  $LHCXX_REL_DIR/../$1/$2

echo replacing include link $LHCXX_REL_DIR/include/$1
rm -f $LHCXX_REL_DIR/include/$1
ln -s -f $PACKAGE_DIR/include $LHCXX_REL_DIR/include/$1

cd $PACKAGE_DIR/lib
foreach X (*.so)
echo replacing lib link $LHCXX_REL_DIR/lib/$X
ln -s -f $PACKAGE_DIR/lib/$X $LHCXX_REL_DIR/lib/$X
end
For example to use TEST version of FML which was previously specinstalled locally write:
mklinks FML TEST
REMEMBER THAT LHCXXTOP and LHCXX_REL_DIR MUST POINT TO LOCAL DIRECTORY!

6. Done

Now other libraries will use the new version of FML with symbolic number TEST.

7. Notes:

You do not have to mklinks for Interfaces because specinstall already changes the links.

To compile Lizard you should do:

..afs../~pfeiffer/public/scripts/Anaphe/doAll.py --package Lizard anaphe_version
You should also have to XML database files (get them from Andreas).