PETSc error compiling DOLFIN

134 views
Skip to first unread message

David Nolte

unread,
Feb 4, 2021, 12:59:40 PM2/4/21
to fenics-support, David Nolte
Dear all,

I am trying to compile dolfin 2019.1 from source (master of the
bitbucket repo) on my archlinux laptop. The dependencies were installed
from the arch repositories, in particular current PETSc (petsc-git,
3.14.4), openmpi, lapack+openblas, boost (current version 1.75 prompts a
cmake warning?).

Compiling dolfin gives the following error:

[ 23%] Building CXX object dolfin/CMakeFiles/dolfin.dir/fem/solve.cpp.o
/home/david/work/dev/build/fenics-master-2021-02-04/dolfin/dolfin/fem/PETScDMCollection.cpp:
In static member function ‘static std::shared_ptr<dolfin::PETScMatrix>
dolfin::PETScDMCollection::create_transfer_matrix(const
dolfin::FunctionSpace&, const dolfin::FunctionSpace&)’:
/home/david/work/dev/build/fenics-master-2021-02-04/dolfin/dolfin/fem/PETScDMCollection.cpp:596:46:
error: cannot convert ‘double*’ to ‘const PetscScalar*’ {aka ‘const
std::complex<double>*’}
  596 |                         values[fine_row].data(), INSERT_VALUES);
      |                         ~~~~~~~~~~~~~~~~~~~~~^~
      |                                              |
      |                                              double*
In file included from
/home/david/work/dev/build/fenics-master-2021-02-04/dolfin/dolfin/la/PETScMatrix.h:37,
                 from
/home/david/work/dev/build/fenics-master-2021-02-04/dolfin/dolfin/fem/PETScDMCollection.cpp:24:
/usr/local/petsc/linux-c-opt/include/petscmat.h:368:98: note:  
initializing argument 6 of ‘PetscErrorCode MatSetValues(Mat, PetscInt,
const PetscInt*, PetscInt, const PetscInt*, const PetscScalar*, InsertMode)’
  368 | PETSC_EXTERN PetscErrorCode MatSetValues(Mat,PetscInt,const
PetscInt[],PetscInt,const PetscInt[],const PetscScalar[],InsertMode);
     
|                                                                                                 
^~~~~~~~~~~~~~~~~~~
make[2]: *** [dolfin/CMakeFiles/dolfin.dir/build.make:745:
dolfin/CMakeFiles/dolfin.dir/fem/PETScDMCollection.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:1730:
dolfin/CMakeFiles/dolfin.dir/all] Error 2
make: *** [Makefile:160: all] Error 2

The full log is attached.

I'd very much appreciate any hints and comments. Thank you in advance!

Best wishes
David

dolfin.log

Marco Morandini

unread,
Feb 4, 2021, 1:10:24 PM2/4/21
to fenics-...@googlegroups.com
> [ 23%] Building CXX object dolfin/CMakeFiles/dolfin.dir/fem/solve.cpp.o
> /home/david/work/dev/build/fenics-master-2021-02-04/dolfin/dolfin/fem/PETScDMCollection.cpp:
> In static member function ‘static std::shared_ptr<dolfin::PETScMatrix>
> dolfin::PETScDMCollection::create_transfer_matrix(const
> dolfin::FunctionSpace&, const dolfin::FunctionSpace&)’:
> /home/david/work/dev/build/fenics-master-2021-02-04/dolfin/dolfin/fem/PETScDMCollection.cpp:596:46:
> error: cannot convert ‘double*’ to ‘const PetscScalar*’ {aka ‘const
> std::complex<double>*’}
>   596 |                         values[fine_row].data(), INSERT_VALUES);
>       |                         ~~~~~~~~~~~~~~~~~~~~~^~
>       |                                              |
>       |                                              double*

Did you configure petsc --with-scalar-type=complex ?
This could explain the error message.

Marco

jesus

unread,
Feb 4, 2021, 5:57:36 PM2/4/21
to fenics-...@googlegroups.com
Dear David.

In order to install Fenics 2019 from source on Arch you will have to install the required dependencies versions. For example, the tested boost version for that Fenics version is the 1.73 (along with a patch that is in the repo). The install will fail with boost 1.75. Also, be aware that the current version of Petsc causes a regression in the solution time (it has something to do with openmpi), so installing Petsc 3.13 is preferred until a fix arrives. But this will imply that mumps, lapack,etc will need to match the petsc version too. So it is better to install and compile all the petsc dependencies from the petsc installer. The only dependencies from Arch repo which don't caused me any problem (for now) are Suitesparse, fftw, openmpi.  Oh, and hdf5 1.12 will cause a compile error in dolfin too, so you need the proper patch for that.

I have successfully installed fenics in Arch but without most of the Aur packages.

Please feel free to contact me if you need help with the PKGBUILD.

Cheers.

David Nolte

unread,
Feb 6, 2021, 11:12:06 AM2/6/21
to fenics-...@googlegroups.com
Marco, Jesus,

thank you for your comments and warnings. This particular error was indeed caused by --with-scalar-type=complex. As Jesus anticipated, other errors came up.
I successfully compiled dolfin following Jesus' advices (PETSc 3.13, Boost 1.73 with patches https://bitbucket.org/fenics-project/dolfin/issues/1116/boost-detail-endianhpp-no-longer-available and https://bitbucket.org/fenics-project/dolfin/issues/1115/compile-error-min_element-is-not-member-of, HDF5 1.12 with patch https://bitbucket.org/fenics-project/dolfin/issues/1110/hdf5interfacecpp-incompatible-with-recent).

I still use a number of system packages for the dependencies. It would be smarter to compile everything from source, such that system updates don't break my dolfin build, but that's fine for the moment. For future reference, here are the semi-automatic build instructions: https://github.com/dajuno/fenics-archlinux-build -- maybe that's of use to someone.

Thanks!
David
--
You received this message because you are subscribed to the Google Groups "fenics-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fenics-suppor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fenics-support/262ebaa14db0abef0594f742cacc20eaaebc3b41.camel%40gmail.com.



Reply all
Reply to author
Forward
0 new messages