cmake with atlas blas and lapack libraries

1,030 views
Skip to first unread message

sebuschi

unread,
Jul 18, 2014, 11:14:30 AM7/18/14
to dea...@googlegroups.com
I've installed the atlas blas and lapack libraries under ~/appl/atlas/builddir/lib as can be seen here:
$ ls
libatlas.a  libf77blas.a     liblapack.a   libptf77blas.a  libsatlas.so  libtstatlas.a  Make.inc
libcblas.a  libf77refblas.a  libptcblas.a  libptlapack.a   libtatlas.so  Makefile

Now I try to run the cmake step with:
mkdir dealii
cd dealii
CC=mpicc CXX=mpiCC cmake -DP4EST_DIR=$HOME/share/p4est \
    -DDEAL_II_WITH_P4EST=ON \
    -DDEAL_II_WITH_MPI=ON \
    -DDEAL_II_WITH_TRILINOS=ON \
    -DDEAL_II_WITH_THREADS=ON \
    -DTRILINOS_DIR=$HOME/share/trilinos \
    -DDEAL_II_COMPONENT_MESH_CONVERTER=OFF \
    -DDEAL_II_COMPONENT_PARAMETER_GUI=OFF \
    -DDEAL_II_COMPONENT_COMPAT_FILES=OFF \
    -DCMAKE_INSTALL_PREFIX=$HOME/share/dealii \
    -DLAPACK_DIR=/home/boem/appl/atlas/builddir/lib \
    -DBLAS_DIR=/home/boem/appl/atlas/builddir/lib \
    -DLAPACK_LIBRARIES="-latlas -lcblas -lf77blas -llapack" \
    ../deal.II

but cmake complains that it can't find a blas and lapack library:
/home/boem/opt/openmpi-1.8.1/bin/mpiCC    -DDEAL_II_HAVE_FLAG_pthread    CMakeFiles/cmTryCompileExec2526464279.dir/src.cxx.o  -o cmTryCompileExec2526464279 -rdynamic -latlas -lcblas -lf77blas -llapack
/usr/bin/ld: cannot find -latlas
collect2: error: ld returned 1 exit status
gmake[1]: *** [cmTryCompileExec2526464279] Error 1

My LD_LIBRARY_PATH has it:
echo $LD_LIBRARY_PATH
....:/home/boem/appl/atlas/builddir/lib:

Any help is much appreciated!

Timo Heister

unread,
Jul 19, 2014, 8:25:13 AM7/19/14
to dea...@googlegroups.com
If you add "-latlas" then the linker is looking for libatlas.so, which
does not exist in your listing above. Did you configure atlas to
create a shared lib?
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see
> https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dealii+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Timo Heister
http://www.math.clemson.edu/~heister/

Matthias Maier

unread,
Jul 19, 2014, 8:37:46 AM7/19/14
to dea...@googlegroups.com

Am 19. Jul 2014, 14:24 schrieb Timo Heister <hei...@clemson.edu>:

> If you add "-latlas" then the linker is looking for libatlas.so, which
> does not exist in your listing above. Did you configure atlas to
> create a shared lib?
>
> On Fri, Jul 18, 2014 at 5:14 PM, sebuschi <achim.bo...@t-online.de> wrote:
>> [...]

The link line is wrong. If this shall be a manual override, it must
read:

-DLAPACK_LIBRARIES="-L<correct path> -latlas -lcblas -lf77blas -llapack"

or better:

-DLAPACK_LIBRARIES="/full/path/to/libatlas.so;..."

or even better:

- nuke build directory, try again by only defining LAPACK_DIR=...,
BLAS_DIR=... (without *_LIBRARIES...).

The variable LAPACK_DIR is only used for the FindLAPACK.cmake module to
find libraries. However, in case LAPACK_LIBRARIES is manually defined,
nothing happens.

Best,
Matthias

sebuschi

unread,
Jul 21, 2014, 3:58:41 AM7/21/14
to dea...@googlegroups.com
Thanks fro answering. I tried both the version specifying LAPACK_LIBRARIES:
...
      -D LAPACK_LIBRARIES="/home/boem/appl/atlas/builddir/lib/libsatlas.so" \
...

leading to
239 -- Processing enabled TPL: MPI
240 -- Processing enabled TPL: BLAS
241 --   Searching for library 'blas' ...
242 --   Searching for library 'blas_win32' ...
243 --   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_LIBRARI    ES to point to the BLAS libraries!
244 CMake Error at cmake/tribits/package_arch/TribitsTplDeclareLibraries.cmake:342 (MESSAGE):
245   Could not find the BLAS Library! Please manually set BLAS_LIBRARY_DIRS
246   and/or BLAS_LIBRARY_NAMES or just TPL_BLAS_LIBRARIES to point to the BLAS
247   libraries!

and the version specifying only the directories:

      -D LAPACK_DIR="/home/boemelb/appl/atlas/builddir/lib" \
      -D BLAS_DIR="/home/boemelb/appl/atlas/builddir/lib" \

leading to

239 -- Processing enabled TPL: MPI
240 -- Processing enabled TPL: BLAS
241 --   Searching for library 'blas' ...
242 --   Searching for library 'blas_win32' ...
243 --   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_LIBRARI    ES to point to the BLAS libraries!
244 CMake Error at cmake/tribits/package_arch/TribitsTplDeclareLibraries.cmake:342 (MESSAGE):
245   Could not find the BLAS Library! Please manually set BLAS_LIBRARY_DIRS
246   and/or BLAS_LIBRARY_NAMES or just TPL_BLAS_LIBRARIES to point to the BLAS
247   libraries!

The atlas library was compiled with shared option and the documentation for atlas tells
that all the components of the atlas library are inside of libsatlas.so for the sequential routines and
libtatlas.so for the threaded version.

Wolfgang Bangerth

unread,
Jul 26, 2014, 7:49:44 AM7/26/14
to dea...@googlegroups.com

> $ ls
> libatlas.a libf77blas.a liblapack.a libptf77blas.a libsatlas.so
> libtstatlas.a Make.inc
> libcblas.a libf77refblas.a libptcblas.a libptlapack.a libtatlas.so Makefile
>
> Now I try to run the cmake step with:
> mkdir dealii
> cd dealii
> CC=mpicc CXX=mpiCC cmake -DP4EST_DIR=$HOME/share/p4est \
> -DDEAL_II_WITH_P4EST=ON \
> -DDEAL_II_WITH_MPI=ON \
> -DDEAL_II_WITH_TRILINOS=ON \
> -DDEAL_II_WITH_THREADS=ON \
> -DTRILINOS_DIR=$HOME/share/trilinos \
> -DDEAL_II_COMPONENT_MESH_CONVERTER=OFF \
> -DDEAL_II_COMPONENT_PARAMETER_GUI=OFF \
> -DDEAL_II_COMPONENT_COMPAT_FILES=OFF \
> -DCMAKE_INSTALL_PREFIX=$HOME/share/dealii \
> -DLAPACK_DIR=/home/boem/appl/atlas/builddir/lib \
> -DBLAS_DIR=/home/boem/appl/atlas/builddir/lib \
> -DLAPACK_LIBRARIES="-latlas -lcblas -lf77blas -llapack" \

-latlas can't work because there is no libatlas.so. You need to specify
-lsatlas. Do you really need to specify all of the other libraries there as well?

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@math.tamu.edu
www: http://www.math.tamu.edu/~bangerth/

Reply all
Reply to author
Forward
0 new messages