Building a configuration with just the MPI thorn fails

Create issue
Issue #1468 closed
Ian Hinder created an issue

If I build a Cactus configuration with a thornlist containing just the MPI thorn (i.e no driver or any other thorns), the compilation fails with

COMPILING /Users/ian/Cactus/EinsteinToolkit/src/comm/CactusDefaultComm.c
In file included from /Users/ian/Cactus/EinsteinToolkit/configs/mpitest/build/Cactus/comm/CactusDefaultComm.c:33:
/opt/local/include/openmpi/mpi.h:367: error: wrong number of arguments specified for ‘__deprecated__’ attribute

Building the flesh without the MPI thorn works OK. This is on Mac OS with MPI from MacPorts.


Comments (8)

  1. Erik Schnetter
    • removed comment

    What version of OS X is this? What compiler and compiler version are you using? Which version of OpenMPI is this?

    It seems that the compiler cannot handle the OpenMPI include file mpi.h. The reason for this is likely that OpenMPI expects to be built with a particular compiler (then one that would be chosen by mpicc), but you are now using a different one, maybe a newer one.

    A likely work-around is to use -D__deprecated__=__deprecated_DISABLED. This should avoid this error, but would also disable all warnings about deprecated features.

    Another solution may to be update your OpenMPI version.

    On the Cactus side, we could automatically enable the -D work-around above if a simple MPI program cannot be built without it, but can be built with it.

  2. Ian Hinder reporter
    • removed comment

    OS X version: 10.8.5, OpenMPI 1.7.2 from MacPorts. I just experimented with the compiler. It works fine if I use the osx-mountain-lion-macports-gcc.cfg from simfactory (gcc 4.6 from MacPorts), but it fails if I give it a blank optionlist (equivalent to compiling without simfactory and no optionlist provided), which causes Cactus to try the apple gcc. This doesn't seem to be a Cactus problem. The default Apple gcc can't compile mpi.h; it gives this error message. Apparently at least gcc 4.5 is needed for this (see for a discussion of this error message when compiling using Apple's gcc).

    The workaround works; I can build the flesh and the MPI thorn if I add that definition. I wonder why the OpenMPI header file is using a feature of GCC that only exists in newer versions. Shouldn't openmpi be portable? Maybe the macports version assumes that it is going to be compiled with the current macports compiler.

    Is it worth trying to make the ET work with the default Apple gcc, or should we give up and blacklist it? The MPI thorn could check that mpi.h can be compiled and give an error message about requiring a minimum gcc version if not.

  3. Erik Schnetter
    • removed comment

    You can define the default gcc with MacPorts: "sudo port select gcc" lists all available versions, and tells you how to change the default. I have set my default to gcc-mp-4.8.

    The default gcc is an Apple-specific version of gcc 4.2. This is outdated, doesn't have a good gfortran, and has Apple-specific modifications (and is thus not supported by gcc), and isn't really supported by Apple any more either. If you type "cc" on OS X, then you will find clang, Apple's preferred compiler.

    I think the only "correct" solution is to avoid this compiler.

  4. Frank Löffler
    • removed comment

    Yes, or even 'invalid', as the problem doesn't seem to be Cactus miscompiling something, but a problem with the installed compiler and libraries.

  5. Ian Hinder reporter
    • removed comment

    Should we blacklist the Apple gcc? It would be good for users to know that it's not supposed to work.

  6. Log in to comment