Hi Ahmad, Although I don’t have an answer for you, I just want to say that what you’re going here looks somewhat reasonable to me. Its unclear to me why this test would fail:
/usr/bin/cc -DLAPACK_SYMBOL_CHECK -pthread -rdynamic CMakeFiles/cmTC_3cdf4.dir/src.c.o -o cmTC_3cdf4 -lgfortran -lm /home/mamiri/workspace/petsc/petsc3.9_openmpi3.2/lib/libflapack.a /home/mamiri/workspace/petsc/petsc3.9_openmpi3.2/lib/libfblas.a /home/mamiri/workspace/petsc/petsc3.9_openmpi3.2/lib/libflapack.a(dgelsd.o): In function `dgelsd_': dgelsd.f:(.text+0x26a): undefined reference to `log’ …. + other missing symbols for math functions… since you specifically pass the -lm flag on the link line. As for this test: /usr/bin/c++ -DMKL_SYMBOL_CHECK -pthread -rdynamic CMakeFiles/cmTC_527e8.dir/src.cxx.o -o cmTC_527e8 -lgfortran -lm /home/mamiri/workspace/petsc/petsc3.9_openmpi3.2/lib/libflapack.a /home/mamiri/workspace/petsc/petsc3.9_openmpi3.2/lib/libfblas.a CMakeFiles/cmTC_527e8.dir/src.cxx.o: In function `main': src.cxx:(.text+0xe9): undefined reference to `MKL_Domatcopy' perhaps your missing a linker flag? I’m not familiar with MKL, so maybe there is (genuinely) something missing there. Maybe @Matthias or one of the other developers has some suggestions? I do have one suggestion: Have you perhaps tried installing OpenBLAS and using that as the BLAS and LAPACK provider? At least then its stand-alone, and you’re not relying on PETSc to download and correctly configure it for you. This is what happens in my Spack setup, which seems to work just fine. If you do this, then don’t forget to point PETSc to this BLAS/LAPACK provider too. Sorry I can’t be of more help, but hopefully someone else has a concrete solution for you and you can get this resolved soon. Best, Jean-Paul > On 03 Jul 2019, at 03:59, Ahmad Shahba <[email protected]> wrote: > > Thanks for your response. I want to know why CMake cannot locate lapack and > blas libraries in the path I explicitly provide. I feel that the answer to > this question should be simple and yet I don't know what the answer is :( I > don't really want to resort to other tools such as spack unless it is > absolutely the only way to get around this issue > > On Tuesday, July 2, 2019 at 8:24:06 PM UTC-4, Lee wrote: > Spack offers a powerful alternative way to install DEAL.II. > > On Wed, Jul 3, 2019 at 7:18 AM Ahmad Shahba <[email protected] <javascript:>> > wrote: > I am trying to compile deal.ii (version 9.1.1) on my Ubuntu laptop with gcc > compilers. I have tried two methods to configure deal.ii with LAPACK/BLAS and > both failed in a similar manner. > > method 1: Using LAPACK/BLAS in my PETSc (version 3.9) installation > Motivated by the instructions given here > <https://dealii.org/developer/users/cmake.html#advanced>, I use the following > CMake command > > > export PREFIX_PETSC_ARCH=$PETSC_DIR/$PETSC_ARCH > > cmake \ > -DDEAL_II_COMPONENT_DOCUMENTATION=OFF \ > -DGSL_DIR=$HOME/workspace/gsl \ > -DHDF5_DIR=$PREFIX_PETSC_ARCH \ > -DMETIS_DIR=$PREFIX_PETSC_ARCH \ > -DP4EST_DIR=$HOME/workspace/p4est-2.2/FAST \ > -DDEAL_II_WITH_P4EST=ON \ > -DPETSC_DIR=$PETSC_DIR \ > -DPETSC_ARCH=$PETSC_ARCH \ > -DSLEPC_DIR=$SLEPC_DIR \ > -DZLIB_DIR=$PREFIX_PETSC_ARCH \ > -DDEAL_II_WITH_LAPACK=ON \ > -DLAPACK_FOUND=true \ > > -DLAPACK_LIBRARIES="$PREFIX_PETSC_ARCH/lib/libflapack.a;$PREFIX_PETSC_ARCH/lib/libfblas.a" > \ > -DLAPACK_LINKER_FLAGS="-lgfortran -lm" \ > -DDEAL_II_WITH_MPI=ON \ > -DCMAKE_INSTALL_PREFIX=path/to/some/installation/directory \ > ../ > > The configuration fails with prints an error message like > > BLAS/LAPACK symbol check failed! This usually means that your BLAS/LAPACK > installation is incomplete or the link line is broken. > > I am attaching some CMake log and error files. > > method 2:Linking to the LAPACK/BLAS whick comes with MKL > For another project, I had use gfortran to compile LAPACK/BLAS which comes > with Intel MKL. Linking to these libraries also failed in the same manner. > Here is the CMake command > > export PREFIX_PETSC_ARCH=$PETSC_DIR/$PETSC_ARCH > > cmake \ > -DDEAL_II_COMPONENT_DOCUMENTATION=OFF \ > -DGSL_DIR=$HOME/workspace/gsl \ > -DHDF5_DIR=$PREFIX_PETSC_ARCH \ > -DMETIS_DIR=$PREFIX_PETSC_ARCH \ > -DP4EST_DIR=$HOME/workspace/p4est-2.2/FAST \ > -DDEAL_II_WITH_P4EST=ON \ > -DPETSC_DIR=$PETSC_DIR \ > -DPETSC_ARCH=$PETSC_ARCH \ > -DSLEPC_DIR=$SLEPC_DIR \ > -DZLIB_DIR=$PREFIX_PETSC_ARCH \ > -DDEAL_II_WITH_LAPACK=ON \ > -DLAPACK_FOUND=true \ > > -DLAPACK_LIBRARIES="${myInstallations}/lib/intel64/libmkl_blas95_lp64.a;${myInstallations}/lib/intel64/libmkl_lapack95_lp64.a;${MKLROOT}/lib/intel64/libmkl_gf_lp64.a;${MKLROOT}/lib/intel64/libmkl_sequential.a;${MKLROOT}/lib/intel64/libmkl_core.a" > \ > -DLAPACK_LINKER_FLAGS="-lgfortran -lpthread -lm -ldl" \ > -DDEAL_II_WITH_BLAS=ON \ > -DBLAS_FOUND=true \ > > -DBLAS_LIBRARIES="${myInstallations}/lib/intel64/libmkl_blas95_lp64.a;${myInstallations}/lib/intel64/libmkl_lapack95_lp64.a;${MKLROOT}/lib/intel64/libmkl_gf_lp64.a;${MKLROOT}/lib/intel64/libmkl_sequential.a;${MKLROOT}/lib/intel64/libmkl_core.a" > \ > -DBLAS_LINKER_FLAGS="-lgfortran -lpthread -lm -ldl" \ > -DSCALAPACK_DIR==$PREFIX_PETSC_ARCH \ > -DDEAL_II_WITH_MPI=ON \ > -DCMAKE_INSTALL_PREFIX=path/to/some/installation/directory \ > ../ > > > Any thoughts how I can get this done? > Thanks in advance, > Ahmad > > > -- > The deal.II project is located at http://www.dealii.org/ > <http://www.dealii.org/> > For mailing list/forum options, see > https://groups.google.com/d/forum/dealii?hl=en > <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 [email protected] <javascript:>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/dealii/60f9bf26-95d8-4b17-a529-1a498030433f%40googlegroups.com > > <https://groups.google.com/d/msgid/dealii/60f9bf26-95d8-4b17-a529-1a498030433f%40googlegroups.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. > > > -- > Li Yang > > -- > The deal.II project is located at http://www.dealii.org/ > <http://www.dealii.org/> > For mailing list/forum options, see > https://groups.google.com/d/forum/dealii?hl=en > <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 [email protected] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/dealii/ed83e369-a6ce-4db1-aa71-efd7bff4672a%40googlegroups.com > > <https://groups.google.com/d/msgid/dealii/ed83e369-a6ce-4db1-aa71-efd7bff4672a%40googlegroups.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/A6CB4033-C9D6-4191-8321-EEAC68218A48%40gmail.com. For more options, visit https://groups.google.com/d/optout.
