90 likes | 116 Views
Adoption of CMake as a build system. G.Cosmo , PH-SFT. Motivations in Geant4. Current Metaconfig based Configure script becoming increasingly problematic No upstream support for this tool No comprehensive way for system checks Fragile system controlled through environment variables
E N D
Adoption of CMake as a build system G.Cosmo, PH-SFT
Motivations in Geant4 • Current Metaconfig based Configure script becoming increasingly problematic • No upstream support for this tool • No comprehensive way for system checks • Fragile system controlled through environment variables • Facilitate integration with client software and management of external dependencies • Requirements to produce binary packages and provide integration with development tools SFT Program of Work Residential Meeting, La Mainaz
Status of evaluation in Geant4 • Three tools selected for evaluation (by Ben Morgan, Warwick University, UK) • GNU Autotools (http://www.gnu.org/software/autoconf/) • Scons (http://www.scons.org/) • Cmake (http://www.cmake.org/) • Several criteria adopted • Must work and be supported upstream on all supported platforms • Must allowthe softwareto be built with all current features • Must have an easy to use interface for users and developers • Must be easy to use and maintain by the build system developer • Should have a minimal set of tools to install, ideally one • Should integrate with binary packaging systems with minimal effort • If no major showstoppers, plan to have a fully featured working system this year with CMake! SFT Program of Work Residential Meeting, La Mainaz
CMake pros & cons • Has existed since “CMake language”, underlying system in C++. • Advantages: • Cross-platform support “out the box” and designed to be so • “Buildscript generator” • output GNU Makefiles, Eclipse, Kdevelop, Visual Studio, XCode projects! • Many “out the box” system checks (X11, Qt, etc) • new checks via simple “recipe” • Stores build configuration in a cache file – no environment variables • Disadvantages: • Requires CMake, plus at least one tool to run build-scripts. • Limited documentation – offset by very active user/developer community • Need to learn CMake scripting language (though very intuitive) • Built Geant4 CMake prototype – it is by far the easiest to develop and use SFT Program of Work Residential Meeting, La Mainaz
CMake, more features … • Very clean and friendly user interfaces: • Command line; Ncurses; Metaconfig-like question & answer; GUI (Windows) • Each library is a target in the build tool – just build the ones you want • Dependencies among libraries are automatically included (also external dependencies) • Work cycle very similar to Metaconfig/Make, so familiar (config/build) • Each module/library MUST provide a sources.cmake file • Lists all sources, headers and dependencies of the module • Binary packaging • CMake is part of a suite of tools, which can be integrated • CPack for source/binary packaging; CTest for unit testing • CPack can create: • UNIX - rpm, deb; OSX - Bundles, PackageMaker; Windows: NSIS, Cygwin source/binary SFT Program of Work Residential Meeting, La Mainaz
Conclusions • Work in progress in Geant4 for migrating the build system to CMake • Evaluation and prototype (based on release 9.2) made by B.Morgan (University of Warwick, UK) • Plan to have in place a fully featured system within the current year • CMake could be also used as the tool for handling LCG software builds SFT Program of Work Residential Meeting, La Mainaz
A test case: CMake in GAUDI • Took two days for Pere to setup GAUDI with CMake • Excluding setting up of the run-time environment which is part of CMT • Some numbers… [cmt] <default> | -j 5 full build 12:12 | 6:24 noop 0:30 | 0:22 single.cpp 0:40 | 0:32 [cmake] <default> | -j 5 full build 11:19 | 3:05 noop 0:08 | 0:06 single.cpp 0:21 | 0:15 SFT Program of Work Residential Meeting, La Mainaz