FW: [MPICH] Error compiling c++ programs with mpiCC

Rajeev Thakur thakur at mcs.anl.gov
Mon Jun 18 11:07:22 CDT 2007


 

-----Original Message-----
From: Oliver Fortmeier [mailto:fortmeier at sc.rwth-aachen.de] 
Sent: Monday, June 18, 2007 11:04 AM
To: owner-mpich-discuss at mcs.anl.gov
Subject: Re: [MPICH] Error compiling c++ programs with mpiCC

Hi,

I had the same problem, when I compiled the mpi header file with high 
warning status (-W -Wall -pedantic).

If you are using the gcc Compiler (as it looks like), you can create 
your own mpi-headerfile:

----
file: mpi.h
--

#pragma GCC system_header  // Suppress warnings from mpi.h
#include <mpi.h>

--

If you include this file with the gcc-Compiler, all warnings are 
suppressed and the errors do not occur any more.


Best,
Oliver


Anna Mereu wrote:
> Hi, i'm trying to compile c++ program including mpi++.h files with the
> mpiCC complier. The errors are the following:
> 
> /usr/local/mpich-g2-cpp/include/mpi2c++/comm.h:106: warning: 'class 
> MPI::Comm' has virtual functions but non-virtual destructor
> /usr/local/mpich-g2-cpp/include/mpi2c++/intracomm.h:30: warning: 'class 
> MPI::Intracomm' has virtual functions but non-virtual destructor
> /usr/local/mpich-g2-cpp/include/mpi2c++/topology.h:31: warning: 'class 
> MPI::Cartcomm' has virtual functions but non-virtual destructor
> /usr/local/mpich-g2-cpp/include/mpi2c++/topology.h:112: warning: 'class 
> MPI::Graphcomm' has virtual functions but non-virtual destructor
> /usr/local/mpich-g2-cpp/include/mpi2c++/intercomm.h:31: warning: 'class 
> MPI::Intercomm' has virtual functions but non-virtual destructor
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/stl_alg
obase.h: 
> In function 'MPI2CPP_BOOL_T std::lexicographical_compare(const unsigned 
> char*, const unsigned char*, const unsigned char*, const unsigned char*)':
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/stl_alg
obase.h:887: 
> error: cannot convert 'bool' to 'MPI2CPP_BOOL_T' in return
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/char_tr
aits.h: 
> In static member function 'static MPI2CPP_BOOL_T 
> std::char_traits<char>::eq(const char&, const char&)':
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/char_tr
aits.h:245: 
> error: cannot convert 'bool' to 'MPI2CPP_BOOL_T' in return
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/char_tr
aits.h: 
> In static member function 'static MPI2CPP_BOOL_T 
> std::char_traits<char>::lt(const char&, const char&)':
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/char_tr
aits.h:249: 
> error: cannot convert 'bool' to 'MPI2CPP_BOOL_T' in return
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/char_tr
aits.h: 
> In static member function 'static MPI2CPP_BOOL_T 
> std::char_traits<char>::eq_int_type(const int&, const int&)':
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/char_tr
aits.h:287: 
> error: cannot convert 'bool' to 'MPI2CPP_BOOL_T' in return
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/char_tr
aits.h: 
> In static member function 'static MPI2CPP_BOOL_T 
> std::char_traits<wchar_t>::eq(const wchar_t&, const wchar_t&)':
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/char_tr
aits.h:315: 
> error: cannot convert 'bool' to 'MPI2CPP_BOOL_T' in return
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/char_tr
aits.h: 
> In static member function 'static MPI2CPP_BOOL_T 
> std::char_traits<wchar_t>::lt(const wchar_t&, const wchar_t&)':
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/char_tr
aits.h:319: 
> error: cannot convert 'bool' to 'MPI2CPP_BOOL_T' in return
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/char_tr
aits.h: 
> In static member function 'static MPI2CPP_BOOL_T 
> std::char_traits<wchar_t>::eq_int_type(const wint_t&, const wint_t&)':
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/char_tr
aits.h:353: 
> error: cannot convert 'bool' to 'MPI2CPP_BOOL_T' in return
> /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/limits: 
> At global scope:
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/limits:380: 
> error: cannot convert 'bool' to 'const MPI2CPP_BOOL_T' in initialization
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/limits:533: 
> error: cannot convert 'bool' to 'const MPI2CPP_BOOL_T' in initialization
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/limits:1006:

