[MPICH] Warnings during compilation.
Oliver Fortmeier
fortmeier at sc.rwth-aachen.de
Wed Jan 17 02:41:17 CST 2007
Hello,
of course that trick would supress the warnings in your code, if the code is behind the pragma, so I
include the mpich header in one file with no other code, that is included by all other files, that
uses MPI calls.
e.g.:
File: mympi.h
----------Code----------------------
#pragma GCC system_header
#include <mpi.h>
----------End of Code---------------
File: main_prog.cpp
----------Code----------------------
#include "mympi.h"
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
MPI::Init(argc, argv);
int a=0;
MPI::Finalize();
return 0;
}
----------End of Code---------------
In this example the compiler warns me about the unused variable a. I think this can solve your
problem, if you use the gnu compiler.
Best,
Oliver
Nico Kruithof wrote:
> Yes, that would do the trick, but could also supress warnings in my
> code. I'd rather have that the warnings did not appear in the first
> place.
>
> Bests,
> Nico
>
> On Tue, 2007-01-16 at 13:40 +0100, Oliver Fortmeier wrote:
>> Hello,
>>
>> I am using the c++ frontend from mpich2 1.0.2 too. I surpress the warnings given by the gcc
>> compiler (4.1.1) by including mpi.h like this:
>>
>> #pragma GCC system_header
>> #include <mpi.h>
>>
>> If there is another way to do it (compiler independent), I would be glad to hear about it.
>>
>> I hope I could help you,
>> Oliver
>>
>>
>> Nico Kruithof wrote:
>>> Hello,
>>>
>>> Is there anything I can do to avoid warnings like:
>>> /opt/mpich/include/mpi2c++/pcomm.h:59: warning: 'class PMPI::Comm' has
>>> virtual functions but non-virtual destructor
>>>
>>> which probably means that Comm has a default destructor instead of a
>>> virtual destructor.
>>>
>>> Thanks in advance,
>>> Nico
>>>
>>>
>>>
>
>
>
--
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