Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

From: Brian Barrett (brbarret_at_[hidden])
Date: 2006-01-19 15:27:00


On Jan 17, 2006, at 3:17 AM, Yves Reymen wrote:

> Brian Barrett wrote:
>> On Jan 16, 2006, at 11:32 AM, Yves Reymen wrote:
>>
>>> Recently openmpi v1.0.1 was installed on our cluster. It contains
>>> all
>>> parameters of ompi_config.h within a #ifndef OMPI_CONFIG_H. I am
>>> wondering how it is possible to give one of these parameters an
>>> other
>>> value after everthing is configured and installed, given the fact
>>> that
>>> no ompi_config.h is present in the installation.
>>>
>>> Take for instance the OMPI_WANT_CXX_BINDINGS that decides if you
>>> want to
>>> include de C++ bindings in mpicxx.h or not. If I set it on my
>>> compile
>>> line as -DOMPI_WANT_CXX_BINDINGS=0. It will always be redefined
>>> to the
>>> value in mpi.h, which for our installation is 1.
>>>
>>> Is there a way of getting rid of this redefinition?
>>
>> Your only options are to live with the defaults installed or re-
>> configure with the values you want. For this one value, you could
>> probably safely edit the #define for OMPI_WANT_CXX_BINDINGS in mpi.h,
>> but that would only work in this one scenario, and even then, would
>> prevent the use of the C++ bindings with that install.
>>
>> We generally don't allow for overriding those configure options
>> because in almost all cases, it won't result in what the user
>> expects. For instance, if the value for WANT_CXX_BINDINGS is set to
>> 0 by configure, and the user tries to set it to 1, the headers and
>> libraries required for the C++ bindings won't be present. Or if you
>> tried to change the WANT_EXCEPTIONS value from 0 to 1, code not built
>> to handle exceptions might suddenly be expected to do so, resulting
>> in very bad things.
>>
>> Is there a reason that you want to disable the C++ bindings after
>> installation? They should be absolutely harmless if you aren't using
>> them. If that isn't the case, then we need to fix whatever is
>> causing your problems.
>
> The problem is that I am using libraries written in C but intended
> also
> for use in C++. The problem occurs with autopack, which is a
> message-passing library which transparently packs small messages into
> fewer larger ones for more efficient transport by MPI.
> http://www-unix.mcs.anl.gov/autopack/
> The last release is 1.3 and dates back to May 2000. Now it seems
> development has started on version 1.4.
> In the main header, autopack.h, mpi.h is included in a Extern C
> block if
> a C++ compiler is used:
> #ifdef __cplusplus
> extern "C" {
> #endif /* __cplusplus */
> ...
> #include mpi.h>
> ...
> #ifdef __cplusplus
> }
> #endif /* __cplusplus */
>
> The problem can be solved by taking the #include out of the extern C
> block, the C bindings will still be available. But that would mean I
> have to edit third party software, which I like to avoid if possible.

I would definitely contact the autopack developers about this problem
-- mpi.h is required by the MPI-2 standard to be safe for inclusion
directly by C++ programs, and given the requirement that mpi.h
provide the C++ bindings when compiling C++ code, I'm not sure what
else we can do. In the short term, my only suggestion would be to
remove the extern C in autopack or build Open MPI without C++ bindings.

Brian

-- 
   Brian Barrett
   Open MPI developer
   http://www.open-mpi.org/