Code completion for openmpi - const classes in separate file

CodeLite installation/troubleshooting forum
User avatar
Nosferax
CodeLite Enthusiast
Posts: 20
Joined: Fri Feb 05, 2010 4:59 am
Genuine User: Yes
IDE Question: C++
Contact:

Code completion for openmpi - const classes in separate file

Post by Nosferax »

Hi,

I am having trouble to get code completion working for the openmpi library. I get the completion for some elements but not all. I'll point out to one example where the completion cannot seem to understand what is going on.

To use openmpi, you typically install the libopenmpi-dev packages, which puts a bunch of headers in /usr/include/openmpi. I added that folder to my workspace's parser search paths. The completion on classes is just fine, but the problem comes with the definition of some constant classes, defined in the file /usr/include/openmpi/openmpi/ompi/mpi/cxx/constants.h (wew, that was long), included in the file /usr/include/openmpi/openmpi/ompi/mpi/cxx/mpicxx.h, which is included in the file mpi.h, the file you include in your main file (assuming you are programming in c++, if programming c openmpi will include a different file than openmpi/openmpi/ompi/mpi/cxx/mpicxx.h).

Before all of the constants I am trying to get completion on, there is a preprocessor instruction OMPI_DECLSPEC, which I added to my Token list, to no avail. Here is a sample of the file (which I added as an attachment to this message):
// datatypes for reductions functions (C / C++)
OMPI_DECLSPEC extern const Datatype FLOAT_INT;
OMPI_DECLSPEC extern const Datatype DOUBLE_INT;

...

// reserved communicators
// JGS these can not be const because Set_errhandler is not const
OMPI_DECLSPEC extern Intracomm COMM_WORLD;
OMPI_DECLSPEC extern Intracomm COMM_SELF;
The constants.h file is included inside a namespace named MPI. This seems to cause some havoc since, to the code parser, other classes which have been included in the same way are defined outside the MPI namespace (i.e., I get completion on the class Intracomm without typing MPI::, and I have no using namespace MPI in my main file).

Any idea what's going on in the parser?

Thanks!
You do not have the required permissions to view the files attached to this post.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code completion for openmpi - const classes in separate file

Post by eranif »

Nosferax wrote:there is a preprocessor instruction OMPI_DECLSPEC, which I added to my Token list, to no avail
Its seems like that the 'extern' keyword is whats causing the mess...
Add 'extern' to the token list, retag workspace (from the main menu: Workspace | Retag workspace (full)) and it will work
Nosferax wrote:other classes which have been included in the same way are defined outside the MPI namespace (i.e., I get completion on the class Intracomm without typing MPI::, and I have no using namespace MPI in my main file).
Please provide with a minimal sample code that shows the problem ( no need to provide the openmpi headers, I will install the package)

Eran
Make sure you have read the HOW TO POST thread
Post Reply