[petsc-users] Make PETSc not link with systemwide Atlas

Satish Balay balay at mcs.anl.gov
Thu Jun 20 19:56:05 CDT 2013


To strictly specify what you want - use --with-blas-lapack-lib

i.e --with-blas-lapack-lib="-L${LAPACK}/lib -llapack -lblas"

When you specify --with-blas-lapack-dir=$LAPACK/lib configure is
guessing the library names in a perticular order.  It so happens that
it was guessing atlas before -lblas and compiler found atlas in std
locations [and that got picked up]

Satish

On Thu, 20 Jun 2013, Ondřej Čertík wrote:

> Hi,
> 
> I want to strictly link to my own Lapack installed in $LAPACK:
> 
> $ ls $LAPACK/lib
> cmake  libblas.so  liblapack.so  pkgconfig
> 
> So I configure petsc with:
> 
> $PYTHON/bin/python ./config/configure.py --with-pic --with-clanguage=C
> --with-cc=$MPI/bin/mpicc --with-mpi-compilers --with-shared-libraries
> --prefix=$ARTIFACT --with-fortran=0 --with-blas-lapack-dir=$LAPACK/lib
> 
> The full log is attached with exact paths etc. The problem is that
> petsc still picks up systemwide Atlas, as can be seen from the end of
> configure.log:
> 
> BLAS/LAPACK: -Wl,-rpath,/home/ondrej/repos/python-hpcmp2/opt/lapack/xq2x/lib
> -L/home/ondrej/repos/python-hpcmp2/opt/lapack/xq2x/lib -llapack
> -Wl,-rpath,/home/ondrej/repos/python-hpcmp2/opt/lapack/xq2x/lib
> -L/home/ondrej/repos/python-hpcmp2/opt/lapack/xq2x/lib -lcblas
> -Wl,-rpath,/home/ondrej/repos/python-hpcmp2/opt/lapack/xq2x/lib
> -L/home/ondrej/repos/python-hpcmp2/opt/lapack/xq2x/lib -lf77blas
> -Wl,-rpath,/home/ondrej/repos/python-hpcmp2/opt/lapack/xq2x/lib
> -L/home/ondrej/repos/python-hpcmp2/opt/lapack/xq2x/lib -latlas
> 
> as well as from ldd:
> 
> ondrej at cekees-MacBookPro-ubuntu:~/repos/python-hpcmp2$ ldd
> opt/petsc/zlfe/lib/libpetsc.so
>     linux-gate.so.1 =>  (0xb7742000)
>     libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0xb672d000)
>     libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb6712000)
>     liblapack.so =>
> /home/ondrej/repos/python-hpcmp2/opt/lapack/xq2x/lib/liblapack.so
> (0xb5e6c000)
>     libf77blas.so.3 => /usr/lib/libf77blas.so.3 (0xb5e4d000)
>     libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb5e0a000)
>     libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb5e05000)
>     libmpich.so.10 =>
> /home/ondrej/repos/python-hpcmp2/opt/mpich/c7uq/lib/libmpich.so.10
> (0xb5b91000)
>     libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb59dd000)
>     libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xb59bb000)
>     /lib/ld-linux.so.2 (0xb7743000)
>     libblas.so =>
> /home/ondrej/repos/python-hpcmp2/opt/lapack/xq2x/lib/libblas.so
> (0xb591b000)
>     libgfortran.so.3 => /usr/lib/i386-linux-gnu/libgfortran.so.3 (0xb5823000)
>     libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb5806000)
>     libcblas.so.3 => /usr/lib/libcblas.so.3 (0xb57e5000)
>     libatlas.so.3 => /usr/lib/libatlas.so.3 (0xb5504000)
>     libmpl.so.1 =>
> /home/ondrej/repos/python-hpcmp2/opt/mpich/c7uq/lib/libmpl.so.1
> (0xb54fe000)
>     librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xb54f5000)
>     libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0xb54f1000)
>     libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0xb54e9000)
>     libquadmath.so.0 => /usr/lib/i386-linux-gnu/libquadmath.so.0 (0xb5471000)
> 
> as you can see, it actually does link to my blas/lapack, but also to
> systemwide cblas and atlas...
> 
> I want the ldd to look like this (my other machine):
> 
> ondrej at kittiwake:~/repos/python-hpcmp2((bca3099...))$ ldd
> local/lib/libpetsc.so         linux-vdso.so.1 =>  (0x00007fff1dd1f000)
>     libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007fe85f46f000)
>     libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
> (0x00007fe85f252000)
>     liblapack.so =>
> /auto/netscratch/ondrej/opt/lapack/xq2x/lib/liblapack.so
> (0x00007fe85e768000)
>     libblas.so =>
> /auto/netscratch/ondrej/opt/lapack/xq2x/lib/libblas.so
> (0x00007fe85e4a8000)
>     libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe85e1ac000)
>     libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe85dfa7000)
>     libmpich.so.10 =>
> /auto/netscratch/ondrej/opt/mpich/c7uq/lib/libmpich.so.10
> (0x00007fe85db3d000)
>     libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe85d77e000)
>     libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fe85d55f000)
>     /lib64/ld-linux-x86-64.so.2 (0x00007fe8609a9000)
>     libgfortran.so.3 => /usr/lib/x86_64-linux-gnu/libgfortran.so.3
> (0x00007fe85d248000)
>     libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fe85d032000)
>     libmpl.so.1 =>
> /auto/netscratch/ondrej/opt/mpich/c7uq/lib/libmpl.so.1
> (0x00007fe85ce2b000)
>     librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fe85cc23000)
>     libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007fe85ca1f000)
>     libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6
> (0x00007fe85c819000)
>     libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0
> (0x00007fe85c5e3000)
> 
> 
> How can I do that? I read here:
> 
> http://www.mcs.anl.gov/petsc/documentation/installation.html#blas-lapack
> 
> that maybe I should try to use the "--with-blas-lapack-lib" option.
> But I wanted to first check if I am doing something wrong, or what the
> intended way to setup Lapack is.
> 
> Thanks for any tips,
> Ondrej Certik
> 


More information about the petsc-users mailing list