[Trilinos-Users] How to get lapack/blas library consistency?

Perschbacher, Brent M bmpersc at sandia.gov
Wed Jul 7 10:41:17 MDT 2010

Just to give a quick and dirty description of what I just sent John. The values that are in TrilinosConfig.cmake are what Trilinos used to compile against, however, that doesn't necessarily mean that will be used to link at runtime in the case of shared libraries. When linking at run time your environment, specifically your LD_LIBRARY_PATH and PATH can affect where shared libraries are found. For executables you can tell them where to find shared libraries overriding the LD_LIBRARY_PATH (for gcc this is done with rpath), however, I'm not sure if you can do that when building a library as rpath is a linker option. The tool ldd uses the same logic to determine what libraries will be needed which is good, but if rpath isn't set for the library then it can only use the environment to figure out which shared libraries will be linked in.  I'm guessing that Johns LD_LIBRARY_PATH has the atlas path before /usr/lib64 which is why the atlas lapack was found. Blas however, was found in /usr/lib64 and that is likely because atlas doesn't provide a "libblas.*" but instead relies on f77blas and cblas for its blas implementation which is why those appear on the list of libraries as well.


On 7/7/10 10:22 AM, "Buermann, Lee R" <LRBUERMANN at csbsju.edu> wrote:

If what your building is using CMake, you should be able to write a Find Script for LAPACK. Trilinos has one in "yourTrilinosSource/cmake/TPLs/FindTPLLAPACK.cmake" I would think that if you use the same script as Trilinos, you would find the same libraries as Trilinos.


From: Kurtis Nusbaum [mailto:klnusbaum at gmail.com]
Sent: Wednesday, July 07, 2010 11:07 AM
To: John R Cary; Buermann, Lee R
Cc: Trilinos Users
Subject: Re: [Trilinos-Users] How to get lapack/blas library consistency?

Lee Buermann has actually been doing some work with the way Trilinos detects LAPACK. He might be able to speak to this issue. Lee, any thoughts?


On Wed, Jul 7, 2010 at 9:51 AM, John R Cary <cary at colorado.edu> wrote:

When we build something with Trilinos, we want (I assume)
to ensure that we use the same lapack libs that Trilinos
uses.  Is there a way to detect this?

I see:

iter.cary$ grep -i lapack TrilinosConfig.cmake
SET(Trilinos_TPL_LIBRARIES "/usr/lib64/liblapack.so;/usr/lib64/libblas.so")

which makes me this that those were used, but then I

iter.cary$ ldd lib/libifpack.so | egrep '(lapack|blas|atlas)'
       liblapack.so.3 => /usr/lib64/atlas/liblapack.so.3 (0x00007f61d5999000)
       libblas.so.3 => /usr/lib64/libblas.so.3 (0x00007f61d5743000)
       libf77blas.so.3 => /usr/lib64/atlas/libf77blas.so.3 (0x00007f61d471f000)
       libcblas.so.3 => /usr/lib64/atlas/libcblas.so.3 (0x00007f61d44fe000)
       libatlas.so.3 => /usr/lib64/atlas/libatlas.so.3 (0x00007f61d3c44000)

which seems to indicate that Trilinos chose not to use
the specified libs, but chose to use atlas and the
system blas instead.

I need a strategy that works for static builds, so cannot
use ldd to detect.


Trilinos-Users mailing list
Trilinos-Users at software.sandia.gov

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

More information about the Trilinos-Users mailing list