> error: invalid conversion from 'int' to 'MPI2CPP_BOOL_T'
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/limits:1007:

> error: invalid conversion from 'int' to 'MPI2CPP_BOOL_T'
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/limits:1023:

> error: cannot convert 'bool' to 'const MPI2CPP_BOOL_T' in initialization
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/limits:1063:

> error: invalid conversion from 'int' to 'MPI2CPP_BOOL_T'
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/limits:1064:

> error: invalid conversion from 'int' to 'MPI2CPP_BOOL_T'
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/limits:1080:

> error: cannot convert 'bool' to 'const MPI2CPP_BOOL_T' in initialization
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/limits:1120:

> error: invalid conversion from 'int' to 'MPI2CPP_BOOL_T'
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/limits:1121:

> error: invalid conversion from 'int' to 'MPI2CPP_BOOL_T'
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/limits:1138:

> error: cannot convert 'bool' to 'const MPI2CPP_BOOL_T' in initialization
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/locale_
classes.h: 
> In member function 'MPI2CPP_BOOL_T std::locale::operator!=(const 
> std::locale&) const':
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/locale_
classes.h:242: 
> error: cannot convert 'bool' to 'MPI2CPP_BOOL_T' in return
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/locale_
classes.h: 
> In member function 'MPI2CPP_BOOL_T 
> std::locale::_Impl::_M_check_same_name()':
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/locale_
classes.h:540: 
> error: cannot convert 'bool' to 'MPI2CPP_BOOL_T' in assignment
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/i486-linux-g
nu/bits/ctype_inline.h: 
> In member function 'MPI2CPP_BOOL_T std::ctype<char>::is(short unsigned 
> int, char) const':
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/i486-linux-g
nu/bits/ctype_inline.h:40: 
> error: invalid conversion from 'int' to 'MPI2CPP_BOOL_T'
> /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/typeinfo: 
> In member function 'MPI2CPP_BOOL_T std::type_info::before(const 
> std::type_info&) const':
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/typeinfo:106
: 
> error: cannot convert 'bool' to 'MPI2CPP_BOOL_T' in return
> /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/typeinfo: 
> In member function 'MPI2CPP_BOOL_T std::type_info::operator==(const 
> std::type_info&) const':
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/typeinfo:108
: 
> error: cannot convert 'bool' to 'MPI2CPP_BOOL_T' in return
> /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/typeinfo: 
> In member function 'MPI2CPP_BOOL_T std::type_info::operator!=(const 
> std::type_info&) const':
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/typeinfo:111
: 
> error: cannot convert 'bool' to 'MPI2CPP_BOOL_T' in return
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/locale_
facets.tcc: 
> In function 'MPI2CPP_BOOL_T std::__verify_grouping(const char*, size_t, 
> const std::string&)':
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/locale_
facets.tcc:2473: 
> error: cannot convert 'bool' to 'MPI2CPP_BOOL_T' in assignment
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/locale_
facets.tcc:2475: 
> error: cannot convert 'bool' to 'MPI2CPP_BOOL_T' in assignment
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/locale_
facets.tcc:2480: 
> error: invalid conversion from 'int' to 'MPI2CPP_BOOL_T'
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/stl_alg
obase.h: 
> In function 'MPI2CPP_BOOL_T 
> std::lexicographical_compare(_InputIterator1, _InputIterator1, 
> _InputIterator2, _InputIterator2) [with _InputIterator1 = const signed 
> char*, _InputIterator2 = const signed char*]':
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/stl_alg
obase.h:901: 
> instantiated from here
>
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/stl_alg
obase.h:835: 
> error: cannot convert 'bool' to 'MPI2CPP_BOOL_T' in return
> make: *** [confronto.o] Error 1
> 
> How can i fix them??
> 
> Thank you very much for the help
> 
> Anna

-- 
  Oliver Fortmeier                      fortmeier at sc.rwth-aachen.de
  Institute for Scientific Computing    phone: +49 241 80 24918
  RWTH Aachen University                fax:   +49 241 80 6 24918





More information about the mpich-discuss mailing list