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

Perschbacher, Brent M bmpersc at sandia.gov
Thu Apr 3 15:04:59 MDT 2014

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/20140403/1f116a17/attachment.html>

More information about the Trilinos-Users mailing list