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

Compilation error with BOUT-next #17

Open
mikekryjak opened this issue Aug 28, 2022 · 2 comments
Open

Compilation error with BOUT-next #17

mikekryjak opened this issue Aug 28, 2022 · 2 comments

Comments

@mikekryjak
Copy link
Collaborator

Problem
Compiling with the latest BOUT-next results in the below error:

/ssd_scratch/SD1D/sd1d.cxx: In member function ‘int SD1D::precon(BoutReal, BoutReal, BoutReal)’:
/ssd_scratch/SD1D/sd1d.cxx:1696:24: error: ‘Create’ is not a member of ‘InvertPar’
 1696 |       inv = InvertPar::Create();
      |                        ^~~~~~

This is coming from this section starting on line 1640 in sd1d.cxx:

    static InvertPar *inv = NULL;
    if (!inv) {
      // Initialise parallel inversion class
      inv = InvertPar::Create();
      inv->setCoefA(1.0);
    }

Potential fix
I have had Hasan help me with this in the past and I have this code block in my own version of SD1D which makes it work:

    static std::unique_ptr<InvertPar> inv = nullptr;
    if (!inv) {
      // Initialise parallel inversion class
      inv = InvertPar::create();
      inv->setCoefA(1.0);
    }
@ZedThree
Copy link
Member

Yep, this is the correct fix. The return type of the various factory T::create functions has changed to std::unique_ptr<T>.

Running bin/bout-v5-factory-upgrader.py from BOUT++ on SD1D should apply this fix automatically. There's some other bout-v5-*-upgrader.py scripts that fix other v5 backwards-incompatible changes too.

@bendudson
Copy link
Contributor

These issues should be fixed in PR #18

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

3 participants