diff --git a/opm/simulators/gatherDeferredLogger.cpp b/opm/simulators/gatherDeferredLogger.cpp index 01d1b165e..1f5f46954 100644 --- a/opm/simulators/gatherDeferredLogger.cpp +++ b/opm/simulators/gatherDeferredLogger.cpp @@ -25,6 +25,7 @@ #if HAVE_MPI #include +#include #include #include @@ -38,16 +39,16 @@ namespace MPI_Pack(&messagesize, 1, MPI_UNSIGNED, buf.data(), buf.size(), &offset, MPI_COMM_WORLD); for (const auto lm : local_messages) { - MPI_Pack(&lm.flag, 1, MPI_INT64_T, buf.data(), buf.size(), &offset, MPI_COMM_WORLD); + MPI_Pack(static_cast(const_cast(&lm.flag)), 1, MPI_INT64_T, buf.data(), buf.size(), &offset, MPI_COMM_WORLD); int tagsize = lm.tag.size(); MPI_Pack(&tagsize, 1, MPI_UNSIGNED, buf.data(), buf.size(), &offset, MPI_COMM_WORLD); if (tagsize>0) { - MPI_Pack(lm.tag.c_str(), lm.tag.size(), MPI_CHAR, buf.data(), buf.size(), &offset, MPI_COMM_WORLD); + MPI_Pack(const_cast(lm.tag.c_str()), lm.tag.size(), MPI_CHAR, buf.data(), buf.size(), &offset, MPI_COMM_WORLD); } int textsize = lm.text.size(); MPI_Pack(&textsize, 1, MPI_UNSIGNED, buf.data(), buf.size(), &offset, MPI_COMM_WORLD); if (textsize>0) { - MPI_Pack(lm.text.c_str(), lm.text.size(), MPI_CHAR, buf.data(), buf.size(), &offset, MPI_COMM_WORLD); + MPI_Pack(const_cast(lm.text.c_str()), lm.text.size(), MPI_CHAR, buf.data(), buf.size(), &offset, MPI_COMM_WORLD); } } }