dolfin and PETSc/SLEPc scalar complex compilation issue

Asked by Giacomo Guarnieri

Trying to compile dolfin from source the execution stops on SLEPc or PETSc

giacomo@elrond:~/opt/fenics/dolfin-1.2.0/build$ make
....
[ 58%] Building CXX object dolfin/CMakeFiles/dolfin.dir/la/LinearSolver.cpp.o
[ 59%] Building CXX object dolfin/CMakeFiles/dolfin.dir/la/TensorProductMatrix.cpp.o
[ 59%] Building CXX object dolfin/CMakeFiles/dolfin.dir/la/SLEPcEigenSolver.cpp.o
/home/giacomo/opt/fenics/dolfin-1.2.0/dolfin/la/SLEPcEigenSolver.cpp: In member function ‘void dolfin::SLEPcEigenSolver::get_eigenvalue(double&, double&, std::size_t) const’:
/home/giacomo/opt/fenics/dolfin-1.2.0/dolfin/la/SLEPcEigenSolver.cpp:201:39: error: cannot convert ‘double*’ to ‘PetscScalar* {aka std::complex<double>*}’ for argument ‘3’ to ‘PetscErrorCode EPSGetEigenvalue(EPS, PetscInt, PetscScalar*, PetscScalar*)’
/home/giacomo/opt/fenics/dolfin-1.2.0/dolfin/la/SLEPcEigenSolver.cpp: In member function ‘void dolfin::SLEPcEigenSolver::get_eigenpair(double&, double&, dolfin::PETScVector&, dolfin::PETScVector&, std::size_t) const’:
/home/giacomo/opt/fenics/dolfin-1.2.0/dolfin/la/SLEPcEigenSolver.cpp:237:58: error: cannot convert ‘double*’ to ‘PetscScalar* {aka std::complex<double>*}’ for argument ‘3’ to ‘PetscErrorCode EPSGetEigenpair(EPS, PetscInt, PetscScalar*, PetscScalar*, Vec, Vec)’
/home/giacomo/opt/fenics/dolfin-1.2.0/dolfin/la/SLEPcEigenSolver.cpp: In member function ‘void dolfin::SLEPcEigenSolver::set_spectrum(std::string)’:
/home/giacomo/opt/fenics/dolfin-1.2.0/dolfin/la/SLEPcEigenSolver.cpp:337:51: error: could not convert ‘((dolfin::SLEPcEigenSolver*)this)->dolfin::SLEPcEigenSolver::<anonymous>.dolfin::Variable::parameters.dolfin::Parameters::operator[](std::basic_string<char>(((const char*)"spectral_shift"), (*(const std::allocator<char>*)(& std::allocator<char>()))))’ from ‘dolfin::Parameter’ to ‘PetscScalar {aka std::complex<double>}’
/home/giacomo/opt/fenics/dolfin-1.2.0/dolfin/la/SLEPcEigenSolver.cpp:342:51: error: could not convert ‘((dolfin::SLEPcEigenSolver*)this)->dolfin::SLEPcEigenSolver::<anonymous>.dolfin::Variable::parameters.dolfin::Parameters::operator[](std::basic_string<char>(((const char*)"spectral_shift"), (*(const std::allocator<char>*)(& std::allocator<char>()))))’ from ‘dolfin::Parameter’ to ‘PetscScalar {aka std::complex<double>}’
/home/giacomo/opt/fenics/dolfin-1.2.0/dolfin/la/SLEPcEigenSolver.cpp:347:51: error: could not convert ‘((dolfin::SLEPcEigenSolver*)this)->dolfin::SLEPcEigenSolver::<anonymous>.dolfin::Variable::parameters.dolfin::Parameters::operator[](std::basic_string<char>(((const char*)"spectral_shift"), (*(const std::allocator<char>*)(& std::allocator<char>()))))’ from ‘dolfin::Parameter’ to ‘PetscScalar {aka std::complex<double>}’
make[2]: *** [dolfin/CMakeFiles/dolfin.dir/la/SLEPcEigenSolver.cpp.o] Error 1
make[1]: *** [dolfin/CMakeFiles/dolfin.dir/all] Error 2
make: *** [all] Error 2

Many Thanks for answers.
Giacomo

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Johannes Ring (johannr) said :
#1

FEniCS no longer uses Launchpad for Questions & Answers. Please consult the documentation on the FEniCS web page for where and how to (re)post your question: http://fenicsproject.org/support/

Can you help with this problem?

Provide an answer of your own, or ask Giacomo Guarnieri for more information if necessary.

To post a message you must log in.