How Compile the Example Programs

Prerequisites

  1. In order to use POOL, you must use a supported platform and have access to all the required software as described here.

  2. Please make sure you are using the correct version of SCRAM (SCRAM is the software configuration and code management tool used by LCG), namely the wrapper script provided at
    /afs/cern.ch/sw/lcg/app/spi/scram/scram
    
    (use 'which scram' to check). If SCRAM is not found, or if a different version is found, you can change your PATH as follows to get the correct version of SCRAM:

    If you type 'scram list', you should see POOL listed as an installed project. If you don't see POOL among the installed projects but instead get a list of other projects, the environment variable SCRAM_HOME may be set to the wrong value. For POOL, SCRAM_HOME is set by the SCRAM wrapper script mentioned above and should not be set directly by the user.

    The default architecture name for the current POOL and SEAL releases is slc3_ia32_gcc323. On lxplus, the default is Linux__2.4, so you need to either set the environment variable SCRAM_ARCH to slc3_ia32_gcc323, or use '-arch slc3_ia32_gcc323' option with every scram command.

    To switch to the debug environment, type: Get access to the POOL CVS repository so that you will be able to check out the source code of the POOL examples:

Preparing Your Working Area

  1. Create a directory where you will work and 'cd' to it:
    mkdir ~/mypool
    cd mypool
    

  2. Prepare your working area for using the POOL release:
    scram project POOL POOL_2_0_0
    
    This will create the necessary subdirectories and check out the configuration files needed to compile the example programs as discussed below. (Note that with this setup example programs and libraries will be built against the POOL release, i.e. you don't need to recompile the complete POOL release yourself).

Compiling and Running the POOL Example Programs

  1. Use the following commands to build the POOL Example Programs

    cd ~/mypool/POOL_2_0_0/src
    cvs co -r POOL_2_0_0 Examples 
    cd Examples/TheParticularExample
    scram b
    
    An executable named TheParticularExample will appear under the directory
    ~/mypool/POOL_2_0_0/slc3_ia32_gcc323/examples/bin

    Most examples depend on example-specific libraries. The latter have to be built before the example applications themselves:

    cd ~/mypool/POOL_2_0_0/src/Examples/Libraries/TheParticularExampleLibrary
    scram b
    
    A shared library named libTheParticularExampleLibrary.so will appear under the directory
    ~/mypool/POOL_2_0_0/slc3_ia32_gcc323/examples/lib

  2. If under the top level source directory of an example application or library there is a subdirectory called dict, then a dictionary shared library will be created for the header files specified in the BuildFile inside the dict directory.
    The shared library named libTheExampleLibraryDict.so will appear under the directory

    ~/mypool/POOL_2_0_0/slc3_ia32_gcc323/examples/lib
    Note the Dict suffix which is appended in case it is not the ending of the name of the package (library or application).

  3. Set up the run-time environment:

  4. Instructions on what programs are available and how to run them are linked to the main POOL workbook page.

Compiling the Test Programs of Individual POOL Components

Most POOL components have one or more unit test programs located in a subdirectory 'test' of each component. In the following we illustrate how to build the unit test program for the FileCatalog (for other components, replace 'FileCatalog' by the corresponding component name):
  1. Check out the source code:
    cd ~/mypool/POOL_2_0_0/src
    cvs co -r POOL_2_0_0 FileCatalog
    
  2. Compile the test program:
    cd FileCatalog/tests
    scram b
    
  3. Set up the run-time environment and run the test program:

    Depending on the component, some more component-specific setup may be required before the test program can be run successfully. For a description of the different unit test programs, please see the description of the example programs for the corresponding component that is linked to the main POOL workbook page.