Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master cannot be compiled with DUNE 2.7 and g++-11 #5595

Open
blattms opened this issue Sep 10, 2024 · 2 comments
Open

Master cannot be compiled with DUNE 2.7 and g++-11 #5595

blattms opened this issue Sep 10, 2024 · 2 comments

Comments

@blattms
Copy link
Member

blattms commented Sep 10, 2024

/home/mblatt/src/dune-2.7/opm-simulators/opm/simulators/linalg/FlexibleSolver2.cpp:24:1:   required from here
/home/mblatt/src/dune-2.7/opm-simulators/opm/simulators/linalg/FlexibleSolver_impl.hpp:202:24: error: no match for ‘operator=’ (operand types are ‘std::shared_ptr<Dune::InverseOperator<Dune::BlockVector<Dune::FieldVector<double, 2>, std::allocator<Dune::FieldVector<double, 2> > >, Dune::BlockVector<Dune::FieldVector<double, 2>, std::allocator<Dune::FieldVector<double, 2> > > > >’ and ‘std::shared_ptr<Dune::UMFPack<Dune::BCRSMatrix<Opm::MatrixBlock<double, 2, 2>, std::allocator<Opm::MatrixBlock<double, 2, 2> > > > >’)
  202 |             linsolver_ = std::make_shared<Dune::UMFPack<MatrixType>>(linearoperator_for_solver_->getmat(), verbosity, false);
      |             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/memory:77,
                 from /home/mblatt/src/dune-2.7/opm-common/opm/common/OpmLog/OpmLog.hpp:23,
                 from /home/mblatt/src/dune-2.7/opm-common/opm/common/ErrorMacros.hpp:24,
                 from /home/mblatt/src/dune-2.7/opm-simulators/opm/simulators/linalg/FlexibleSolver_impl.hpp:24,
                 from /home/mblatt/src/dune-2.7/opm-simulators/opm/simulators/linalg/FlexibleSolver2.cpp:22:
/usr/include/c++/11/bits/shared_ptr.h:363:9: note: candidate: ‘template<class _Yp> std::shared_ptr<_Tp>::_Assignable<const std::shared_ptr<_Yp>&> std::shared_ptr<_Tp>::operator=(const std::shared_ptr<_Yp>&) [with _Yp = _Yp; _Tp = Dune::InverseOperator<Dune::BlockVector<Dune::FieldVector<double, 2>, std::allocator<Dune::FieldVector<double, 2> > >, Dune::BlockVector<Dune::FieldVector<double, 2>, std::allocator<Dune::FieldVector<double, 2> > > >]’
  363 |         operator=(const shared_ptr<_Yp>& __r) noexcept
      |         ^~~~~~~~

This must have something to do with dune version. It works with 2.9.
The conversion was introduced in #5002

@blattms blattms changed the title Master cannot be compiled with DUNE 2.7 and C+=-11 Master cannot be compiled with DUNE 2.7 and C++-11 Sep 10, 2024
@bska
Copy link
Member

bska commented Sep 10, 2024

The Dune version issue may be worth tracking down. For what it's worth, I had a local build against the Dune 2.7.1 release until we merged OPM/opm-common#4157. I don't understand why you mention C++11, however. We've explicitly depended on a C++17 compatible compiler since at least PR OPM/opm-common#2924, and we liberally use C++17 features such as std::filesystem, map<>::insert_or_assign() and std::from_chars(). Am I missing something?

@blattms blattms changed the title Master cannot be compiled with DUNE 2.7 and C++-11 Master cannot be compiled with DUNE 2.7 and g++-11 Oct 2, 2024
@blattms
Copy link
Member Author

blattms commented Oct 2, 2024

Sorry. I meant g++-11 (Ubuntu 22.04).
BTW: OPM/opm-common#4157 only has an effect if you use dunecontrol.
I have upcoming PRs fixing this.

@blattms blattms added this to the Release 2024.10 milestone Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants