Can you confirm that you have compiled with C++ support? If you run
'laminfo' you should see the line:
C++ bindings: yes
Also make sure you included <mpi.h> in the header. Something like the
following should get rid of the warnings at least:
----------------------
#include <iostream>
#include <fstream>
#include <iomanip>
#include <mpi.h>
using namespace std;
int main() { ... }
------------------
Let me know if that helps any,
Josh
On Mar 29, 2005, at 6:50 PM, Kumar, Ravi Ranjan wrote:
> Hi,
>
> Thank you for your reply!
>
> I tried all the file names but none of them worked. Still getting the
> same
> error messages.
>
> Ravi R. Kumar
>
>
>
>
> Quoting Josh Hursey <jjhursey_at_[hidden]>:
>
>> Since you are trying to compile a C++ program, you will want to change
>> your filename from:
>> 9NonBlocking_Dynamic_SOR_MPI.c
>>
>> to something like one of the following three:
>> 9NonBlocking_Dynamic_SOR_MPI.cpp
>> 9NonBlocking_Dynamic_SOR_MPI.cc
>> 9NonBlocking_Dynamic_SOR_MPI.C
>>
>> This should ensure that mpiCC doesn't mistake your program for a
>> standard C program, which is what it seems to be doing below.
>>
>> Give that a try and see if the problems persist.
>>
>> Josh
>>
>> On Mar 28, 2005, at 4:31 PM, Kumar, Ravi Ranjan wrote:
>>
>>> Hello,
>>>
>>> My C++/MPI code compiles and runs well in one machine but gives some
>>> error
>>> messages on another machine. Below are the messages I get:
>>>
>>>
>>>
>>> sdx0 35: mpiCC -o foo 9NonBlocking_Dynamic_SOR_MPI.c
>>> Warning 890: "/opt/aCC/include_std/iostream_compat/iostream.h", line
>>> 4
>>> #
>>> #warning <iostream.h> is being replaced by
>>> <iostream> followed by "using namespace std;"
>>> #warning <iostream.h> is being replaced by <iostream> followed by
>>> "using
>>> namespace std;"
>>>
>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>> ^^
>>> ^^^^^^^^^
>>> ^^^^^^^
>>> Warning 890: "/opt/aCC/include_std/iostream_compat/fstream.h", line
>>> 4 #
>>> #warning <fstream.h> is being replaced by <iostream>
>>> and <fstream> followed by "using namespace std;"
>>> #warning <fstream.h> is being replaced by <iostream> and
>>> <fstream>
>>> followed
>>> by "using namespa
>>>
>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>> ^^
>>> ^^^^^^^^^
>>> ^^^^^^^^^^^^
>>> Warning 890: "/opt/aCC/include_std/iostream_compat/iomanip.h", line
>>> 4 #
>>> #warning <iomanip.h> is being replaced by <iomanip>
>>> followed by "using namespace std;"
>>> #warning <iomanip.h> is being replaced by <iomanip> followed by
>>> "using
>>> namespace std;"
>>>
>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>> ^^
>>> ^^^^^^^^^
>>> ^^^^^
>>> Error 24: "9NonBlocking_Dynamic_SOR_MPI.c", line 384 # ':' expected
>>> instead
>>> of '::'.
>>> MPI::Init(argc, argv);
>>> ^^
>>> Error 20: "9NonBlocking_Dynamic_SOR_MPI.c", line 385 # ';' expected
>>> before '::'.
>>> num_processes = MPI::COMM_WORLD.Get_size();
>>> ^^
>>> Error 328: "9NonBlocking_Dynamic_SOR_MPI.c", line 384 # Function
>>> 'Init' has not
>>> been defined yet; cannot call.
>>> MPI::Init(argc, argv);
>>> ^^^^
>>> Error 20: "9NonBlocking_Dynamic_SOR_MPI.c", line 386 # ';' expected
>>> before '::'.
>>> rank = MPI::COMM_WORLD.Get_rank();
>>> ^^
>>> Error 172: "9NonBlocking_Dynamic_SOR_MPI.c", line 385 # Undeclared
>>> variable 'MPI'.
>>> num_processes = MPI::COMM_WORLD.Get_size();
>>> ^^^
>>> Error 172: "9NonBlocking_Dynamic_SOR_MPI.c", line 385 # Undeclared
>>> variable 'COMM_WORLD'.
>>> num_processes = MPI::COMM_WORLD.Get_size();
>>> ^^^^^^^^^^
>>> Error 172: "9NonBlocking_Dynamic_SOR_MPI.c", line 386 # Undeclared
>>> variable 'MPI'.
>>> rank = MPI::COMM_WORLD.Get_rank();
>>> ^^^
>>> Error 172: "9NonBlocking_Dynamic_SOR_MPI.c", line 386 # Undeclared
>>> variable 'COMM_WORLD'.
>>> rank = MPI::COMM_WORLD.Get_rank();
>>> ^^^^^^^^^^
>>> Warning 612: "9NonBlocking_Dynamic_SOR_MPI.c", line 384 # Label 'MPI'
>>> has no
>>> uses.
>>> MPI::Init(argc, argv);
>>> ^^^^^
>>>
>>>
>>> What I need to do to fix this problem. Pls help me.
>>>
>>> Thanks a lot!
>>>
>>> Ravi R. Kumar
>>>
>>>
>>>
>>> _______________________________________________
>>> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>>>
>> ----
>> Josh Hursey
>> jjhursey_at_[hidden]
>> http://www.lam-mpi.org/
>>
>> _______________________________________________
>> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>>
>
> _______________________________________________
> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>
----
Josh Hursey
jjhursey_at_[hidden]
http://www.lam-mpi.org/
|