wiki:PlatformSpecificSetup

TOC(PrerequisitesForCompiling,PlatformSpecificSetup,CMakeFAQ)?

Platform-Specific Setup

Notes on installing tools and libraries needed to compile DAKOTA on various platforms. For CMake install hints, see CMakeFAQ

Linux (RHEL 6.1)

These are available from the Redhat package manager (i.e. using yum):

  • We compile with the stock gcc-4.4.x
  • Install linear algebra RPMs: blas blas-devel lapack lapack-devel
    Known issues with systems providing, e.g., libblas.so.3. For now a workaround is to symlink libblas.so → libblas.so.3 and similar for the lapack library.
  • Optionally install OpenMPI (1.5.x) MPI RPMs: openmpi openmpi-devel
  • Optionally install graphics RPMs: openmotif openmotif-devel (or lesstif lesstif-devel) libX11 libXau libXext libXmu libXmu-devel libXp libXp-devel libXpm libXpm-devel

The following must be built from source (The versions of CMake and Boost that are available in the yum repositories will NOT work):

  • CMake 2.8.9.
  • Boost 1.49, including lib components: system, signals, regex, program_options and filesystem

NOTE: Newer versions of CMake and Boost are available and may work, but we have the greatest confidence in the compatibility of these versions.

Linux (Ubuntu 12.04)

  • Install required dependencies (gcc-4.6.3 toolchain works with Dakota stable newer than 5.2, for Dakota 5.2 see patch at #4167)
    sudo apt-get install g++ gfortran 
    sudo apt-get install liblapack-dev libblas-dev
    

The following must be built from source (The versions of CMake and Boost that are available in the yum repositories will NOT work):

  • CMake 2.8.9.
  • Boost 1.49, including lib components: system, signals, regex, program_options and filesystem

NOTE: Newer versions of CMake and Boost are available and may work, but we have the greatest confidence in the compatibility of these versions.

  • Optionally install OpenMPI:
    sudo apt-get install libopenmpi-dev openmpi-bin openmpi-doc
    
  • Optionally install graphics dependencies:
    sudo apt-get install xorg-dev libmotif-dev
    
  • Optionally install Python development dependencies (if using direct Python interface): python-dev, and python-numpy if you'd like a NumPy? interface.
  • To build with MPI: cmake -DDAKOTA_HAVE_MPI:BOOL=TRUE -DMPI_CXX_COMPILER:FILEPATH=/usr/bin/mpicxx

Mac OS X Mountain Lion 10.8.5

  1. Install CMake binaries, e.g.,  http://www.cmake.org/files/v2.8/cmake-2.8.9-Darwin64-universal.dmg
  2. Install a compiler toolchain with Fortran90 support. You may use binaries for whole suite from  http://hpc.sourceforge.net/.
  3. Make sure new compilers are on head of PATH, e.g., export PATH=/usr/local/bin:$PATH
  4. Acquire and install Boost: See notes at wiki:PrerequisitesForCompiling#NotesonBoost
  5. MPI (optional): Recommend build openmpi from source if desired.
  6. To build dakota:
    1. Save the following fragment in a new file, BuildDakota.cmake.
      ##############################################################################
      # Set CMake compilers to compiler suite installed in step above
      ##############################################################################
      set(CMAKE_C_COMPILER /usr/local/bin/gcc CACHE FILEPATH "Local gcc")
      set(CMAKE_CXX_COMPILER /usr/local/bin/g++ CACHE FILEPATH "Local g++")
      set(CMAKE_Fortran_COMPILER /usr/local/bin/gfortran CACHE FILEPATH "Local gfortran")
      
      ##############################################################################
      # Boost base directory
      ##############################################################################
      set(Boost_INCLUDE_DIR
        "/path/to/Boost/include/directory"
        CACHE PATH "Always use pre-installed Boost" FORCE)
      
      ##############################################################################
      # Enforce shared library build for DAKOTA and all of its TPLs
      ##############################################################################
      set(BUILD_STATIC_LIBS OFF CACHE BOOL "Set to ON to build static libraries" FORCE)
      set(BUILD_SHARED_LIBS ON CACHE BOOL "Set to ON to build DSO libraries" FORCE)
      
      
    2. In a terminal window, execute the following instructions. We assume Dakota source is installed in $DAKOTA_SRC=/path/to/Dakota/trunk.
      cd $DAKOTA_SRC
      mkdir build
      cd build
      cmake -C /path/to/BuildDakota.cmake $DAKOTA_SRC
      make -j 8
      export DYLD_LIBRARY_PATH=/path/to/Boost-1.49/lib:$DYLD_LIBRARY_PATH
      
    3. Check Dakota binary:
      cd test
      ./dakota -v
      

Cygwin

To run DAKOTA on Windows, you need not install MSys or Cygwin. To compile from source, you need Cygwin.

  • Install Cygwin 1.7 (last tested with DLL version 1.7.29), including these packages, which must be searched for and specifically selected:
    • Devel (build tools): cmake-2.8.9+, make
    • Devel (gcc-4.8.2 last tested, gcc-4.3.x has also worked): gcc4-core, gcc4-g++, gcc4-gfortran
    • Libs (Boost 1.53 last tested): libboost-devel, libboost1.49
    • Math: liblapack, liblapack-devel, liblapack0
    • Perl 5.x (otherwise disable export makefiles for Teuchos): perl
    • Python 2.x (otherwise HAVE_ACRO:BOOL=OFF): python
    • X11 (if graphics support desired): libX11-devel, libXau-devel, libXaw-devel, libXext-devel, libXm-devel, libXmu-devel, libXpm-devel, libXt-devel, libICE-devel, libSM-devel
  • For continuous integration hosts, we also include subversion-1.6.17
  • Run cmake -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_STATIC_LIBS:BOOL=ON /path/to/source
  • Possible bugs and workarounds:

I opted for applying to only a new mount and then doing the build in that mount; /etc/fstab:

C:/dakota /dakota ntfs binary,noacl,posix=0,user 0 0

Microsoft Visual Studio

  • Install Microsoft Visual Studio 9 (2008) (standard version or better for Intel Fortran support)
  • Install Intel Visual Fortran 11.1 to work with MSVS (we hope to support gfortran, but can't currently)
  • Install CMake (recommend 2.8.9 or newer for support of newer Intel Visual Fortran)
  • Compile LAPACK from source:
    • Get  http://www.netlib.org/lapack/lapack-3.4.1.tgz LAPACK 3.4.1 or newer source, unpack, make a build directory
    • Configure LAPACK with CMake using the appropriate MSVS 9 IDE generator. Make sure this is the same compiler that you are going to use for DAKOTA.
    • Open the VisualStudio solution file and build the project
  • Install Boost: Download a boost source distribution, extract it, compile with MSVS, and install it using bjam, for example:
    cd boost_1_49_0
    bootstrap
    .\bjam --prefix=C:\software\boost\1.49 install
    
    • You may need to then go into the install directory and move the include directory up one level
  • Seed the CMake cache with the following:
    LAPACK_DIR:FILEPATH=C:/full/path/to/lapack-3.4.1/build
    BUILD_SHARED_LIBS:BOOL=OFF
    
  • Boost: Set Boost_INCLUDE_DIR=C:\software\boost\1.49\include, for example.
  • Have CMake generate for Visual Studio 9 (2008)
  • Open the Dakota.sln file in MSVS, set the build configuration to release and build all.

MSVS Extras

  • (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.

  • (OPTIONAL) Help us improve Windows Visual Studio support by providing feedback
  • Request to be added to relevant Trac tickets, e.g. ticket:4120, ticket:4182, ticket:4250
  • (OPTIONAL) Going the extra-mile, especially SNL developers compiling on Windows, POST build artifacts to CDashboard

 https://cdash.sandia.gov/cdash/index.php?project=Dakota (email wjbohnh@… for inquiries/details about the EXPERIMENTAL use of cmake/ctest/cdash on Windows)

  • (UNSUPPORTED) MS Visual Studio 2005

Those wishing to use an old, unsupported compiler will want to read helpful tips in Trac ticket #4120

(In particular, note the "custom" techniques for the execution of some build commands needing Admin privilege.)

Attachments

  • make.exe Download (1.5 MB) - added by briadam 5 years ago. Make for Cygwin built on Win7