[Trilinos-Users] Build questions....

Adams, Brian M briadam at sandia.gov
Tue Aug 9 06:41:57 MDT 2011


That should work for any static archives that might get built in DAKOTA's tree.  I can't speak to the details right now, but I believe for some TPLs of DAKOTA it's necessary to set both:

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)

Also the library list you mention applies to the Trilinos + Autoconf/Dakota interface.  If you're building both with CMake and HEAD versions of both, it shouldn't be needed; the library list should propagate from the DAKOTA build to TriKota.

Brian

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


From: trilinos-users-bounces at software.sandia.gov [mailto:trilinos-users-bounces at software.sandia.gov] On Behalf Of Dustin Langewisch
Sent: Monday, August 08, 2011 1:14 PM
To: Mark Cartwright
Cc: trilinos-users at software.sandia.gov
Subject: Re: [Trilinos-Users] Build questions....

Mark,

For the -fpic problem, try adding

-DCMAKE_CXX_FLAGS="-fPIC"

to the configure script. Alternatively, just run

export CXXFLAGS="-fPIC"

The latter is what I personally did to overcome the problem, but presumably the former works as well. Also, I'm not sure if your problem is the same, or even related, but I had to change the list of libraries being built within Dakota to get Trikota to build successfully. In the file .../TriKota/src/CMakeLists.txt search for the variable DAKOTA_LIBS and you should find something like:

        SET(DAKOTA_LIBS
            dakota pecos lhs surfpack conmin
            ddace fsudace jega opt
            psuade newmat ncsuopt sparsegrid coliny colin
            pebbl utilib 3po nappspack appspack conveyor
            shared cdd cport amplsolver lhs nidr dl
          )

If this is what you have, then it needs to be changed since many of these libraries (namely coliny) do not exist in the newest version of Dakota. You must change this block to read:

        SET(DAKOTA_LIBS
            dakota pecos lhs surfpack conmin ddace fsudace jega opt psuade
            newmat ncsuopt sparsegrid colin interfaces momh scolib pebbl
            tinyxml utilib 3po hopspack cport amplsolver nidr dl boost_signals
          )

Order is important - make sure libraries are listed exactly in order given above.

Good luck,
Dustin


On Mon, Aug 8, 2011 at 11:54 AM, Mark Cartwright <mark_cartwright at mac.com<mailto:mark_cartwright at mac.com>> wrote:
I am building Trilinos from source on an unbuntu (64bit gcc 4.4.5) box.  Primarily for use with Titan, however I would like to explore some of trilinos itself...

I've run into an issue with TriKota -- it seems parts of Dakota are not being compiled -fPIC.  And I cant 'seem to find a way to force the Dakota config to stay -fPIC -- finding myself a bit lost with the nested CMake-ness...

What I get:

Linking CXX shared library libtrikota.so
/usr/bin/ld: /home/markc/trilinos-10.6.4-build/packages/TriKota/Dakota/install/lib/libdakota.a(ParallelLibrary.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
/home/markc/trilinos-10.6.4-build/packages/TriKota/Dakota/install/lib/libdakota.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[3]: *** [packages/TriKota/src/libtrikota.so] Error 1
make[2]: *** [packages/TriKota/src/CMakeFiles/trikota.dir/all] Error 2
make[1]: *** [packages/TriKota/src/CMakeFiles/trikota.dir/rule] Error 2
make: *** [trikota] Error 2


My "do-configure"

#!/bin/sh

export TRILINOS_HOME=/home/markc/trilinos-10.6.4-Source


EXTRA_ARGS=$@

       cmake \
         -D Trilinos_CONFIGURE_OPTIONS_FILE:FILEPATH=MyConfigureOptions.cmake \
         -D CMAKE_BUILD_TYPE:STRING=DEBUG \
         -D Trilinos_ENABLE_TESTS:BOOL=ON \
         $EXTRA_ARGS \
         ${TRILINOS_HOME}


And finally -- MyConfigureOptions.cmake

#SET(CMAKE_BUILD_TYPE DEBUG CACHE STRING "" FORCE)
SET(Trilinos_ENABLE_CHECKED_STL ON CACHE BOOL "" FORCE)
SET(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE)


It's obviously something very silly that I have overlooked -- but after 8 hours for permutations -- I thought I had better ask...

Cheers,

Mark



_______________________________________________
Trilinos-Users mailing list
Trilinos-Users at software.sandia.gov<mailto:Trilinos-Users at software.sandia.gov>
http://software.sandia.gov/mailman/listinfo/trilinos-users



--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20110809/1fbbf130/attachment.html 


More information about the Trilinos-Users mailing list