[Trilinos-Users] FW: building with shared libraries

Jason Slemons slemons at cray.com
Thu Oct 8 12:26:51 MDT 2009


I think I haven't been explaining my problem well. I am building a Teuchos test function and in the link step (when linking with libraries like BLAS, which is in 'lsci' or 'lsci_quadcore' below) I get the following error:

Linking CXX executable Teuchos_BLAS_test.exe
cd /home/users/slemons/trilinos/trilinos-10.0-Source/gnu.BUILD/packages/teuchos/test/BLAS && /home/users/slemons/cmake-2.9.20091007-Linux-i386/bin/cmake -E cmake_link_script CMakeFiles/Teuchos_BLAS_test.dir/link.txt --verbose=1
/opt/cray/xt-asyncpe/3.4.7/bin/CC    -DHAVE_MPI_CXX -DMPICH_IGNORE_CXX_SEEK -g -O0  -fPIC CMakeFiles/Teuchos_BLAS_test.dir/cxx_main.cpp.o  -o Teuchos_BLAS_test.exe -rdynamic -L/home/users/slemons/trilinos/trilinos-10.0-Source/gnu.BUILD/packages/teuchos/src ../../src/libteuchos.a -Wl,-Bstatic -lsci_quadcore -lsci -lsci_quadcore -lsci -Wl,-Bdynamic -Wl,-rpath,/home/users/slemons/trilinos/trilinos-10.0-Source/gnu.BUILD/packages/teuchos/src
/opt/cray/xt-asyncpe/3.4.7/bin/CC: INFO: linux target is being used

/opt/xt-libsci/ undefined reference to `dfftw_execute_dft_'

I think this error is caused by the fact that libsci.so is linked  and it requires the dfftw_execute_dft function. "-Wl, -Bdynamic" (in bold above) I believe causes the compiler to grab the dynamic libraries libsci.so instead of libsci.a, which is what I would like. Is there some way to make sure that -Bdynamic is never used at link time?


From: Perschbacher, Brent M [mailto:bmpersc at sandia.gov]
Sent: Thursday, October 08, 2009 8:32 AM
To: Jason Slemons; trilinos-users at software.sandia.gov
Subject: Re: [Trilinos-Users] FW: building with shared libraries

Right now building trilinos as shared objects is not the default so as long as you don't turn it on you will have static libraries. You can verify this by looking at the cmake cache variable "BUILD_SHARED_LIBS" either in the gui or by searching through the CMakeCache.txt file that is generated by the configure process. It should be set to "OFF" for static builds. There are some platforms/compilers where shared builds are the standard (sun comes to mind, maybe windows too) which might be where the the comment about automatically turning on of shared comes from. If you aren't on a system like that then static should be what you get. If you want to make 100% sure that your builds are always static you could set BUILD_SHARED_LIBS to off in your configure scripts, that should override any system default that may make the build shared. None of our testing platforms default to shared so I can't say I've tried that case though.


On 10/7/09 5:52 PM, "Jason Slemons" <slemons at cray.com> wrote:


Is building trilinos packages using shared libraries(for example TPLs) something that happens automatically? I read online that it might be and it looks like in cmake/TODO there is a bullet about making it default. I would like to know how to make sure that only static libraries are used to build trilinos(esp the tests in various packages) since my executables are going to be running on nodes without the libraries, and only on my build machine will I have access to all the Third Party Libraries.

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

More information about the Trilinos-Users mailing list