[Trilinos-Users] How to link libblas.so

Martin Vymazal martin.vymazal at vki.ac.be
Thu Jul 28 13:10:35 MDT 2011


Hello Brent, Jim, Kurtis and Shota,

  thank you for your help. I'm sorry about the confusion with  
$HOME/local/atlas/lib and $HOME/local/lapack/lib, I fixed that in my  
script but I still put a wrong path in my previous email. In the end,  
this is what worked for me:

   -D TPL_ENABLE_BLAS:BOOL=ON \
   -D BLAS_LIBRARY_DIRS:PATH=$HOME/local/atlas/lib \
   -D BLAS_LIBRARY_NAMES:STRING="cblas;f77blas;atlas" \

Both the shell variable $HOME and an absolute path as Jim suggested  
works fine.

Thank you very much.

  Martin



Quoting "Perschbacher, Brent M" <bmpersc at sandia.gov>:

> While setting BLAS_LIBRARIES the way Jim suggested will work for configuring
> and building it will cause issues with the export system. His first
> suggestion of setting the BLAS_LIBRARY_DIRS and BLAS_LIBRARY_NAMES should
> work just as well and will play nicely with the export systems in Trilinos.
>
> Kurtis' suggestion for deleting the CMakeCache.txt file is a useful
> troubleshooting step as well. Cmake keeps that around so that it doesn't
> have to re-find/re-test everything when configuring multiple times. However,
> it can sometimes cause odd behavior so deleting it when things seem to not
> be working when they should is a good idea. However, in this case I think
> that your original issue was that your atlas libraries seem to be in
> $HOME/local/atlas/lib, but in your configure script you gave the path
> $HOME/local/lapack/lib. I'm guessing that directory doesn't exist and that
> is why the blas library was not found. I think the correct solution to your
> problem though is the first suggestion that Jim gave. If that doesn't work
> please let us know.
>
> Brent
>
>
> On 7/28/11 12:38 PM, "Willenbring, James M" <jmwille at sandia.gov> wrote:
>
>> Martin,
>>
>> Trilinos can be linked to Atlas BLAS.  You don't want to use that symbolic
>> link.  Atlas contains BLAS linking instructions.  You need to link  
>> to multiple
>> libraries.  F77blas is not a complete blas implementation.  You will want
>> something that looks more like this:
>>
>> -DBLAS_LIBRARY_DIRS="/full/path/local/atlas/lib" \
>> -DBLAS_LIBRARY_NAMES="cblas;f77blas;atlas;gfortran" \
>>
>> You may or may not need gfortran depending on your setup.  You can also try
>>
>> -DBLAS_LIBRARIES="-L/full/path/local/atlas/lib -lcblas -lf77blas -latlas
>> -lgfortran"
>>
>> Jim
>>
>> -----Original Message-----
>> From: Martin Vymazal [mailto:martin.vymazal at vki.ac.be]
>> Sent: Thursday, July 28, 2011 11:57 AM
>> To: Willenbring, James M
>> Cc: trilinos-users at software.sandia.gov
>> Subject: RE: [Trilinos-Users] How to link libblas.so
>>
>> Hello Jim,
>>
>>
>>   Thank you for your reply. I compiled atlas with blas and lapack. My
>> ~/local/atlas/lib contains:
>>    libatlas.a
>>    libblas.a -> libf77blas.a
>>    libcblas.a
>>    libf77blas.a
>>    liblapack.a
>>    libptcblas.a
>>    libptf77blas.a
>>    libsatlas.so
>>    libtatlas.so
>>
>> The symbolic link libblas.a was created by me. I tried to set
>>    -D BLAS_LIBRARIES=$HOME/local/lapack/lib/libf77blas.a
>> and also
>>    -D BLAS_LIBRARIES=$HOME/local/lapack/lib/libblas.a
>>
>> The error is still the same:
>> -- Processing enabled TPL: BLAS
>> --   Searching for library 'blas' ...
>> --   Searching for library 'blas_win32' ...
>> -- Warning: Could not find a library in the set "blas blas_win32" for
>> the TPL BLAS!  Please manually set BLAS_LIBRARY_DIRS and/or
>> BLAS_LIBRARY_NAMES or just TPL_BLAS_LIBRARIES to point to the BLAS
>> libraries!
>>
>> Do you have an idea what am I doing wrong? Can trilinos be linked to
>> 'atlas' blas?
>>
>>   Best regards,
>>
>>     Martin
>>
>>
>> Quoting "Willenbring, James M" <jmwille at sandia.gov>:
>>
>>> Martin,
>>>
>>> This is something I have seen before.  You need to either create a
>>> soft link from libblas.so pointing to libblas.so.3, or you can just
>>> specify the entire path and library as your blas:
>>> -DBLAS_LIBRARIES=/usr/lib64/libblas.so.3
>>>
>>> Jim
>>>
>>> -----Original Message-----
>>> From: trilinos-users-bounces at software.sandia.gov
>>> [mailto:trilinos-users-bounces at software.sandia.gov] On Behalf Of
>>> Martin Vymazal
>>> Sent: Tuesday, July 26, 2011 1:14 PM
>>> To: trilinos-users at software.sandia.gov
>>> Subject: [Trilinos-Users] How to link libblas.so
>>>
>>> Dear Trilinos users & developers,
>>>
>>>   I have trouble configuring trilinos (10.6.1) to detect blas. The
>>> folder /usr/lib64 contains:
>>>
>>> /usr/lib64//libblas.so.3 -> libblas.so.3.2.1
>>> /usr/lib64//libblas.so.3.2 -> libblas.so.3.2.1
>>> /usr/lib64//libblas.so.3.2.1
>>>
>>> and I run cmake with the following options:
>>>    ...
>>>    -D TPL_ENABLE_BLAS:BOOL=ON \
>>>    -D BLAS_LIBRARY_DIRS:PATH=/usr/lib64 \
>>>    -D BLAS_LIBRARY_NAMES:STRING="blas" \
>>>    ...
>>>
>>> And I always end up with the following:
>>>
>>> Getting information for all enabled TPLs ...
>>>
>>> -- Processing enabled TPL: MPI
>>> -- Processing enabled TPL: BLAS
>>> --   BLAS_LIBRARY_DIRS='/usr/lib64'
>>> --   Searching for library 'blas' ...
>>> -- Warning: Could not find a library in the set "blas" for the TPL
>>> BLAS!  Please manually set BLAS_LIBRARY_DIRS and/or BLAS_LIBRARY_NAMES
>>> or just TPL_BLAS_LIBRARIES to point to the BLAS libraries!
>>> CMake Error at cmake/package_arch/TPLDeclareLibraries.cmake:196 (MESSAGE):
>>>    Error, could not find the BLAS Library! Please manually set
>>>    BLAS_LIBRARY_DIRS and/or BLAS_LIBRARY_NAMES or just  
>>> TPL_BLAS_LIBRARIES to
>>>    point to the BLAS libraries!
>>>
>>> I don't have this problem when configuring with static blas library
>>> (libblas.a) in a different machine.
>>>
>>> Could you please tell me how to configure Trilinos properly? Thank you
>>> very much.
>>>
>>> Best regards,
>>>
>>>     Martin Vymazal
>>>
>>>
>>> ----------------------------------------------------------------
>>> This message was sent using IMP, the Internet Messaging Program.
>>>
>>>
>>>
>>> _______________________________________________
>>> Trilinos-Users mailing list
>>> Trilinos-Users at software.sandia.gov
>>> http://software.sandia.gov/mailman/listinfo/trilinos-users
>>>
>>>
>>
>>
>>
>> ----------------------------------------------------------------
>> This message was sent using IMP, the Internet Messaging Program.
>>
>>
>>
>>
>> _______________________________________________
>> Trilinos-Users mailing list
>> Trilinos-Users at software.sandia.gov
>> http://software.sandia.gov/mailman/listinfo/trilinos-users
>
>
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.





More information about the Trilinos-Users mailing list