{section: Overview} The instructions on building Condor in releases prior to 7.5.5, see {wiki: BuildingCondorPriorToCmakeOnWindows Building Condor prior to 7.5.5}. For information about the conversion of the build process from project files to cmake see {wiki: BuildModernization} {section: Prerequisites } In order to build Condor on Windows, the following prerequisites are required. They need to be in the PATH before you can build. There is a batch file =msconfig\set_build_env.bat= in the condor sources that will locate the installed prerequisites and set the PATH for you if you don't wish to add them to your global PATH. 1: Cmake 2.8.3 or later, the =Cmake\bin= directory should be added your PATH. *::http://www.cmake.org/cmake/resources/software.html 2: Install Visual Studio. Add it to your PATH. *::Visual Studio Express (Free to anyone) https://www.microsoft.com/express/Downloads/ *::Visual Studio 2008. Paid. *::: UW Madison staff can use MSDNAA: http://msdn04.e-academy.com/wiscmad_cs ; contact the CSL lab for an account if you don't have one. You'll get a .img file of the DVD. You can use 7-zip to extract the contents and install from there instead of burning a DVD or installing DVD emulation software. 3: [Optional] Start Visual Studio and Open Tools->Options under "Projects and Solutions" click on VC++ Directories and add the following to the *Executable* directories. This is not needed if you use =msconfig\set_build_env.bat= to set the PATH before you build. *::$(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. 3: Install Active Perl. Add it to your PATH. *::http://www.activestate.com/activeperl/downloads 4: Install the .NET 2.0 redistributable (Should only be necessary on Windows XP and earlier) *::https://www.microsoft.com/downloads/en/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en 5: Install the Windows Platform SDK. (may depend on .NET 2.0). Any version of the Platform SDK should be fine. SDK 6.1 and 7.0 are both known to work. *::http://msdn.microsoft.com/en-us/windows/bb980924 1: [Optional but Recommended] Install 7-zip. Add it to your PATH. 7-zip is not needed to build, but it is needed to make the condor .ZIP file. You will not be able to build the PACKAGE target witout 7-zip. *::http://www.7-zip.org/download.html 1: [Optional] install git and add it to your PATH, git is one way to get the Condor sources. It is not needed if you already have the sources. *::http://git-scm.com/download 6: [Optional] Install WiX 3.0 on your windows machine (Depends on Visual Studio). WiX is not needed to build, but it is needed to create the MSI installer. *::http://wix.codeplex.com/ {section: Building Condor with cmake on Windows} 1.) Open a windows commmand prompt 2.) Checkout origin/master from the git repository, or download the Condor Sources http://www.cs.wisc.edu/condor/downloads-v2/download.pl 3.) navigate to CONDOR_SRC 4.) add cmake\bin to your PATH if it is not already. One way to do this is to execute =CONDOR_SRC\msconfig\set_build_env.bat=. This will setup PATH, LIB, and INCLUDE environment variables to build Condor. If this batch file cannot find cmake.exe It will report an error. 5.) [Optional] set the environment variable =CONDOR_BLD_EXTERNAL_STAGE= to the path of the externals cache to use cached externals. Using cached externals can save a lot of time if you plan to build condor repeatedly. {code} set CONDOR_BLD_EXTERNAL_STAGE=c:\scratch\condor_externals {endcode} 6.) The cmake files support both in-source and out-of-source builds. For in-source builds execute {code} cmake -G "Visual Studio 9 2008" . {endcode} for out-of-source builds, navigate to the build destination folder and execute cmake; passing it the path to the condor sources. {code} set _condor_sources=%CD% md c:\scratch\condor\build_dest cd /d c:\scratch\condor\build_dest cmake CMakeLists.txt -G "Visual Studio 9 2008" %_condor_sources% {endcode} running cmake will create Visual Studio project and solution files. Many options can be passed to cmake, see CondorCmakeBuildOptions for more information. or use the cmake-gui. 6.) execute {code} devenv condor.sln /Rebuild RelWithDebInfo /project ALL_BUILD {endcode} or {code} msbuild condor.sln {endcode} or {code} start condor.sln {endcode} This last command will open the condor.sln file in Visual Studio. You can then build interactively. {section: Installing} There is a cmake file that will copy the build products to a destination, this can be used to overwrite an existing Condor install. On a clean system that does not already have Condor installer, you must use the MSI installer to install Condor. {code} cmake -DCMAKE_INSTALL_PREFIX:PATH=c:\condor -P cmake_install.cmake {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. Build the *tests* target in the Condor.sln Solution File. Once built you can run all the batch tests as before. {section: Packaging} Execute the do_wix.bat file in etc\WiX {section: 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}