Project

General

Profile

Cetbuildtools user guide - Cetbuildtools cmake modules - Defining products in the CET build environment - Using the example - Buildtool script

Defining products in the CET build environment

All information about dependent products is found in ups/product_deps. This file is parsed by setup_for_development. It is also parsed by cmake to create the ups table and version files.

Brief description of product_deps

Product_deps contains the product name and version, default qualifier, dependent products and their versions, and a matrix of allowed qualifier combinations. It may also optionally contain lines that define the names of certain installed directories.

Elements on a single line are whitespace separated. Both tabs and spaces are recognized.

Elements of product_deps

comment

A "#" as the first character of a line marks it as a comment.
No attempt is made to recognize comments within a line.
Blank lines are also ignored.

parent <product-name> <product-version>

This line defines the product name and version.
It must be the first non-comment line in product_deps.

defaultqual <default-qualifier>

The default qualifier will be used if a qualifier is not specified when calling setup_for_development.
Do not include debug, opt, or prof in the default qualifier. Those are defined independently.

You may specify a compound qualifier as the default. For instance, both e6 and s4:e6 are valid default qualifiers.

XXXdir <path> <subdirectory-name>

The XXXdir lines help define the installed directory structure.
Use the appropriate line if the desired install directory does not match the default.

There are only 3 acceptable values for path: "product_dir", "fq_dir", and "-".
The subdirectory name can be anything.

If the path field contains a dash, then the directory is not defined for this product.
For instance, cetbuildtools has no headers, so cetbuildtools/ups/product_deps contains incdir -.

Name Default Directory Path Default Subdirectory Name
incdir product_dir include
fcldir product_dir fcl introduced in cetbuildtools v3_07_00
libdir fq_dir lib
bindir fq_dir bin
fwdir - unspecified introduced in cetbuildtools v3_11_00
gdmldir - gdml introduced in cetbuildtools v3_09_00

Specifying dependent products

Beginning with cetbuildtools v4_00_00, all product definitions are in the product version block.

This block is a list of dependent products and their associated versions. Qualifiers are not mentioned here.
The first line, "product version", is essentially a keyword telling the parser that subsequent lines contain <product-name> <version> pairs.
The parser will stop looking for products when it finds the "end_product_list" line.

If dependent_product_version is a dash, the "current" version will be specified.

Beginning with cetbuildtools v4_00_00, the third field is used to include an optional qualifier that can be used to allow the build to use one of several different releases of the same product if the third field is specified. The sN qualifiers have a defined name which matches a specific release of art. The code you are building cannot change based on the optional qualifier.
For instance, ifdh_art v1_5_2 uses these lines:

art             v1_12_00        s5
art             v1_11_03        s4
art             v1_10_00b       s3

If a dependent product is optional, then add "optional" to the fourth field.

Some products, notably cetbuildtools, are required for the build but should not be in the table file.
Use "only_for_build" in the fourth field to specify these products.
The tools presume that any product specified as "only_for_build" has no qualifiers.
In the unlikely event that you are using some product only for the build which requires qualifiers, the product must be listed normally.

Specifying dependent products prior to cetbuildtools v4_00_00

The product version block

This block is a list of dependent products and their associated versions. Qualifiers are not mentioned here.
The first line, "product version", is essentially a keyword telling the parser that subsequent lines contain <product-name> <version> pairs.
The parser will stop looking for products when it finds the next keyword.

If dependent_product_version is a dash, the "current" version will be specified.

If a dependent product is optional, then add "optional" to the third field.

only_for_build <product> <version>

Some products, notably cetbuildtools, are required for the build but should not be in the table file.
Use "only_for_build" to specify these products. Such products should not be in the regular product list.
The tools presume that any product specified as "only_for_build" has no qualifiers.
In the unlikely event that you are using some product only for the build which requires qualifiers, the product must be listed normally.

cetpkgsupport

cetpkgsupport is required by all products using the CET environment.
It is a special case and will be added to the table file automatically.
DO NOT list cetpkgsupport in product_deps.

Specifying qualfiers

Allowed qualifiers are defined in a matrix of product names versus qualifier names.
You must use the full and complete qualifier (e.g., a7:debug) in the product-qualifier matrix.

The first line, which serves as both a keyword and list of products has the form:

qualifier <product-1> <product-2> <product-3> notes

All subsequent lines have the form:
<parent-qualifier> <product-1-qualifier> <product-2-qualifier> <product-3-qualifier> <notes>

The same list of products should be in both the product block and the qualfier block. Order is not important.
If a product, such as gcc, has no qualifier, then the qualifier field must contain "-nq-".
If a product should not be setup for this parent qualifier, the qualifier field must contain "-".

If the notes field is present, everything on the line past the last product qualifier is treated as a comment and may contain whitespace.

