External Libraries

Identifying/Configuring Third-Party Libraries

MPI for Dakota newer than 6.1

Dakota uses the native CMake MPI probe to find and configure MPI. The minimum for compiling Dakota with MPI is to make sure appropriate MPI binaries and libraries are on necessary PATHs and setting DAKOTA_HAVE_MPI:BOOL=TRUE

The recommended practice is to also specify a C++ compiler wrapper (and all specific compilers as discussed above to avoid mixed toolchains):


By default, the MPI compiler wrapper will be used by CMake to find MPI, but not actually used for compilation. Rather the detected defines, includes, and libraries will be added to relevant MPI-enabled targets in the build.

If a compiler wrapper isn't available, or specific MPI includes and libraries are needed, specify appropriate values for MPI_CXX_LIBRARIES and MPI_CXX_INCLUDE_PATH. This will circumvent any autodetection. If you want to force Dakota to use the MPI wrappers and NOT apply the detected libraries and headers, set


MPI for Dakota 6.1 and older

(Historical guidance on MPI settings.) The recommended practice for building with MPI is to set options similar to


However, several alternatives to setting the CXX compiler are possible, including:

  • set MPI_CXX_COMPILER in CMake cache to a specific MPI C++ wrapper (Trilinos)
  • set PATH in environment to include MPI C++ wrapper
  • set MPI_LIBRARY and MPI_INCLUDE_PATH in CMake cache
  • set MPI_BASE_DIR in CMake cache (Trilinos)
  • set MPIHOME in environment


To identify a non-system default Boost installation, set BOOST_ROOT:PATH=/path/to/boost/1.69, where the specified path contains the include/ and lib/ directories.  Alternately, set BOOST_INCLUDEDIR and BOOST_LIBRARYDIR.

If you are using a non-system installed Boost, or your system has multiple Boost installations, it is often critical to set the following to avoid configuring Daktoa with a mix of headers from one Boost distribution and libraries from another:

# Avoid using BoostConfig.cmake if found on system

# Avoid using Boost from system location if found

Of course, if you wish to use a system Boost, or a CMake installed Boost, you may wish to set these options differently.

Linear Algebra

Variables BLAS_LIBS=path/to/libblas.* and LAPACK_LIBS=path/to/liblapack.*can be used to identify Fortran linear algebra libraries.  On some platforms these can be conveniently set to $ENV{BLAS_LIBS} and $ENV{LAPACK_LIBS} in a CMake cache initialization file.  Note: Not all DAKOTA's TPLs treat BLAS and LAPACK with the same cache variables. To use specific versions of these libraries, the following is likely necessary to handle HOPSPACK LAPACK dependency on BLAS: LAPACK_ADD_LIBS=${BLAS_LIBS}.

External Trilinos

To compile Dakota against an externally installed Teuchos, set Trilinos_DIR to the directory in an install tree containing TrilinosConfig.cmake, e.g., /usr/local/trilinos/lib/cmake/Trilinos/, which contains TrilinosConfig.cmake (similarly Teuchos_DIR for localtion of TeuchosConfig.cmake).