Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Symbol MPI_COMM_WORLD could not be resolved
Symbol MPI_COMM_WORLD could not be resolved [message #1744256] Fri, 23 September 2016 16:03 Go to next message
Andrey Solovjev is currently offline Andrey SolovjevFriend
Messages: 8
Registered: December 2014
Location: Moscow
Junior Member
I used MPI functions in my program and everything is ok but the MPI symbol MPI_COMM_WORLD that is marked as error with the hint text:

"Symbol MPI_COMM_WORLD could not be resolved".

For example in code
CheckMPI(MPI_Reduce(&partVol, &totVol, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD));

only MPI_COMM_WORLD is unresolved. MPI_DOUBLE and MPI_SUM are defined in the same file but eclipse has no problem with them. I have path to /usr/include/mpich2 in Project properties -> C/C++ General -> Paths and Symbols -> Includes. In the parser log I have
Project:               N-4.3
File:                  file:/home/zux/C/N-4.3/src/TestGeom.cc
Language:              GNU C++
Index Version:         163.0
Build Configuration:   D SC1
Context:               none
Versions in Index:     1
   C++: {NDEBUG=null,_ASSERT_H=null,_ASSERT_H_DECLS=null,_GLIBCXX_CMATH=null,_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC=null,__GNUC_MINOR__=6,__GNUC__=4,__GXX_EXPERIMENTAL_CXX0X__=null,__cplusplus=*}; 0 macros, 12 includes, 286 names;

Include Search Path (option -I):
   /usr/include/c++/4.6
   /usr/include/c++/4.6/x86_64-linux-gnu
   /usr/include/c++/4.6/backward
   /usr/lib/gcc/x86_64-linux-gnu/4.6/include
   /usr/local/include
   /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed
   /usr/include/x86_64-linux-gnu
   /usr/include
   /usr/include/mpich2
   /home/zux/moab/build/include
   /home/zux/C/N-4.3/include

Macro definitions (option -D):
...

Macro definitions (from language + headers in index):
...
   MPI_COMM_SELF=((MPI_Comm)0x44000001)
   MPI_COMM_WORLD=((MPI_Comm)0x44000000)
   MPI_COMPLEX16=((MPI_Datatype)0x4c00102a)
...

Unresolved names:
   Attempt to use symbol failed: CheckMPI in file /home/zux/C/N-4.3/src/TestGeom.cc:109
   Attempt to use symbol failed: MPI_Reduce in file /home/zux/C/N-4.3/src/TestGeom.cc:109
   Attempt to use symbol failed: MPI_COMM_WORLD in file /home/zux/C/N-4.3/src/TestGeom.cc:109
   Attempt to use symbol failed: CheckMPI in file /home/zux/C/N-4.3/src/TestGeom.cc:118
   Attempt to use symbol failed: MPI_Reduce in file /home/zux/C/N-4.3/src/TestGeom.cc:118
   Attempt to use symbol failed: MPI_COMM_WORLD in file /home/zux/C/N-4.3/src/TestGeom.cc:118

Of cause errors with CheckMPI and MPI_reduce are result of the MPI_COMM_WORLD.

You see that MPI_COMM_WORLD is visible for index builder. More, I can jump into /usr/include/mpich2/mpi.h to the correct line after Ctrl+Click on the symbol MPI_COMM_WORLD marked as unresolved. I did refresh and rebuild index. I have line
#include <mpi.h>
in the very beginning of the file. Compilation with gcc 4.6.4 is ok. What else can I do to solve this problem?

Ubuntu 12.04, Eclipse Kepler.
Re: Symbol MPI_COMM_WORLD could not be resolved [message #1744993 is a reply to message #1744256] Mon, 03 October 2016 21:26 Go to previous message
Kuro Burki is currently offline Kuro BurkiFriend
Messages: 3
Registered: October 2016
Junior Member
1. Is the include path correct for mpi.h?
2. Is it possible MPI_COMM_WORLD is defined in a different file and you have to include the other file as well?
3. Can you compile the program from commandline?
4. Also possible that a pre-compiler flag might have disabled section of header files. Ex: #ifdef WIN32 .... #endif etc.
Previous Topic:Make error1, Arduino Plugin
Next Topic:CDT Mars - Make target warning - Invalid Project Path
Goto Forum:
  


Current Time: Wed Jan 19 09:54:48 GMT 2022

Powered by FUDForum. Page generated in 0.02348 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top