LAPACK Library isn’t recognized; config path is correct

1,199 views
Skip to first unread message

Bernie

unread,
Jan 30, 2018, 8:35:54 PM1/30/18
to SCALE Users Group
Dear SCALE User Group,

Please forgive me if this is an obvious question - I’m new to the environment.

I am operating on a MacBook Air running with version 10.12.6 of macOS Sierra. I have fortran 4.8.5, g++ 4.8.5, CMake 3.9.5, qt4-mac 4.8.7, and lapack 3.8.0.

After configuring SCALE, I try to build but end up with the following error:

[  2%] Building CXX object Trilinos/packages/teuchos/numerics/src/CMakeFiles/teuchosnumerics.dir/Teuchos_Object.cpp.o
make
[2]: *** No rule to make target `/usr/local/lib/liblapack.so', needed by `Trilinos/packages/teuchos/numerics/src/libteuchosnumerics.6.2.dylib'.  Stop.
make[1]: *** [Trilinos/packages/teuchos/numerics/src/CMakeFiles/teuchosnumerics.dir/all] Error 2
make: *** [all] Error 2



Now, I searched for liblapack.so on my system but I can’t find it. The LAPACK install output is as follows:
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/cmake/lapack-3.8.0/lapack-targets.cmake
-- Installing: /usr/local/lib/cmake/lapack-3.8.0/lapack-targets-release.cmake
-- Installing: /usr/local/lib/pkgconfig/lapack.pc
-- Installing: /usr/local/lib/cmake/lapack-3.8.0/lapack-config.cmake
-- Installing: /usr/local/lib/cmake/lapack-3.8.0/lapack-config-version.cmake
-- Installing: /usr/local/lib/pkgconfig/blas.pc
-- Installing: /usr/local/lib/libblas.a
-- Installing: /usr/local/lib/liblapack.a


So I have liblapack.a, not liblapack.so. Perhaps I installed the wrong version?

Any hints would be appreciated.

Bernie
LAPACK_installation
configure_scale_gnu.sh
configure_output
scale_build_output

Rob Lefebvre

unread,
Jan 31, 2018, 7:08:40 AM1/31/18
to SCALE Users Group
Hi Bernie,
Your LAPACK_installation indicates you compiled lapack as a static library (*.a), but your configure_scale_gnu.sh is looking for the shared library (*.so). 

Try updating the configure_scale_gnu.sh to look for libblas.a and liblapack.a.

Best regards,
Rob Lefebvre
SCALE Code System 

Bernie

unread,
Jan 31, 2018, 9:38:52 AM1/31/18
to SCALE Users Group
Hi Rob,

Many thanks. I edited the configure_scale_gnu.sh script to point it to liblapack.a and libblas.a as recommended:

   -D TPL_LAPACK_LIBRARIES:STRING=${LAPACK}/liblapack.a \
   -D TPL_BLAS_LIBRARIES:STRING=${LAPACK}/libblas.a \


I do get another liblapack error when attempting to build SCALE:

[  2%] Linking CXX shared library libteuchosnumerics.dylib
Undefined symbols for architecture x86_64:
  "__gfortran_compare_string", referenced from:
      _ilaenv_ in liblapack.a(ilaenv.f.o)
      _iparmq_ in liblapack.a(iparmq.f.o)
  "__gfortran_concat_string", referenced from:
      _cgesvd_ in liblapack.a(cgesvd.f.o)
      _chseqr_ in liblapack.a(chseqr.f.o)
      _ctrtri_ in liblapack.a(ctrtri.f.o)
      _cunmqr_ in liblapack.a(cunmqr.f.o)
      _dgesvd_ in liblapack.a(dgesvd.f.o)
      _dhseqr_ in liblapack.a(dhseqr.f.o)
      _dormhr_ in liblapack.a(dormhr.f.o)
      ...
  "__gfortran_st_write", referenced from:
      _xerbla_ in liblapack.a(xerbla.f.o)
  "__gfortran_st_write_done", referenced from:
      _xerbla_ in liblapack.a(xerbla.f.o)
  "__gfortran_stop_string", referenced from:
      _xerbla_ in liblapack.a(xerbla.f.o)
  "__gfortran_string_len_trim", referenced from:
      _xerbla_ in liblapack.a(xerbla.f.o)
  "__gfortran_transfer_character_write", referenced from:
      _xerbla_ in liblapack.a(xerbla.f.o)
  "__gfortran_transfer_integer_write", referenced from:
      _xerbla_ in liblapack.a(xerbla.f.o)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [Trilinos/packages/teuchos/numerics/src/libteuchosnumerics.6.2.dylib] Error 1
