[Trilinos-Users] [EXTERNAL] OpenBLAS library for LAPACK

Eric Bavier bavier at cray.com
Fri Apr 4 08:21:00 MDT 2014

The OpenBLAS rotg does not handle "very large" inputs gracefully.

`~Eric Bavier, Scientific Libraries, Cray Inc.

From: trilinos-users-bounces at software.sandia.gov [trilinos-users-bounces at software.sandia.gov] on behalf of Gyorgy Matyasfalvi [matyasfalvi at gmail.com]
Sent: Friday, April 04, 2014 08:42
To: Perschbacher, Brent M
Cc: trilinos-users at software.sandia.gov
Subject: Re: [Trilinos-Users] [EXTERNAL] OpenBLAS library for LAPACK

Dear Brent:
Thank  you for your help! Adding:

-DTrilinos_EXTRA_LINK_FLAGS:STRING="-lgfortran" \

to the do-configure file got rid of the errors. And make ran successfully.

I ran the test:

$ ctest -j16

One test failed from the 184, namely:

The following tests FAILED:
96 - TeuchosNumerics_BLAS_ROTG_test_MPI_1 (Failed)
Errors while running CTest

Does this mean there is a discrepancy between the OpenBLAS rotg and the Teuchos implementation? Did anyone else encounter this? Workarounds?

Thanks! Best,

On Thu, Apr 3, 2014 at 5:04 PM, Perschbacher, Brent M <bmpersc at sandia.gov<mailto:bmpersc at sandia.gov>> wrote:
First the failures during the configure step are fine. They are tests to see if features are available, the failure is just a report that the feature wasn't available, however, the code will work without those features. In this case it is possible that some of those are false failures based on the linking error you are getting. Once that is fixed it is possible that some of those will turn to success.

The issue you are seeing is that openblas apparently depends on gfortran. However, by default we link with the c++ compiler, which usually doesn't link in any necessary fortran libraries. You can get around this by adding the following to your configure script:


Which should ensure that the gfortran library is linked properly.


From: Gyorgy Matyasfalvi <matyasfalvi at gmail.com<mailto:matyasfalvi at gmail.com>>
Date: Thursday, April 3, 2014 12:26 PM
To: "trilinos-users at software.sandia.gov<mailto:trilinos-users at software.sandia.gov>" <trilinos-users at software.sandia.gov<mailto:trilinos-users at software.sandia.gov>>
Subject: [EXTERNAL] [Trilinos-Users] OpenBLAS library for LAPACK

Dear User Community:

I am trying to build Trilinos on a 32 core (Intel Xeon ES-2660 @ 2.20 GHz) Ubuntu (12.04) system.
I have encountered an error while trying to build all targets after the configuration step.
I intended to use OpenBlas (libopenblas.a) for both the BLAS and the LAPACK library. It seems to me that this is causing the issue.

Initially I have noticed that some of the LAPACK tests during the configurations step fail. For example: DLARFP, SLARFP, ZLARFP ...
Nonetheless the configuration step completes with:
-- Configuring done
and I only get one warning:
CMake Warning:
  Manually-specified variables were not used by the project:


So I thought that the LAPACK functionality might not be needed for the Trilinos packages I am trying to install.

But then during the building phase I got the following error:
Building CXX object packages/teuchos/numerics/test/Polynomial/CMakeFiles/TeuchosNumerics_Polynomial_test.dir/cxx_main.cpp.o
/usr/local/openblas/lib/libopenblas.a(dtrtri_lapack.o): In function `dtrtrilapack_':
dtrtri_lapack.f:(.text+0x140): undefined reference to `_gfortran_concat_string'
/usr/local/openblas/lib/libopenblas.a(sgesvd.o): In function `sgesvd_':
sgesvd.f:(.text+0x3cc): undefined reference to `_gfortran_concat_string'
sgesvd.f:(.text+0xef8): undefined reference to `_gfortran_concat_string'
/usr/local/openblas/lib/libopenblas.a(shseqr.o): In function `shseqr_':
shseqr.f:(.text+0x3e2): undefined reference to `_gfortran_concat_string'
/usr/local/openblas/lib/libopenblas.a(sormbr.o): In function `sormbr_':
sormbr.f:(.text+0x3e3): undefined reference to `_gfortran_concat_string'
/usr/local/openblas/lib/libopenblas.a(sormbr.o):sormbr.f:(.text+0x602): more undefined references to `_gfortran_concat_string' follow
/usr/local/openblas/lib/libopenblas.a(ilaenv.o): In function `ilaenv_':
ilaenv.f:(.text+0x8d): undefined reference to `_gfortran_compare_string'
ilaenv.f:(.text+0xb4): undefined reference to `_gfortran_compare_string'
ilaenv.f:(.text+0x26f): undefined reference to `_gfortran_compare_string'
ilaenv.f:(.text+0x29c): undefined reference to `_gfortran_compare_string'
ilaenv.f:(.text+0x2c2): undefined reference to `_gfortran_compare_string'
/usr/local/openblas/lib/libopenblas.a(ilaenv.o):ilaenv.f:(.text+0x2e5): more undefined references to `_gfortran_compare_string' follow
collect2: ld returned 1 exit status
make[2]: *** [packages/teuchos/numerics/test/DenseMatrix/TeuchosNumerics_BandDenseSolver_test.exe] Error 1
make[1]: *** [packages/teuchos/numerics/test/DenseMatrix/CMakeFiles/TeuchosNumerics_BandDenseSolver_test.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

If I just try to build Epetra with:

$ make Epetra_all

the build is successful, so it seems this issue is only affecting certain packages.

Did anyone else experience issues with OpenBLAS? Is there a fix? What are some of the LAPACK and BLAS libraries recommended for Trilinos?

Thanks! Best,

PS: My do-configure file:


export CMAKE_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu

cmake \
-D BLAS_INCLUDE_DIRS:PATH="/usr/local/openblas/" \
-D BLAS_LIBRARY_DIRS:FILEPATH="/usr/local/openblas/lib" \
-D BLAS_LIBRARY_NAMES:STRING="libopenblas.a" \
-D LAPACK_INCLUDE_DIRS:PATH="/usr/local/openblas/" \
-D LAPACK_LIBRARY_DIRS:FILEPATH="/usr/local/openblas/lib" \
-D Trilinos_ENABLE_OpenMP:BOOL=ON \
-D Trilinos_ENABLE_Epetra:BOOL=ON \
-D Trilinos_ENABLE_EpetraExt=ON \
-D Trilinos_ENABLE_Kokkos:BOOL=ON \
-D Trilinos_ENABLE_Teuchos:BOOL=ON \

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://software.sandia.gov/pipermail/trilinos-users/attachments/20140404/6a7fe3c3/attachment-0001.html>

More information about the Trilinos-Users mailing list