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

Dustin Langewisch dustinl at mit.edu
Tue Oct 4 19:02:19 MDT 2011


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





On Tue, Oct 4, 2011 at 3:41 PM, Phipps, Eric T <etphipp at sandia.gov> wrote:

>  Hi Dustin,
>
>  You can probably get around the ampl error by disabling ampl when TriKota
> configures Dakota.  I think you can do this by adding
>
>  --without-ampl
>
>  to packages/TriKota/src/CMakeLists.txt around line 76 and removing
> "amplsolver" from the list of libraries to link in on line 151 of that file.
>  You should check that is the proper flag though by running "./configure
> --help" in the top-level Dakota source tree.  Alternatively, you can try and
> figure out where "sysdetails_ASL" is coming from.  Looking at the link line
> for the Dakota executable might help, since presumably that succeeds (and so
> the library containing that symbol must be in the link there).  Running
>
>  ldd
> –r /home/dustin/trilinos-10.8.0-Source/build/packages/TriKota/Dakota/install/lib/libamplsolver.so
>
>  to look at all of the libraries libamplsolver.so wants to link to might
> also help.
>
>  For the stokhos error, can you look at the link of libstokhos.so and see
> if the Dakota install directory is listed there?  You may have to run "make
> VERBOSE=1" to see the link line, depending on how configured Trilinos.
> If it isn't there (which I assume it isn't), adding the following to
> packages/stokhos/src/CMakeLists.txt might help:
>
>  LINK_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}
>     ${PACKAGE_BINARY_DIR}../TriKota/Dakota/install/lib/)
>
>  We are working on a setting up TriKota to use new CMake infrastructure in
> Dakota, which gets around a lot of these issues.  However I don't believe
> Dakota distributes their CMake build infrastructure yet, so I don't think
> you can use it.
>
>  -Eric
>
>   From: Dustin Langewisch <dustinl at mit.edu>
> Date: Sun, 2 Oct 2011 22:41:09 -0400
> To: trilinos-users <trilinos-users at software.sandia.gov>
> Subject: [Trilinos-Users] Problem building Trilinos-10.8 with
> Trikota/Stokhos
>
>  All,
>
>  I've been trying to build the latest release (10.8) of Trilinos with
> TriKota and Stokhos but have been unsuccessful and am hoping someone can
> give me some advice. After many attempts I am left with the following
> errors:
>
>  /home/dustin/trilinos-10.8.0-Source/build/packages/TriKota/Dakota/install/lib/libamplsolver.so:
> undefined reference to `sysdetails_ASL'
> collect2: ld returned 1 exit status
> make[2]: *** [packages/TriKota/test/TriKota_SimpleEpetraExtME.exe] Error 1
> make[1]: ***
> [packages/TriKota/test/CMakeFiles/TriKota_SimpleEpetraExtME.dir/all] Error 2
>
>  make[2]: *** [packages/TriKota/test/TriKota_ParallelDiagonalThyraME.exe]
> Error 1
> make[1]: ***
> [packages/TriKota/test/CMakeFiles/TriKota_ParallelDiagonalThyraME.dir/all]
> Error 2
>
>  /usr/bin/ld: cannot find -ldakota
> collect2: ld returned 1 exit status
> make[2]: *** [packages/stokhos/src/libstokhos.so] Error 1
> make[1]: *** [packages/stokhos/src/CMakeFiles/stokhos.dir/all] Error 2
> make: *** [all] Error 2
>
>  I'm following the same approach I used to successfully (after many, many
> attempts) install Trilinos 10.6, but I have now switched to the latest
> stable release of Dakota. This got me through the "-fPIC" errors, but I
> can't seem to get around the errors listed above. By removing "-D
> Trilinos_ENABLE_TESTS:BOOL=ON" from my configure script I can avoid the
> "undefined reference to 'sysdetails_ASL'" error, but I suspect that such an
> approach might just be covering up the problem.
>
>  However, I can't seem to get Stokhos to locate the dakota library.
> dakota.so exists in .../packages/TriKota/dakota/install, so it appears that
> Dakota is being build, but I can't seem to get Stokhos to recognize it.
>
>  Any suggestions would be appreciated. FYI, I'm installing on Ubuntu 10.04
> (64 bit).
>
>  Thanks,
> Dustin
>
>
>  --
> Dustin Langewisch
> dustinl at mit.edu
>
>  _______________________________________________ Trilinos-Users mailing
> list Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users
>



-- 
Dustin Langewisch
Graduate Student
MIT Nuclear Science and Engineering
dustinl at mit.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20111004/17c2a1c3/attachment.html 


More information about the Trilinos-Users mailing list