{section: Introduction } This wiki page contains information regarding build modernization and consolidation using CMake. {section: Modifications} *: Compiles fully in C++, except std:u *: Proper use of externs *: Minimal linkage, explicitly specify *: Platform specific files are suffixed as to allow glob macros to add to target (.windows, .unix) *: Easy expansion with macros and functions, condor specific macros are located under build/cmake *: Removal of object copying *: Full Windows and WiX support *: std:u isolation allowing full -02 -g on condor *: addition clean,tests,& install targets *: support for grid:u on proper builds {section: Getting Started } 1.) For NON-PROPER builds, which includes windows, you will need to obtain CMake 2.8.3 or > for the target platform you are working on. On CSL machines, it is installed in /unsup/cmake. http://www.cmake.org/cmake/resources/software.html For PROPER *nix builds you will need cmake 2.8 or >. 2.) Checkout origin/master 3.) navigate to CONDOR_SRC 4.) UW Folks can type *./configure_uw* , while others should use *cmake .*, on windows run *cmake-gui* *NOTE(s):* *: If you are wanting to build directly on an NMI machine: run nmi_tools/glue/SubmitInfo.pm to find the platform-specific args (Configure Args) to pass to cmake. *: To see build options run either ccmake, cmake-gui, or cmake -i *: *configure_uw* sets the following variables: *:: -DUW_BUILD:BOOL=TRUE (Tries to build std:u && non-proper) *:: -D_DEBUG:BOOL=TRUE (Build debug executables for development & testing) *:: -DBUILDID:STRING=UW_development (Daemon Output will indicate development exe) *:: -DCMAKE_INSTALL_PREFIX:PATH=${PWD}/release_dir (localized install location) *: *For out of source builds* simply make a directory above CONDOR_SRC e.g. 7.5.5 and cd into it, then type: *:: *UW:* ../CONDOR_SRC/configure_uw ../CONDOR_SRC *:: *Everyone else:* cmake ../CONDOR_SRC *::: *Development Recommendation:* alias cmake='cmake -DCMAKE_INSTALL_PREFIX:PATH=${PWD}/release_dir -D_DEBUG:BOOL=TRUE -DBUILDID:STRING=YOUR_USERNAME_local' 5.) Now you can run make or open the visual studio solution file. *Windows: (2008 instructions)* Prior to building for the 1st time there are some prerequisites that you will need to configure 6.) Install perl if not already on your machine *:http://www.activestate.com/activeperl/downloads 8.) Install the .NET 2.0 redistributable (May not be necessary if already installed. May be installed by default on Vista and later?) *:https://www.microsoft.com/downloads/en/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en 7.) Install the lastest platform SDK and reopen the solution *:http://msdn.microsoft.com/en-us/windows/bb980924 8.) Download and install WiX 3.0 on your windows machine *:http://wix.codeplex.com/ 9.) Download and install 7-zip (you will need to add it to your PATH) *:http://www.7-zip.org/download.html 10.) Patch your version of cmake/cpack to enable wix support by dropping the following into your cmake path. You may want to verify with a diff tool such as beyond compare when updating. *NOTE:* This patch is making it's way upstream, hopefully in the next point release. *:https://docs.google.com/leaf?id=0Bzq0eFfVveNqZTgxNjQyZmItNmEyNy00MWZlLTg2NTktMzJiYjljMDc3NTQ0&sort=name&layout=list&num=50 11.) Open Tools->Options under "Projects and Solutions" click on VC++ Directories and add the following to the *Executable* directories *:$(SolutionDir)\msconfig *:Move $(PATH) to the bottom as sometimes C:\cygwin\bin is in the $(PATH) which can cause issues with condor's bundled binaries. 12.) Open and build. {section: Installing} There is now officially an install target and release has been removed. {code} cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/condor/x.y.z ... make install {endcode} {section: Testing} The code has been restructured so *all* things test related are bundled under a single target, and all binaries relating to that target set their output to condor_tests. {code} make tests {endcode} Once built you can run all the batch tests as before. {section: Packaging} Packaging target have already been added simply run: {code} make package {endcode} {section: TODO} see Ticket #779 #1248 #1676 #1783 #1819 {section: Windows Gotchas} {subsection: SDK corruption of VC setup} Installation of the new Microsoft SDK (6.1 aka Server 2008) can leave an existing VC 9.0 installation with a corrupted setup bat file. After installing the SDK, check the contents of =C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat= {linebreak}If you see the lines: {code} @SET FrameworkDir=Framework32 @SET FrameworkVersion=v2.0.50727 {endcode} change them to: {code} @SET FrameworkDir=C:\Windows\Microsoft.NET\Framework @SET FrameworkVersion=v2.0.50727 @SET Framework35Version=v3.5 {endcode} Also, a portion of the PATH variable may have an incorrect entry which can lead to problems in the CMD interpreter. If in the same file you see a PATH entry like: {code} %FrameworkDir%\%Framework35Version%\Microsoft .NET Framework 3.5 (Pre-Release Version); {endcode} change it to point to the correct version like: {code} %FrameworkDir%\%Framework35Version%\Microsoft .NET Framework 3.5 SP1; {endcode} {subsection: Environment variable expansion} The new =SetEnv.cmd= shipped in the 6.1 SDK requires that both command extensions and environment variable expansion be turned on. Either use the "CMD Shell" shortcut installed with the Windows SDK or ensure that CMD is launch with the /V:ON and /E:ON parameters. For example: {code} CMD \V:ON \E:ON {endcode} {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}