← Back to team overview

dolfin team mailing list archive

Re: FindLAPACK

 

On Tue, Oct 23, 2012 at 05:21:07PM +0200, Johannes Ring wrote:
> On Tue, Oct 23, 2012 at 4:50 PM, Anders Logg <logg@xxxxxxxxx> wrote:
> > On Tue, Oct 23, 2012 at 09:29:05AM +0200, Johannes Ring wrote:
> >> On Tue, Oct 23, 2012 at 9:14 AM, Johannes Ring <johannr@xxxxxxxxx> wrote:
> >> > On Tue, Oct 23, 2012 at 9:00 AM, Anders Logg <logg@xxxxxxxxx> wrote:
> >> >> On Tue, Oct 23, 2012 at 08:59:36AM +0200, Johannes Ring wrote:
> >> >>> On Tue, Oct 23, 2012 at 8:27 AM, Anders Logg <logg@xxxxxxxxx> wrote:
> >> >>> > On Mon, Oct 22, 2012 at 10:44:17PM -0700, Anders Logg wrote:
> >> >>> >> I'm having trouble getting DOLFIN configure to recognize the LAPACK
> >> >>> >> built as part of my ATLAS install. Exactly what is the CMake module
> >> >>> >> FindLAPACK module looking for?
> >> >>> >>
> >> >>> >> Is the LAPACK installation by ATLAS (using --with-netlib-lapack-tarfile) not
> >> >>> >> sufficient?
> >> >>> >
> >> >>> > The problem seems to be that CMAKE_LIBRARY_PATH is not used in
> >> >>> > FindLAPACK.cmake. It's instead using the variable _libdir.
> >> >>> >
> >> >>> > I haven't been hacking CMake for quite some time. Can someone
> >> >>> > enlighten me on whether anything is broken in FindLAPACK.cmake?
> >> >>>
> >> >>> I'm also having trouble with DOLFIN and my selfbuilt ATLAS/LAPACK. I
> >> >>> will let you know if I found something out.
> >> >>
> >> >> Great, thanks.
> >> >
> >> > This worked for me:
> >> >
> >> >   -D BLA_VENDOR:STRING=ATLAS \
> >> >   -D LAPACK_DIR:PATH=${ATLAS_DIR} \
> >> >   -D LAPACK_LIBRARIES:FILEPATH=${ATLAS_DIR}/lib/liblapack.a \
> >> >   -D BLAS_DIR:PATH=${ATLAS_DIR} \
> >> >   -D BLAS_LIBRARIES:FILEPATH="${ATLAS_DIR})/lib/libf77blas.a;${ATLAS_DIR})/lib/libcblas.a;${ATLAS_DIR})/lib/libatlas.a"
> >>
> >> There was a typo there, but this also works for me:
> >>
> >>       -D LAPACK_LIBRARIES:FILEPATH=${ATLAS_DIR}/lib/liblapack.a \
> >>       -D BLAS_LIBRARIES:FILEPATH=${ATLAS_DIR}/lib/libatlas.a
> >
> > ok, I'll try that later.
> >
> > But it seems unnecessarily complicated. It should be enough for us to
> > define FOO_DIR to make it work. Can we define these extra variables in
> > CMakeLists.txt in DOLFIN or modify FindLAPACK?
>
> I haven't looked much into FindLAPACK and FindBLAS. I think they are
> more or less the same as the ones that come with CMake, only with some
> minor fixes. The can probably be improved, but I don't think setting
> LAPACK_LIBRARIES and BLAS_LIBRARIES is complicated. It should be easy
> to add in Dorsal.

I think they should be set in DOLFIN so that when one has all
dependencies for DOLFIN installed, either using Dorsal or manually,
it should be easy to build DOLFIN, without needing to know a large
number of special environment variables. See below.

> > Another issue is whether it would be possible to just define one
> > variable, say FENICS_DIR, and use as a fallback for all dependencies.
> >
> > I have a config file containing this:
> >
> > export BLAS_DIR=$PREFIX
> > export LAPACK_DIR=$PREFIX
> > export LAPACKANDBLAS_DIR=$PREFIX
> > export BOOST_ROOT=$PREFIX
> > export ARMADILLO_DIR=$PREFIX
> > export PETSC_DIR=$PREFIX
> > export PETSC_ARCH=linux-gnu-cxx-opt
> > export SLEPC_DIR=$PREFIX
> > export UFC_DIR=$PREFIX
> > export TRILINOS_DIR=$PREFIX
> >
> > If one uses Dorsal to build all dependencies for DOLFIN, it would be
> > convenient to define just FENICS_DIR and if one of the libraries we
> > depend on happens to be in another place that can be overridden. I
> > imagine we could add a section to deal with this in CMakeLists.txt.
> >
> > if (NOT _BLAS_DIR)
> >   set(BLAS_DIR ${FENICS_DIR})
> > endif ()
> > if (NOT _LAPACK_DIR)
> >   set(LAPACK_DIR ${FENICS_DIR})
> >   + extra LAPACK stuff
> > endif ()
> > etc
>
> It is not necessary to define FOO_DIR, BAR_DIR, etc. if all of them
> points to the same directory. Simply do
>
>   export CMAKE_PREFIX_PATH=$PREFIX
>
> That will tell CMake to prefer packages found in $PREFIX. This should
> probably be added somewhere in Dorsal.

ok. I forgot about that. I'll see if I can make it work and then make
it easier to build.

--
Anders


References