Skip to content

Conversation

@mikekryjak
Copy link
Contributor

Fixes #2944

ZedThree and others added 30 commits January 19, 2024 17:03
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Previously used for annotating `printf` like functions, since replaced
with `fmt` formatting
…ng-tidy-happy

Fix a bunch of `clang-tidy` issues in `Options`
We no longer need separate declarations of static/constexpr variables,
as C++17 now handles this better. Note that `static constexpr` members
imply `inline`, while namespace scope `constexpr` implies `static` but
not `inline`
Adds some `override` keywords

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…sed-macro

Replace `MAYBE_UNUSED` macro with C++17 `[[maybe_unused]]`
This reverts commit 7e0ccad.

This is still required for static linking
The only use of this class (the `Options::values` view, returning a
newly constructed `std::map<std::string, OptionValue>`) was removed a
few years ago, so this is no longer needed
…lue-nested-class

Remove `Options::OptionValue` nested class
…riables

Use C++17 `inline` variables to remove some linker hacks
If the size of the array matches the global array, read the
piece of the array that is used on the local processor.
Potentially ambiguous, as it uses the size of the global array
to determine whether it is a Field2D or FieldPerp.
…-cuda

Update CUDA standard to cxx17, add CI build test
bendudson and others added 23 commits June 26, 2024 13:00
I think this is probably already the case, but this ensures
that the nonlinear RHS is called first to evaluate all coefficients.
…er_options

Add CVODE mxorder option back, now deprecated
fmt v11 preserves and enforces the constness of the formatted argument.
without this change, the tree fails to build with fmt v11, like:

```
In file included from /usr/include/fmt/format.h:41,
                 from /usr/include/fmt/core.h:5,
                 from /builddir/build/BUILD/bout++-5.1.0-build/BOUT++-v5.1.0/include/bout/sys/expressionparser.hxx:33:
/usr/include/fmt/base.h: In instantiation of ‘static void fmt::v11::detail::value<Context>::format_custom_arg(void*, typename Context::parse_context_type&, Context&) [with T = Options; Formatter = fmt::v11::formatter<Options>; Context = fmt::v11::context; typename Context::parse_context_type = fmt::v11::basic_format_parse_context<char>]’:
/usr/include/fmt/base.h:1373:19:   required from ‘fmt::v11::detail::value<Context>::value(T&) [with T = Options; Context = fmt::v11::context]’
 1373 |     custom.format = format_custom_arg<
      |     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
 1374 |         value_type, typename Context::template formatter_type<value_type>>;
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/fmt/base.h:1631:41:   required from ‘constexpr fmt::v11::detail::value<Context> fmt::v11::detail::make_arg(T&) [with bool PACKED = true; Context = fmt::v11::context; T = Options; typename std::enable_if<PACKED, int>::type <anonymous> = 0]’
 1631 |   return {arg_mapper<Context>().map(val)};
      |                                         ^
/usr/include/fmt/base.h:2002:74:   required from ‘constexpr fmt::v11::detail::format_arg_store<Context, NUM_ARGS, 0, DESC> fmt::v11::make_format_args(T& ...) [with Context = context; T = {Options}; long unsigned int NUM_ARGS = 1; long unsigned int NUM_NAMED_ARGS = 0; long long unsigned int DESC = 15; typename std::enable_if<(NUM_NAMED_ARGS == 0), int>::type <anonymous> = 0]’
 2002 |   return {{detail::make_arg<NUM_ARGS <= detail::max_packed_args, Context>(
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
 2003 |       args)...}};
      |       ~~~~~
/usr/include/fmt/format.h:4357:44:   required from ‘std::string fmt::v11::format(format_string<T ...>, T&& ...) [with T = {Options&}; std::string = std::__cxx11::basic_string<char>; format_string<T ...> = basic_format_string<char, Options&>]’
 4357 |   return vformat(fmt, fmt::make_format_args(args...));
      |                       ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
/builddir/build/BUILD/bout++-5.1.0-build/BOUT++-v5.1.0/src/bout++.cxx:333:27:   required from ‘void bout::experimental::printTypeOptions(const std::string&) [with Factory = SolverFactory; std::string = std::__cxx11::basic_string<char>]’
  333 |   std::cout << fmt::format("{:id}\n", help_options);
      |                ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/bout++-5.1.0-build/BOUT++-v5.1.0/src/bout++.cxx:355:30:   required from ‘void bout::experimental::handleFactoryHelp(const std::string&, int, int, char**, bool) [with Factory = SolverFactory; std::string = std::__cxx11::basic_string<char>]’
  355 |     printTypeOptions<Factory>(argv[i + 1]);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/builddir/build/BUILD/bout++-5.1.0-build/BOUT++-v5.1.0/src/bout++.cxx:417:37:   required from here
  417 |     handleFactoryHelp<SolverFactory>(current_arg, i, argc, argv);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/fmt/base.h:1392:29: error: passing ‘const fmt::v11::formatter<Options>’ as ‘this’ argument discards qualifiers [-fpermissive]
```

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
fmt::join() overloads was moved into fmt/ranges.h since fmt v11,
so let's include fmt/ranges.h as well.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
Co-authored-by: Steven Roberts <sroberts994@gmail.com>
Co-authored-by: Steven Roberts <sroberts994@gmail.com>
Co-authored-by: Steven Roberts <sroberts994@gmail.com>
Co-authored-by: Steven Roberts <sroberts994@gmail.com>
- treatment is now an enum, rather than a string. Allowed values are
  "imex", "explicit" or "implicit"  (Lower case in input).

- The conversion from string to enum now lists the valid values when
  a string isn't recognised e.g:

```
	Option solver:treatment = Implicit (Command line)
Error encountered: Did not find enum Implicit. Valid values:  explicit imex implicitStacktrace not enabled.
====== Back trace ======
 -> Treatment TreatmentFromString(const std::string &) on line 66 of '/Users/dudson2/code/BOUT-dev/src/solver/impls/arkode/arkode.hxx'

====== Exception thrown ======
Did not find enum Implicit. Valid values:  explicit imex implicit
```

- The separate "imex", "implicit" and "explicit" booleans have been
  removed, all controlled by "treatment" now.
Inputs are now "pid", "pi", "i", etc. rather than 0 .. 5.
If an invalid value is used then the valid choices are printed.
Fix typos in laplacian inversion documentation (credit @MigMadeira)
Prevously this would result in the error "Unknown CMake command "check_c_source_compiles" when compiling Hermes-3
@mikekryjak mikekryjak changed the title Fix compilation error Fix compilation error due to check_c_source_runs Aug 28, 2024
@ZedThree
Copy link
Member

Thanks @mikekryjak ! Please could you rebase this onto 5.1.1-rc?

@mikekryjak mikekryjak changed the base branch from next to v5.1.1-rc August 29, 2024 10:03
@bendudson
Copy link
Contributor

Replaced by #2970

@bendudson bendudson closed this Sep 6, 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

Successfully merging this pull request may close these issues.

9 participants