/" ; \ path_append LD_LIBRARY_PATH "" Unix "${ROOT}/${CMTCONFIG}" ; \ path_remove PATH "" Win32 "//" ; \ path_append PATH "" Win32 "${ROOT}/${CMTCONFIG}" Configuration patterns Describe recurrent configuration operations or policies in a project or a software domain Enforce project policies Automate and parameterize complex operations Extend the CMT concepts Pattern application can be: Explicit (manual) using the apply_pattern keyword Application is on a package basis Automatic when patterns have the –global keyword Applied to all packages that see the pattern in the dependency graph Definition of a pattern A sequence of templated cmt statements Templates: Automatic: User defined: Examples: Defining the project-wide policy for include search path Defining automatic shared library access path Enforcing a systematic QA test application pattern -global include_path include_path ${_root}// pattern quality_test \ application test –s=../test test.cxx package Pa use ProjectPolicy quality_test other_sources=*.cxx In ProjectPolicy In package Pa Container and release packages: Purely managerial packages Not involved when using the software Only provide a CMT requirements file with a set of explicit use statements No wild cards Purpose: Specifies the set of exact version for a release of a software domain Drive the cmt broadcast commands over the complete software domain One top container can provide a release package Release. It describes the complete software release of the project Every new release of the project implies a new release of the Release container. Interface packages: Provide an interface between a software project managed by CMT and a so-called external product (i.e. not managed by CMT) Specify the native version value defined by the product (as opposed to the CMT version tag) Adapt the policies and conventions to the project’s ones Eg Include directory Construct the compiler and linker options for this product Set the runtime options (PATH, LD_LIBRARY_PATH, etc…) Specify the material to export when constructing a distribution kit Examples MySQL ROOT SEAL Geant4 Java kits The LCGCMT project is entirely made of such interface packages Connect to LCG internal (SEAL, POOL, PI, …) or external products package XercesC use LCG_Settings v* macro XercesC_native_version "2.3.0" macro XercesC_home "$(LCG_external)/XercesC/$(XercesC_native_version)/..." include_dirs $(XercesC_home)/include macro XercesC_linkopts "-L$(XercesC_home)/lib -lxerces-c -lpthread" \ WIN "/LIBPATH:$(XercesC_home)/lib xerces-c_2.lib" path_prepend LD_LIBRARY_PATH "$(XercesC_home)/lib" WIN32 "" path_prepend PATH "" WIN32 "$(XercesC_home)/bin" macro XercesC_export_paths " $(XercesC_home)/include $(XercesC_home)/lib" macro m1 “a public value” private macro m2 “a private value” use my_package end_private # back to public section Scoping sections A private section is not exported to the clients A public specification found in the graph overrides a private region of the dependency graph The cmt broadcast and cmt show uses reach the private sections by default The –public common option always hides the private regions The –private common option always reaches the private regions Scoping sections end: At the end of the requirements file With the end_private or end_public statements Ending statements return to the previous scope Policy packages: Provide policy statements for a software domain include dir strategy CMT strategies CMT patterns Generic symbols (macros, sets, …) Examples: AtlasPolicy is the main policy package, mandatory for all Atlas packages. ExternalPolicy, AtlasCxxPolicy, LCG_Policy">
/" ; \ path_append LD_LIBRARY_PATH "" Unix "${ROOT}/${CMTCONFIG}" ; \ path_remove PATH "" Win32 "//" ; \ path_append PATH "" Win32 "${ROOT}/${CMTCONFIG}" Configuration patterns Describe recurrent configuration operations or policies in a project or a software domain Enforce project policies Automate and parameterize complex operations Extend the CMT concepts Pattern application can be: Explicit (manual) using the apply_pattern keyword Application is on a package basis Automatic when patterns have the –global keyword Applied to all packages that see the pattern in the dependency graph Definition of a pattern A sequence of templated cmt statements Templates: Automatic: User defined: Examples: Defining the project-wide policy for include search path Defining automatic shared library access path Enforcing a systematic QA test application pattern -global include_path include_path ${_root}// pattern quality_test \ application test –s=../test test.cxx package Pa use ProjectPolicy quality_test other_sources=*.cxx In ProjectPolicy In package Pa Container and release packages: Purely managerial packages Not involved when using the software Only provide a CMT requirements file with a set of explicit use statements No wild cards Purpose: Specifies the set of exact version for a release of a software domain Drive the cmt broadcast commands over the complete software domain One top container can provide a release package Release. It describes the complete software release of the project Every new release of the project implies a new release of the Release container. Interface packages: Provide an interface between a software project managed by CMT and a so-called external product (i.e. not managed by CMT) Specify the native version value defined by the product (as opposed to the CMT version tag) Adapt the policies and conventions to the project’s ones Eg Include directory Construct the compiler and linker options for this product Set the runtime options (PATH, LD_LIBRARY_PATH, etc…) Specify the material to export when constructing a distribution kit Examples MySQL ROOT SEAL Geant4 Java kits The LCGCMT project is entirely made of such interface packages Connect to LCG internal (SEAL, POOL, PI, …) or external products package XercesC use LCG_Settings v* macro XercesC_native_version "2.3.0" macro XercesC_home "$(LCG_external)/XercesC/$(XercesC_native_version)/..." include_dirs $(XercesC_home)/include macro XercesC_linkopts "-L$(XercesC_home)/lib -lxerces-c -lpthread" \ WIN "/LIBPATH:$(XercesC_home)/lib xerces-c_2.lib" path_prepend LD_LIBRARY_PATH "$(XercesC_home)/lib" WIN32 "" path_prepend PATH "" WIN32 "$(XercesC_home)/bin" macro XercesC_export_paths " $(XercesC_home)/include $(XercesC_home)/lib" macro m1 “a public value” private macro m2 “a private value” use my_package end_private # back to public section Scoping sections A private section is not exported to the clients A public specification found in the graph overrides a private region of the dependency graph The cmt broadcast and cmt show uses reach the private sections by default The –public common option always hides the private regions The –private common option always reaches the private regions Scoping sections end: At the end of the requirements file With the end_private or end_public statements Ending statements return to the previous scope Policy packages: Provide policy statements for a software domain include dir strategy CMT strategies CMT patterns Generic symbols (macros, sets, …) Examples: AtlasPolicy is the main policy package, mandatory for all Atlas packages. ExternalPolicy, AtlasCxxPolicy, LCG_Policy">
Presentation on theme: "CMT Define the development work models"— Presentation transcript:
1 CMT http://www.cmtsite.org/ Define the development work models Christian ArnaultDefine the developmentwork modelsProject managementSplit the complete software base into natural sub-projectsBased on the release cycle constraintsTypical:Core softwareOffline/onlineSimulation/reconstruction/analysis/…Reflect the multi-project organizationEg. Atlas uses Gaudi which uses LCGCMTDecomposition based on the responsibilitiesEach individual project haveA specific release cycleEvery n-weekRandomA dedicated CMTPATH entryAn interface package to its used sub-projectsDefines the upstream CMTPATH itemsSelects the release id of all used sub-projectsDevelopment/Integration work modelsThe work area becomes the bottom projecti.e. it is the top left entry in $CMTPATHUsed packages override those from the selected production releaseStructure the software base with levels of integration areasStructuring the packagesA package belongs to a projectIt is located in the corresponding CMTPATH entryMay be located at the top position or below any directory treeA package has a unique namemust be unique in the complete software baseUnique amongst the different projectsA package has versionsImplicitly specified in the directory structureOr explicitly in the version.cmt text fileA package is recognized as a CMT package bya cmt directory below its directory structurea requirements file in the cmt directory/.../Project/cmt/project.cmt/A/cmt/requirements/cmt/version.cmt/B/v1/cmt/requirements/C/D/E/cmt/requirements/version.cmtThe project filePackage Awith explicitversion definitionPackage Bwith implicitPackage EIn a sub-directoryStructuring the projectsCMTPATH=/…/Project1 : /…/Project2 : /…/Project3Project1Project2Project3Projects are located in dedicated disk areasEach project has an entry in the CMTPATH search listFollows the standard platform dependent syntax‘:’ on Unix and ‘;’ on WindowsThe search list is prioritized like usual PATH search listsLeft (bottom) entries are considered firstRight (top) entries are considered lastPackages of a project may use packages of upstream projectsPackages belong to projectsthey are always installed in one of the CMTPATH entriesThis is where packages are looked forEach project may define its own strategiesIn /…/Project/cmt/project.cmtValid for all packages in this projectValid for all bottom packages if not overriddenproject P1package Buse Apackage Cuse Bpackage Dpackage Epackage Guse Euse Fproject P2package Aproject P3package FIntegration areadevelopment areaIdentify the elementsof the configurationProjectsProject names are defined in the project files<project>/cmt/project.cmtPackagesThe name is the primary identifier of packagesMust be uniqueConstituentsLibrariesApplicationsGenerated documentsActivitiesCode generationBuildOne make target per constituentActionsGeneric activityActivities can be grouped by type (testing, documentation, installation, deployment…)Contextual parameters values according toSitesPlatforms (hardware, OS, …)Step in the Life cycleUser defined conditionsSpecified in symbolsMacros, sets, paths, actionsVariants with tags or tag mixturesStructure the projectsStructure the packagesDefine the development work modelsDefine recurrent patternsin configuration managementIdentify the elements of the configurationQuery the knowledge base toparameterize the development toolsIdentify and describe the activitiesof the software productionDefine recurrent patternsin configuration managementBuild strategyE.g. Define whether the result of the build will go to a global installation areaSetup strategyE.g. Define what kind of automatic environment variables will be generated by CMTCompiling, linkingE.g. Construct DLL on different platformsGenerating code, documentationE.g. Building rootcint generatorComplec Doxygen generation with tag-file managementInclude file search styleE.g. Specifying the project-wide conventions for include search strategyTest patternsDriving CppUnitEnforcing the Unit testsManaging the integration testsQA activitiesQuery the knowledge base toparameterize the development toolsThe cmt commandA C++ applicationAvailable on any platform (Unixes, MacOSX, native Windows)All configuration parameters can be reached by query commandscmt show macroscmt show usescmt show macro xxx…The cmt broadcast commandUniquely sort the dependency graph (leaves first, root last)Make it an ordered list of packages reached from the current packageTraverse the ordered listApply an action to every nodeA normal shell commandMay stop at first error or continueMay select a subset of the graphMay exclude a subset of the graphThe cmt filter command transforms any text filesexpand all $(mmm) and ${mmm} patterns in the file using symbol valuesThe common options-quiet-tag_add=t1,t2-public-private> cmt broadcast gmake> cmt broadcast –select=/Graphics/ gmake testIdentify and describe the activitiesof the software productionVersioning activitiesGenerally handled through tools like CVS or SVNCMT provides a plugin to CVS to perform queries about CMT structureshelper command to perform conformant checkout operations: cmt coSVN is more flexible and can be taught to recognize CMT packagesThrough SVN propertiesBuild activitiesStandard compiling and linking is automatically handled from the definitions of constituentsSpecialized sequences of operations defined in CMT patternsTesting, QA assessmentDriven by external tools like JUnit, CppUnit, Qmtest, OVAL, … CodeWizard, RuleCheckerEnforced by automatic applications through CMT patternsDeploymentCMT query mechanisms to the knowledge base used to generate the manifest files of different packaging systems: Pacman, RPM, FinkSpecify adaptation scheme to configuration parameter values when installed on remote sites
2 Configuration patterns Container and release packages: CMTChristian ArnaultThe configuration tagsDescribe the contextual and operational conditions of the software configurationThe current sub-projectThe platform and operating systemThe siteThe compilerThe step in the life cycleThe user defined conditionsExamples:Debug or optimized modeSelection of a graphical environmentRunning some special firmwareThe version tags of CMT itselfVarious production modes:Some are automatically constructed by CMTBy discovery of the context (OS, compiler version)To reflect the project strategiesDuring the activitiesWhile building a constituentWhile running a user defined activity (through actions)Some are externally specified by the user through environment variablesCMTSITE: the current site nameCMTCONFIG: the binary tag nameTags can be specified on the cmt command lineUsing the –tag_add=<tag-list> common optionTags can be explicitly activated in requirements fileUsing the apply_tag <tag> statementSome are deduced from other tagsUsing the tag association statementActive tags are visualized using cmt show tagstag i686-rh73-gcc Linux redhat73 gcc-3.2 opttag i686-rh73-gcc32-opt Linux redhat73 gcc-3.2 opttag i686-rh73-gcc32-dbg Linux redhat73 gcc-3.2 debugtag i686-rh73-gcc32-pro Linux redhat73 gcc-3.2 opt profiledtag redhat73&gcc redhat73-gcc32tag OSF1 Unixtag Linux Unixtag HP-UX Unixtag Darwin UnixThe dependency graphDescribe the primary relationship between packagesThree identification elementsThe nameThe version requestThe directory offset in the projectThe dependences form a Direct Acyclic GraphClients packages use used packagesPackages may be reached by several pathsCMT supports cycles in the graphCycles introduce non deterministic traversal pathsA package exports its public features to its clientsAll requirements files of all (visibly) used packages are concatenated to form the complete configurationConstituents are always privateAutomatic (global) patterns are applied to all visible packagesUse statements installed in private sections define a hidden region of the dependency graph when observed from the client perspectiveThe symbolic parametersGenerically define a configuration parameterMay receive different values under different conditionsAccording to tag expressionsIs exported to client packages (if installed in a public section)Can be modified/overridden by client packagesModifications installed in a private section are not propagated to clients.Several possible semantics share the same syntaxmacro generic internal CMT variableand make’s macro definitionset environment variable definitionalias alias definition of the shellpath PATH-like environment variableaction shell commandAnd associated modifiers<kind>_append<kind>_prepend<kind>_remove<kind>_remove_all<kind>_remove_regexp<kind>_remove_all_regexpmacro m “default value” \Unix “on any Unix” \rh “only on this machine” \Win32&debug “for Windows and debug”macro m “je réutilise $(m1)” \Linux “but on any Linux”path_remove PATH “/A/bin”path_prepend PATH “” \CERN “/afs/cern.ch/sw/lcg/A/bin” \LAL “/lal/A/bin”action directory “ls $(dir_options)” \Win “dir $(dir_options)”cmt do directoryDependency graphConfiguration tagsConstituentsSymbolic parametersConfiguration patternsPackage semanticsActionsScoping sectionsThe constituentsDescribe constituents to be constructed from sourcesApplications executableLibraries static, shared, dynamically loadableDocuments anything elseApplications and libraries obey a predefined strategySources are always explicitly specifiedDefault source location is ../srcBut can be explicitly specifiedAbsolute locationOr relatively to ../src/Sources are transformed by a language compilerSupport for new languages is described by usersThe language statementAutomatic detection of languages from file suffixesDocuments construction method can be freely designedMake fragmentspackage doc_providermake_fragment doc_headermake_fragment doc_trailermake_fragment doc \–header=doc_header \–trailer=doc_trailer../cmt/fragments//doc_header/doc/doc_trailerProvider packageusedoc_headerdoc (a.txt)doc (b.txt)doc (c.txt)doc_trailerpackage doc_clientdocument doc mydoc a.txt b.txt c.txtClient packagemydoc.makepattern ld_library_path \path_remove LD_LIBRARY_PATH "" Unix "/<package>/" ; \path_append LD_LIBRARY_PATH "" Unix "${<PACKAGE>ROOT}/${CMTCONFIG}" ; \path_remove PATH "" Win32 "/<package>/" ; \path_append PATH "" Win32 "${<PACKAGE>ROOT}/${CMTCONFIG}"Configuration patternsDescribe recurrent configuration operations or policies in a project or a software domainEnforce project policiesAutomate and parameterize complex operationsExtend the CMT conceptsPattern application can be:Explicit (manual) using the apply_pattern keywordApplication is on a package basisAutomatic when patterns have the –global keywordApplied to all packages that see the pattern in the dependency graphDefinition of a patternA sequence of templated cmt statementsTemplates:Automatic: <package> <PACKAGE> <version><path> <project>User defined: <xxx>Examples:Defining the project-wide policy for include search pathDefining automatic shared library access pathEnforcing a systematic QA test applicationpattern -global include_path include_path ${<package>_root}/<package>/pattern quality_test \application <package>test –s=../test <package>test.cxx <other_sources>package Pause ProjectPolicyquality_test other_sources=*.cxxIn ProjectPolicyIn package PaContainer and release packages:Purely managerial packagesNot involved when using the softwareOnly provide a CMT requirements file with a set of explicit use statementsNo wild cardsPurpose:Specifies the set of exact version for a release of a software domainDrive the cmt broadcast commands over the complete software domainOne top container can provide a release package <project>Release.It describes the complete software release of the projectEvery new release of the project implies a new release of the <project>Release container.Interface packages:Provide an interface between a software project managed by CMT and a so-called external product (i.e. not managed by CMT)Specify the native version value defined by the product (as opposed to the CMT version tag)Adapt the policies and conventions to the project’s onesEg Include directoryConstruct the compiler and linker options for this productSet the runtime options (PATH, LD_LIBRARY_PATH, etc…)Specify the material to export when constructing a distribution kitExamplesMySQLROOTSEALGeant4Java kitsThe LCGCMT project is entirely made of such interface packagesConnect to LCG internal (SEAL, POOL, PI, …) or external productspackage XercesCuse LCG_Settings v*macro XercesC_native_version "2.3.0"macro XercesC_home "$(LCG_external)/XercesC/$(XercesC_native_version)/..."include_dirs $(XercesC_home)/includemacro XercesC_linkopts "-L$(XercesC_home)/lib -lxerces-c -lpthread" \WIN "/LIBPATH:$(XercesC_home)/lib xerces-c_2.lib"path_prepend LD_LIBRARY_PATH "$(XercesC_home)/lib" WIN32 ""path_prepend PATH "" WIN32 "$(XercesC_home)/bin"macro XercesC_export_paths " $(XercesC_home)/include $(XercesC_home)/lib"macro m1 “a public value”privatemacro m2 “a private value”use my_packageend_private# back to public sectionScoping sectionsA private section is not exported to the clientsA public specification found in the graph overrides a private region of the dependency graphThe cmt broadcast and cmt show uses reach the private sections by defaultThe –public common option always hides the private regionsThe –private common option always reaches the private regionsScoping sections end:At the end of the requirements fileWith the end_private or end_public statementsEnding statements return to the previous scopePolicy packages:Provide policy statements for a software domaininclude dir strategyCMT strategiesCMT patternsGeneric symbols (macros, sets, …)Examples:AtlasPolicy is the main policy package, mandatory for all Atlas packages.ExternalPolicy, AtlasCxxPolicy, LCG_Policy
To make this website work, we log user data and share it with processors. To use this website, you must agree to our Privacy Policy, including cookie policy.