{section: Introduction } This wiki page contains information regarding build modernization and consolidation. {section: Goals and Objectives } The goal of updating the condor build mechanism is far more reaching then using the latest wiz-bang tool to build code, and is meant to address the following issues: *: _Build consistency across platforms (Including Windows):_ Currently Imake does a good job for build consistency across *nix variants, however there is an entirely different set of mechanics for dealing with builds on Windows, which few people really understand. To make matters a bit more confusing, is that the mechanism by which we build & test on Windows is quite non-standard which presents an issue as condor becomes a more open source project. This plurality causes several issues in maintaining two desperate build files, with completely different mechanisms. It would be in the best interests for the group in the long run to employ a single build mechanism which has support on all condor platforms. *: _Support for unit testing within the build:_ For the purposes of testing it is advantageous to have a build tool which supports running automated unit tests as part of a "unit" build, with a minimal amount of external overhead. *: _Packaging:_ Many build systems provide automated packaging for it's native environment. This can be highly useful as it eliminates and automates custom build steps and scripts and makes it easier to maintain. Having this requirement can reduce the overhead on condor developers and allow them to focus on bug fixes and new features. It also allows flight worthy to get out of the packaging business and simplifies the consumption for downstream folks. {section: Possible Options } If we use the afore mentioned goals as hard requirements, then it eliminates a lot of possible choices, and only a couple remain: *: _SCons:_ SCons is a fairly powerful tool build atop of a python, which allows you to pretty much do anything. The only major disadvantage is the issue of packaging, and size of adoption within the open source community. There are also issues when dealing with exiting auto-tools style builds. *: _bjam:_ Created as a replacement/extension to perforce JAM it has it's own syntax and supports numerous platforms, it also does not provide flexible packaging features, and lacks the transition glue to move from an auto-tools style build. *: *CMake - winner:* CMake is widely adopted in the open source community as a x-platform replacement for auto-tools style builds. It has it's own Macro-style syntax, but unlike the afore mentioned tools it is a generator similar to Imake and it works with existing tools (make, visual studio). Another powerful tool in the "CMake warchest" is CPack, which allows for various methods of packaging, across multiple OS distributions. {section: Plan and phases} *[Completed] Stage 1: Feasibility* 9/25/09 Estimated: ~1 Month - likely less Time Elapsed: ~1.2 Months X - Setup existing environment build and analyze. X - Create full configuration (auhtmlonf-cmake) X - Build for linux and Windows X - Simplify build files (done through cmake macros and updated file extensions .unix .linux .window) X - Develop plan for dealing with externals - Currently the plan is to stage uw-externals prior to building and update include and link paths to this loc by default. (everything is external) - This greatly simplifies the build process and cleans up the questions of who does "what" "when" X - Build all code with c++ compiler cleanup non-ansi C-code X - Analyze packaging options CPack will likely meet our needs and eliminate separate steps X - Eliminate unnecessary linkage where possible. tools ... daemons procd ... libs ccb cedar classad_analysis classad.old daemon_client daemon_core privsep procapi sysapi tt utils tests include scripts examples ... Analysis: I was surprised at the levels of "over complexity" within the builds and code dependencies. So in my work going forwards, my primary goal is to simplify. I believe that a cleaner structure would help for future open source progress. IMHO it should easy for a developer / researcher to obtain the source, build, and install a package. Also the directory structure should be easily to follow and navigate. ----- *[In Progress as of 11/14/09] Stage 2: Evaluation, Adoption, & Continuation* Estimated: ~1 - ? Months Time Elapsed: 1 week X Cleanup and cruft and provide tracking branch for UW. (origin/CMAKE) X Setup an wiki page - Have an evaluation with UW and RedHat folks - Try to gain critical feedback. - Continued conversion, and merge out regularly *Develop a test plan methodology (RH & UW) - Establish auto-builds (either through NMI or hudson) ----- *Stage 3: Full Parallel Build, Test, and Packaging (Last Month)* - Full build and test should be able to run from parallel branch. (Propose switch over.) - Establish full unit testing examples along-side, you pretty much get this for free (CTest + boost::test) - Establish packaging using CPack for *all platforms. - Windows may have multiple forms of distribution according to GregT (.zip .exe .msi ...) - Do we "need" to support .msi? why? ------ *Stage 4: Proper cleanup (optional/on-going task)* - start to move the code so #ifdef's are isolated to a bottom layer. The code should never have #ifdef's above a certain point as it simply should not care. This eliminates deps, and allows for easier code refactoring. {section: Getting Started } 1.) You will need to obtain CMake 2.6 or > for the target platform you are working on. 2.) Checkout origin/CMAKE 3.) Because the build expects that you have certain pre-reqs installed and defaults to a clipped build (atm). You will likely need to install the default set of clipped && proper libraries. 4.) Navigate to CONDOR_SRC/src/new_build 5.) cmake ./CMakeLists.txt 6.) make || open the visual studio project. {section: Contributing} All of the updated cmake files exist under src/new_build and are open to contribution. The current branch tracks against master(7.5 series) and all files under new_build are a series of softlinks against the originals to allow for easy merge-outs, and to allow for parallel builds in case it is needed. There are a substantial number of changes and cruft removal in this branch so there may need to be a bit of work to get the old build to function in this new branch, as I have not made it a priority atm. *Conventions* *: #include /header.h (no more relative includes) *: Compiles fully in C++ *: Proper use of extern *: Minimal linkage, explicitly specify *: Platform specific files are suffixed as to allow glob macros to add to target (.windows, .unix) {section: Packaging} CMake's compliment, CPack, supports a large number of packaging types which can be found {link: http://www.cmake.org/Wiki/CMake:CPackPackageGenerators here}, and it is currently in its infancy in the code base. There are two targets which are created when you include(CPack): {code} make package make package_source {endcode} The road ahead is to create a stub'd out CPackOption.cmake.in file and use cmakes configure options to fill in the gaps based on the target platform and environment, thereby reducing the cruft in the master CMakeLists.txt and providing the wiz-bang feature of platform specific package generation. {section: TODO} *: setup so all gen files & compilation files go to a single location for easy removal (similar to bjam) single checkout, w/multiple build products. *: Setup packaging configuration. {section: Links} {link: http://www.cmake.org/cmake/help/documentation.html CMake Official Documentation} {link: http://www.google.com/codesearch Google Code Search for open source examples}