[Trilinos-Users] Problem building Trilinos-10.8 with Trikota/Stokhos

Adams, Brian M briadam at sandia.gov
Fri Oct 7 09:54:39 MDT 2011


Dustin,

Thanks for your persistence; that is all very odd. Our experiences with TriKota/Dakota haven't been so rough, but we have struggled with AMPL in TriKota and with shared vs. static vs. static relocatable libraries in general.  It could be that additional flags should be getting mapped from the CMake build to the autotools configure script.

Regarding Eric's comment, DAKOTA is moving to support CMake and deprecating the autotools build.  While it's an emerging capability, currently that's the only way I build TriKota with DAKOTA.  You can try this if you like as our CMake build system is distributed with stable releases of DAKOTA.  Below this email I'll paste a partial CMake configure fragment that I use to build these capabilities (though I don't build Stokhos).  The key is to tell TriKota to use DAKOTA's CMake and make sure Boost is enabled (DAKOTA requires it).

Brian

Brian M. Adams, PhD (briadam at sandia.gov)
Optimization and Uncertainty Quantification
Sandia National Laboratories, Albuquerque, NM
http://www.sandia.gov/~briadam


Note: if you want to configure DAKOTA's Boost, but not Trilinos' you can specify Boost_INCLUDE_DIR (singular) and not enable the Trilinos Boost TPL and DAKOTA should do the right thing.

  -D Trilinos_ENABLE_TriKota:BOOL=ON \
  -D TriKota_ENABLE_DakotaCMake:BOOL=ON \
  -D TPL_ENABLE_MPI:BOOL=ON \
  -D MPI_BASE_DIR:PATH="/apps/openmpi-1.3" \
  -D TPL_ENABLE_Boost:BOOL=ON \
  -D Boost_INCLUDE_DIRS:FILEPATH="/apps/boost/1.40.0/include" \
  -D TPL_ENABLE_Expat:BOOL=ON \
  -D Expat_INCLUDE_DIRS:FILEPATH="/apps/expat/2.0.1/include" \
  -D Expat_LIBRARY_DIRS:FILEPATH="/apps/expat/2.0.1/lib" \
  -D CMAKE_CXX_COMPILER:FILEPATH="/apps/openmpi-1.3/bin/mpiCC" \
  -D CMAKE_C_COMPILER:FILEPATH="/apps/openmpi-1.3/bin/mpicc" \
  -D CMAKE_Fortran_COMPILER:FILEPATH="/apps/openmpi-1.3/bin/mpif90" \
  -D Trilinos_EXTRA_LINK_FLAGS:STRING="-L/usr/lib64 -lgfortran" \
  -D HAVE_STRING_H:BOOL=ON \





From: trilinos-users-bounces at software.sandia.gov [mailto:trilinos-users-bounces at software.sandia.gov] On Behalf Of Dustin Langewisch
Sent: Tuesday, October 04, 2011 7:02 PM
To: Phipps, Eric T
Cc: trilinos-users
Subject: Re: [Trilinos-Users] Problem building Trilinos-10.8 with Trikota/Stokhos

Thanks. After much experimentation, I seem to have hacked my way to success.

"sysdetails_ASL" seems to be related to shared library build of Dakota. Dakota installs fine as a stand-alone program with static ampl, ddace, etc. libraries. So, I edited the file .../TriKota/src/CMakeLists.txt to force a static build of Dakota.

Next, ld couldn't seem to locate libboost_signals.a when linking libtrikota.so, despite libboost_signals.a being located in /usr/lib and having Boost_LIBRARY_DIRS set to /usr/lib. The workaround was to run "do-configure", then before running "make" edit <build_dir>/packages/TriKota/src/cmake_install.cmake by replacing (~line 71):

IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE FILE FILES "/home/dustin/Programs/Trilinos/trilinos-10.8.0-dynamic/build/packages/TriKota/Dakota/install/lib/libboost_signals.a")
ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")

with
IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE FILE FILES "/usr/lib/libboost_signals.a")
ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")

With this, I could build and install TriKota, but ld was unable to locate libdakota.a when linking libstokhos.so. I tried your suggestion of adding the following to <source_dir>/packages/stokhos/src/CMakeLists.txt:

LINK_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}
    ${PACKAGE_BINARY_DIR}../TriKota/Dakota/install/lib/)

but for some reason that didn't work. After digging around in the CMakeLists file, I found the following:

IF (${PACKAGE_NAME}_ENABLE_TriKota)
  INCLUDE_DIRECTORIES(
      ${CMAKE_CURRENT_BINARY_DIR}/../../TriKota/Dakota/install/include
    )
ENDIF()

so I tried changing it to read:

IF (${PACKAGE_NAME}_ENABLE_TriKota)
  INCLUDE_DIRECTORIES(
      ${CMAKE_CURRENT_BINARY_DIR}/../../TriKota/Dakota/install/include
    )
  LINK_DIRECTORIES(
     ${CMAKE_CURRENT_BINARY_DIR}/../../TriKota/Dakota/install/lib
  )
ENDIF()

That also didn't work. The only way I was able to successfully link libstokhos.so was to copy all of the files in TriKota/Dakota/install/lib to /usr/lib.

Anyway, that seems to have done the trick, and everything appears to be functioning. I find it strange that ld won't look in /usr/lib when linking libtrikota.so and won't look  anywhere except /usr/lib when linking libstokhos.so, but I can't seem to change this.

Thanks again for the suggestions,
Dustin


-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20111007/3ac38f16/attachment.html 


More information about the Trilinos-Users mailing list