We use tabs to keep the columns neatly aligned.

Certain products, such as root, have their own dependencies. We DO NOT list these dependencies. Instead, these dependencies are pulled in by the product, ensuring that we have a consistent library set for the build. If we list them separately, we risk forgetting to update a version and having an inconsistent build. We do, however, list gcc explicitly. This should be the only exception.

Beginning with cetbuildtools v4_00_00, the qualifier matrix should end with the line "end_qualifier_list".

Custom information

Very occasionally, you may need to add an extra definition to a ups table file. For such cases, you may supply a table fragment, using keywords "table_fragment_begin" and "table_fragment_end".

table_fragment_begin
   envSet(MYVAR,${UPS_PROD_DIR}/${UPS_PROD_FLAVOR}/somedir)
table_fragment_end

Example product_deps used by art

# The parent line must be the first non-comment line in the file
# This line defines the product name and version
parent art      v1_12_00
defaultqual     e6
#
fcldir -
#
product         version
clhep           v2_2_0_3
cppunit         v1_12_1a
gccxml          v0_9_20140718
python          v2_7_8
root            v5_34_21
messagefacility v1_11_15
tbb             v4_2_5
cetbuildtools   v4_02_01        -       only_for_build
end_product_list

# e5  - with gcc 4.7.1 and -std=c++11
qualifier       messagefacility root            clhep           cppunit         gccxml  python  tbb             compiler  notes
e5:debug        e5:debug        e5:debug        e5:debug        e5:debug        -nq-    -nq-    e5:debug        gcc
e5:prof         e5:prof         e5:prof         e5:prof         e5:prof         -nq-    -nq-    e5:prof         gcc
e5:prof:sse2    e5:prof         e5:prof         e5:prof         e5:prof         -nq-    -nq-    e5:prof         gcc       -msse2 -ftree-vectorizer-verbose
nu:e5:debug     e5:debug        e5:nu:debug     e5:debug        e5:debug        -nq-    -nq-    e5:debug        gcc
nu:e5:prof      e5:prof         e5:nu:prof      e5:prof         e5:prof         -nq-    -nq-    e5:prof         gcc
e6:debug        e6:debug        e6:debug        e6:debug        e6:debug        -nq-    -nq-    e6:debug        gcc
e6:prof         e6:prof         e6:prof         e6:prof         e6:prof         -nq-    -nq-    e6:prof         gcc
e6:prof:sse2    e6:prof         e6:prof         e6:prof         e6:prof         -nq-    -nq-    e6:prof         gcc       -msse2 -ftree-vectorizer-verbose
nu:e6:debug     e6:debug        e6:nu:debug     e6:debug        e6:debug        -nq-    -nq-    e6:debug        gcc
nu:e6:prof      e6:prof         e6:nu:prof      e6:prof         e6:prof         -nq-    -nq-    e6:prof         gcc
i1:debug        i1:debug        e5:debug        e5:debug        e5:debug        -nq-    -nq-    e5:debug        icc
i1:prof         i1:prof         e5:prof         e5:prof         e5:prof         -nq-    -nq-    e5:prof         icc
e5:itbb:debug   e5:debug        e5:debug        e5:debug        e5:debug        -nq-    -nq-    i1:debug        gcc
e5:itbb:prof    e5:prof         e5:prof         e5:prof         e5:prof         -nq-    -nq-    i1:prof         gcc
end_qualifier_list

# Local Variables:
# tab-width: 8
# End:

# vi:set ts=8 noexpandtab:

Example product_deps used by artdaq

Notice that different qualifiers use different product sets.

# The parent line must be the first non-comment line in the file
# This line defines the product name and version
parent artdaq   v1_04_01
defaultqual     e4:ib

# These optional lines define the installed directories where
# headers, libraries, and executables will be found
# Use them only if your product does not conform to the defaults
# Format: directory_type directory_path directory_name
# The only recognized values of the first field are incdir, libdir, and bindir
# The only recognized values of the second field are product_dir and fq_dir
# The third field is not constrained
# The examples here reflect the defaults
incdir      product_dir include
fcldir      product_dir
libdir      fq_dir      lib
bindir      fq_dir      bin

#
product         version         optional
gcc             v4_8_1
art             v1_08_09
mvapich2        v1_9_0
mpich           v3_0_4
xmlrpc_c        v1_25_24

# list products required ONLY for the build
# any products here must NOT have qualifiers
only_for_build  cetbuildtools   v3_07_00
only_for_build  smc_compiler    v6_1_0