make[1]: *** [Trilinos/packages/teuchos/numerics/src/CMakeFiles/teuchosnumerics.dir/all] Error 2
make: *** [all] Error 2


Next I tried to download lapack-3.7.1 from macports, but it only installed liblapack.a and liblapack.dylib, no liblapack.so.

Details are in the attachments.

Any help would be greatly appreciated.

Bernie


scale_build_output
scale_configure_output
configure_scale_gnu.sh
LAPACK_installation

Cliff Dugal

unread,
Feb 1, 2018, 10:40:29 AM2/1/18
to SCALE Users Group
I found that LAPACK versions 3.6.0 and above are not compatible with SCALE 6.2.

I've successfully compiled LAPACK 3.5.0 together with SCALE 6.2 here, though on an older Red Hat Linux system.

Bernie

unread,
Feb 5, 2018, 11:21:52 AM2/5/18
to scale-us...@googlegroups.com
Many thanks for this tip. Unfortunately I still have the same problem.

On my Mac, LAPACK 3.5.0 compiles as static libraries (*.a)

-- Installing: /usr/local/lib/pkgconfig/lapack.pc
-- Installing: /usr/local/lib/cmake/lapack-3.4.2/lapack-config.cmake
-- Installing: /usr/local/lib/cmake/lapack-3.4.2/lapack-config-version.cmake
-- Installing: /usr/local/lib/cmake/lapack-3.4.2/lapack-targets.cmake
-- Installing: /usr/local/lib/cmake/lapack-3.4.2/lapack-targets-noconfig.cmake
-- Installing: /usr/local/lib/pkgconfig/blas.pc
-- Installing: /usr/local/lib/libblas.a
-- Installing: /usr/local/lib/liblapack.a
-- Installing: /usr/local/lib/libtmglib.a

(aside: I have no idea why it says 3.4.2 when I downloaded and extracted 3.5.0).

Whereas shared libraries (*.so) are expected by SCALE. I modified my configure_scale_gnu.sh to look for static libraries (*.a):

...

   
-D TPL_LAPACK_LIBRARIES:STRING=${LAPACK}/liblapack.a \
   
-D TPL_BLAS_LIBRARIES:STRING=${LAPACK}/libblas.a \
...


And this seems to configure OK, but I get errors relating to LAPACK when compiling:

[  2%] Linking CXX shared library libteuchosnumerics.dylib
Undefined symbols for architecture x86_64:
  "__gfortran_compare_string", referenced from:
      _ilaenv_
in liblapack.a(ilaenv.f.o)

Much appreciation to everyone who has contributed to this work so far. Any additional hints would be most welcome.


lapack-3.5.0-build-and-install.txt
configure_scale_gnu.sh
SCALE_configure_output.txt
SCALE_build_output.txt

Bernie

unread,
Feb 7, 2018, 4:40:21 PM2/7/18
to SCALE Users Group
I have successfully compiled from source; many thanks to everyone who helped out, especially Rob and Cliff.

The trick here was to compile LAPACK-3.5.0 using cmake with the flag 
-DBUILD_SHARED_LIBS=ON

This produces .dylib libraries on Mac OS X and .so libraries in Linux. Either will work properly; the .a files produced without the flag do not.

In either case, the configure_scale_gnu.sh file must be updated with the appropriate extension:
...

   
-D TPL_LAPACK_LIBRARIES:STRING=${LAPACK}/liblapack.dylib \
   
-D TPL_BLAS_LIBRARIES:STRING=${LAPACK}/libblas.dylib \
...

In addition, I had to add the path where macports installed QT to this file, as recommended by Rob:

# Incorporate Qt QMake into search PATH
export PATH=/opt/local/libexec/qt4/bin:$PATH

(the above is for Mac OS X, for ubuntu Linux point to: /usr/lib/x86_64-linux-gnu/  )

Finally, I had to comment out 3 lines in total in scale_root/Trilinos/packages/anasazi/src/CMakelists.txt , not just one:

#ASSERT_DEFINED(Anasazi_ENABLE_ThyraEpetraAdapters)
...
#ASSERT_DEFINED(Anasazi_ENABLE_ThyraCore)
...
#ASSERT_DEFINED(Anasazi_ENABLE_Tpetra)

This got me up and running on Mac OS X 10.12.6. I am still troubleshooting a problem with the ubuntu installation but will hopefully post a solution in a bit.

Thanks again,

Bernie
Reply all
Reply to author
Forward
0 new messages