Allow ACTIONX keywords with empty conditions, these ACTIONX keywords will always
evaluate to false. Main motivation is to facilitate dummy keywords for PYACTION.
If cmake is run with `-DOPM_ENABLE_EMBEDDED_PYTHON=ON -DOPM_ENABLE_PYTHON=OFF`
a cmake error was produced because the library would depend on
python/cxx/builtin_pybind11.cpp which would not be generated.
We fix this by doing the Python sanity check (deactivate embedded
python if python is disabled) before running source_hook that adds the
dependency.
Closes#2940
It is used verbatim in setup.py in the list that specifies the linker
flage. Hence it needs to comma separted instead of using a semicolon
as separator.
We also rename it to SETUP_PY_LINKAGE to indicate where it is used.
Closes#2947
The run() function invoked by PYACTION has got a new fifth argument which is a
callable the script should utilize to apply the keywords from an ACTIONX
keyword. The callable is implemented as C++ lambda which will run the
Schedule::iterateScheduleSection() method and make sure an updated
SimulatorUpdate variable can be passed back to the simulator.
This is needed for libfmt >= 8.1.0 as in that version the
cast to int was removed from inside the fmt::format call and an
assertion will fail:
```
In file included from /usr/include/fmt/format.h:48,
from /build/opm-common-2021.10/src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.cpp:22:
/usr/include/fmt/core.h: In instantiation of 'constexpr fmt::v8::detail::value<Context> fmt::v8::detail::make_arg(T&&) [with bool IS_PACKED = true; Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; fmt::v8::detail::type <anonymous> = fmt::v8::detail::type::custom_type; T = Opm::UDQVarType&; typename std::enable_if<IS_PACKED, int>::type <anonymous> = 0]':
/usr/include/fmt/core.h:1855:77: required from 'constexpr fmt::v8::format_arg_store<Context, Args>::format_arg_store(T&& ...) [with T = {const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int&, Opm::UDQVarType&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int&, Opm::UDQVarType&}; Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; Args = {std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long unsigned int, Opm::UDQVarType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long unsigned int, Opm::UDQVarType}]'
/usr/include/fmt/core.h:1872:38: required from 'constexpr fmt::v8::format_arg_store<Context, typename std::remove_cv<typename std::remove_reference<Args>::type>::type ...> fmt::v8::make_format_args(Args&& ...) [with Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; Args = {const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int&, Opm::UDQVarType&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int&, Opm::UDQVarType&}]'
/usr/include/fmt/core.h:3119:44: required from 'std::string fmt::v8::format(fmt::v8::format_string<T ...>, T&& ...) [with T = {const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int, Opm::UDQVarType, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int, Opm::UDQVarType}; std::string = std::__cxx11::basic_string<char>; fmt::v8::format_string<T ...> = fmt::v8::basic_format_string<char, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int, Opm::UDQVarType, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int, Opm::UDQVarType>]'
/build/opm-common-2021.10/src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.cpp:523:27: required from here
/usr/include/fmt/core.h:1728:7: error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt
1728 | formattable,
| ^~~~~~~~~~~
/usr/include/fmt/core.h:1728:7: note: 'formattable' evaluates to false
```
Otherwise, the equality operators for a default-constructed
TableManager object, mostly used in unit tests, will depend on
uninitialised values.
Thanks to [at]akva2 for the initial clue to the underlying cause.
This commit adds new nodes pertaining to the inter-region flows to
the summary configuration keyword list. We combine the pair of
region IDs into a single 'NUMS' value as part of creating the node.
We also split inter-region nodes into a "supported" and an
"unsupported" set, with the former containing the oil, gas, and
water keywords.
While here, also correct a misprint in a diagnostic message which I
noticed as part of developing the new feature.
This commit introduces new helper functions
int EclIO::combineSummaryNumbers(int, int)
tuple<int, int> EclIO::splitSummaryNumber(int)
that know about the relation
combined = n1 + 32768*(n2 + 10)
This relation is typically used to combine one-based region IDs for
inter-region flows into a single 'NUMS' entry in the summary file.