# e4  - with gcc 4.8.1 and -std=c++11
# -nq- means there is no qualifier
# a - means the dependent product is not required by the parent and will not be setup
qualifier               art             mvapich2        mpich           xmlrpc_c        gcc     notes
e4:ib:debug             e4:debug        -nq-            -               e4:debug        -nq-    -std=c++11
e4:ib:prof              e4:prof         -nq-            -               e4:prof         -nq-    -std=c++11
nu:e4:ib:debug          nu:e4:debug     -nq-            -               e4:debug        -nq-    -std=c++11
nu:e4:ib:prof           nu:e4:prof      -nq-            -               e4:prof         -nq-    -std=c++11
mu2e:e4:ib:debug        mu2e:e4:debug   -nq-            -               e4:debug        -nq-    -std=c++11
mu2e:e4:ib:prof         mu2e:e4:prof    -nq-            -               e4:prof         -nq-    -std=c++11
e4:eth:debug            e4:debug        -               e4:debug        e4:debug        -nq-    -std=c++11
e4:eth:prof             e4:prof         -               e4:prof         e4:prof         -nq-    -std=c++11
nu:e4:eth:debug         nu:e4:debug     -               e4:debug        e4:debug        -nq-    -std=c++11
nu:e4:eth:prof          nu:e4:prof      -               e4:prof         e4:prof         -nq-    -std=c++11
mu2e:e4:eth:debug       mu2e:e4:debug   -               e4:debug        e4:debug        -nq-    -std=c++11
mu2e:e4:eth:prof        mu2e:e4:prof    -               e4:prof         e4:prof         -nq-    -std=c++11

# Preserve tabs and formatting in emacs and vi / vim:

### Local Variables:
### tab-width: 8
### End:

# vi:set ts=8 noexpandtab:

Example product_deps used by ifdh_art

# The parent line must be the first non-comment line in the file
# This line defines the product name and version
parent ifdh_art v1_5_2
defaultqual     s4:e6

# These optional lines define the installed directories where headers,
# libraries, and executables will be found.
#
# Format: directory_type directory_path directory_name
#
# The only recognized values of the first field are incdir, libdir, and bindir
# The only recognized values of the second field are product_dir and fq_dir
# The third field is not constrained.
#
# If a particular directory_type is not specified that item will not be
# set up in the UPS table file.
incdir      fq_dir      inc
fcldir      -

# new option: distinguishing qualifier to allow building 
# against different versions of some dependent product IFF 
# there are no changes required in the code for the different dependencies
product         version         distinguishing-qualifier
art             v1_12_00        s5
art             v1_11_03        s4
art             v1_10_00b       s3
ifbeam          v1_4_4a
nucondb         v1_4_4a
cetbuildtools   v4_01_04       -       only_for_build
end_product_list

# -nq- here means there is no qualifier
qualifier       art             ifbeam          nucondb         compiler
s3:e5:debug     e5:debug        s3:e5:debug     s3:e5:debug     gcc
s3:e5:prof      e5:prof         s3:e5:prof      s3:e5:prof      gcc
s3:nu:e5:debug  e5:debug:nu     s3:e5:debug     s3:e5:debug     gcc
s3:nu:e5:prof   e5:prof:nu      s3:e5:prof      s3:e5:prof      gcc
s4:e5:debug     e5:debug        s4:e5:debug     s4:e5:debug     gcc
s4:e5:prof      e5:prof         s4:e5:prof      s4:e5:prof      gcc
s4:nu:e5:debug  e5:debug:nu     s4:e5:debug     s4:e5:debug     gcc
s4:nu:e5:prof   e5:prof:nu      s4:e5:prof      s4:e5:prof      gcc
s4:e6:debug     e6:debug        s4:e6:debug     s4:e6:debug     gcc
s4:e6:prof      e6:prof         s4:e6:prof      s4:e6:prof      gcc
s4:nu:e6:debug  e6:debug:nu     s4:e6:debug     s4:e6:debug     gcc
s4:nu:e6:prof   e6:prof:nu      s4:e6:prof      s4:e6:prof      gcc
s5:e5:debug     e5:debug        s4:e5:debug     s4:e5:debug     gcc
s5:e5:prof      e5:prof         s4:e5:prof      s4:e5:prof      gcc
s5:nu:e5:debug  e5:debug:nu     s4:e5:debug     s4:e5:debug     gcc
s5:nu:e5:prof   e5:prof:nu      s4:e5:prof      s4:e5:prof      gcc
s5:e6:debug     e6:debug        s4:e6:debug     s4:e6:debug     gcc
s5:e6:prof      e6:prof         s4:e6:prof      s4:e6:prof      gcc
s5:nu:e6:debug  e6:debug:nu     s4:e6:debug     s4:e6:debug     gcc
s5:nu:e6:prof   e6:prof:nu      s4:e6:prof      s4:e6:prof      gcc
end_qualifier_list

# Preserve tabs and formatting in emacs and vi / vim:

### Local Variables:
### tab-width: 8
### End:

# vi:set ts=8 noexpandtab: