Hi,
i have written a huge C++/mpi program that i use for work. Which I had no problem using and compiling until some days ago as i did a distribution upgrade on my openSUSE tumbleweed system.
Iit seems that this also updated my gcc compiler from gcc-5 to gcc-6.
My program has a mode for single processing (compiled with g++) and one for multi processing (compiled with mpicxx).
Since the update i get some weird errors like this when i try to compile:
class_index.cpp: In member function ‘short int IndexRestrictionHandler::add(IndexRestriction*, short int, Summation*)’:
class_index.cpp:631:118: error: no match for ‘operator<<’ (operand types are ‘std::basic_ostream<char>’ and ‘std::ostream {aka std::basic_ostream<char>}’)
eption: IndexRestrictionHandler::add(IndexRestriction*, short, Summation *)" << std::cout;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/6/iostream:39:0,
from class_index.cpp:1:
/usr/include/c++/6/ostream:628:5: note: candidate: std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = std::basic_ostream<char>] <near match>
operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x)
or such errors
class_summation.cpp: In constructor ‘Summation::Summation(char*)’:
class_summation.cpp:51:5: error: this ‘else’ clause does not guard... -Werror=misleading-indentation]
else
^~~~
class_summation.cpp:54:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘else’
for (i=0; i<this->usedindicies; i++) {
I do not know whats wrong here, i hope it is just a bug in the compiler and it gets fixed soon. But i noticed that when i force the old gcc compiler like this:
make CC=g++-5
there is not error anymore.
But the problem is, that does not work for the multi processing version, i tried this:
make CC=mpicxx-5 mpi
but it just says that the compiler is not found.
I know that mpicxx is just a wrapper around g++ but, i am no expert and i just what to get this work but i have no glue.
Idealy there would be a solution to the g+±6 errors but if i can switch the compilers for now, i would be fine.