Example: Building on Windows

Summary to compile Dakota on Windows:

  • Unzip the Dakota source distribution
  • Run the CMake GUI, and specify the location of the Dakota source directory, and a build directory distinct from the source directory
  • Use the GUI to specify Dakota CMake options and locations of external tools and libraries as needed
    • Typically point to an in-place build tree for LAPACK: LAPACK_DIR:FILEPATH=C:/full/path/to/lapack-3.4.1/build
    • Specify BUILD_SHARED_LIBS:BOOL=FALSE (Dakota doesn't currently support DLL builds)
    • Set BOOST_ROOT=C:\software\boost\1.49\, for example.
  • Select Configure, then Generate.
  • Open Dakota.sln in Visual Studio; use configuration manager to set the build type (Release, RelWithDebInfo, or Debug)
  • Build the whole solution,
  • From a Command Prompt
    • Change directory (cd) to the build directory/src and run dakota -version
    • cd ..\test and run ctest -L Accept
  • Optionally build the INSTALL target


(ALTERNATE) Building in a Command Prompt window using CTest script:

  • Setup environment: set %path% to ctest.exe and ifort.exe, then "source" the ifortvars.bat file
    @echo off
    REM Assume the dakota source tree is checked-out or unzipped into %CD%\source
    mkdir build
    call ifortvars ia32
    set WORKSPACE=<your_cwd>
    set NODE_NAME=<your_build_hostname>
    REM echo "Build host is %NODE_NAME%"
    ctest -VV -S <path_to>/Build_msvc_ifort.cmake
  • Example "Build_msvc_ifort.cmake" file for running ctest in script-mode (which includes a typical spec for the CMake cache initialization): https://software.sandia.gov/trac/dakota/browser/core/trunk/examples/platforms/CtestMSVC_Kitware.cmake. In addition to "seeding" the cache, the script performs a complete configure/build/(optionally)test.