Search code examples
c++boostcmaketrilinos

Configure Error when Building Dakota


I am trying to build Sandia Lab's Dakota toolkit under Kubuntu 14.04 using the following cmake script:

cmake \
-D CMAKE_INSTALL_PREFIX:PATH=/usr/local/dakota \
-D CMAKE_BUILD_TYPE:STRING=Release \
-D DAKOTA_HAVE_MPI:BOOL=TRUE \
-D MPI_INCLUDE_PATH="/usr/lib/openmpi/include" \
-D MPI_LIBRARY="/usr/lib/openmpi/lib" \
-D CMAKE_CXX_COMPILER:FILEPATH="/usr/bin/mpicxx" \
-D HAVE_X_GRAPHICS:BOOL=FALSE \
-D Trilinos_DIR:STRING="=/usr/local/trilinos/lib/cmake/Trilinos" \
-D BLAS_LIBS:STRING="/usr/lib/libcblas.so.3" \
-D LAPACK_LIBS:STRING="/usr/lib/lapack.so.3" \
-D Boost_INCLUDE_DIR:STRING="/usr/local/boost/source/boost_1_57_0" \
/usr/local/dakota/dakota-6.1.0.src

However, configuring fails with the warning

CMake Warning at /usr/local/trilinos/TrilinosConfig.cmake:44 (MESSAGE):
TrilinosConfig.cmake has moved.  It now exists at a location under the
installation prefix where the find_package command looks by default     (<prefix>/lib/cmake/Trilinos).  This compatibility file exists at the old location (<prefix>/include) to present this message and load the file from  its new location. The find_package() call that loaded this file did so because its cached result variable, Trilinos_DIR, is set to              

/usr/local/trilinos

I'm locally setting Trilinos_DIR to

/usr/local/lib/cmake/Trilinos

and loading TrilinosConfig.cmake from its new location.  One may suppress
this warning by setting the above value in the cache.  However, the
application needs modification permanently fix the issue.  The
find_package() call that loaded this file may have the form

find_package(Trilinos REQUIRED PATHS ${Trilinos_PATH}/include)

Change it to the form

set(CMAKE_PREFIX_PATH ${Trilinos_PATH} ${CMAKE_PREFIX_PATH})
find_package(Trilinos REQUIRED)

to find TrilinosConfig.cmake in its new location in future builds while
still honoring the Trilinos_PATH option for this application.

and error

CMake Error at /usr/local/trilinos/TrilinosConfig.cmake:66 (INCLUDE):
include could not find load file:

/usr/local/lib/cmake/Trilinos/TrilinosConfig.cmake

because there is no Trilinos under /usr/local/lib/cmake/Trilinos. Unfortunately I am not experienced enough in using cmake to remedy this, even though a solutions seems to be suggested already. Can anyone take me through the process?

In addition to the Trilinos issue, cmake also fails to find several (header) files, namely

Looking for pthread_create in pthreads - not found
Looking for include file cxxabi.h - not found
Looking for include file cxxabi.h - not found
Looking for pdb.h - not found

and I am not sure if this is a separate issue (and if so how to fix it). Any help will be appreciated.

Relevant software versions are cmake 2.8.12.2, boost 1.57.0, openmpi 1.6.5, and trilinos 11.14.1.


Solution

  • Try the following 2 options.

    Either...

    • Modify your cmake invocation, namely removing

      -D Trilinos_DIR:STRING="=/usr/local/trilinos/lib/cmake/Trilinos" \

    Or...

    • Find where your TrilinosConfig.cmake is located
    • Modify your cmake invocation, namely putting the correct directory where you say

      -D Trilinos_DIR:STRING="=/usr/local/trilinos/lib/cmake/Trilinos" \


    Regarding the second part of your question, first check if the fact that those headers cannot be found has really an impact on your subsequent build.


    Now I see that you have a typo in your command line, a bogus =. Try with

    -D Trilinos_DIR:STRING="/usr/local/trilinos/lib/cmake/Trilinos"

    or

    -D Trilinos_DIR:STRING="/usr/local/trilinos"