G-Node / nix

Neuroscience information exchange format
https://readthedocs.org/projects/nixio/
Other
66 stars 36 forks source link

Prefix PACKED macro to avoid clash with openmpi's PACKED type #663

Closed muffgaga closed 7 years ago

muffgaga commented 7 years ago

When building nix using gcc@4.9.2 and openmpi@2.0.1, we get:

                 from /path_to/nix-1.3.2/src/DataArray.cpp:12:
/path_to/nix-1.3.2/include/nix/Platform.hpp:38:38: error: declaration does not declare anything [-fpermissive]

We tracked back and found a type PACKED in https://github.com/open-mpi/ompi/blob/master/ompi/mpi/cxx/constants.h#L128

OMPI_DECLSPEC extern const Datatype PACKED;

which gets replaced by the preprocessor:

OMPI_DECLSPEC extern const Datatype __attribute__((packed));

We did a short test using build llvm/clang 3.9.0 but could not reproduce this problem; it could be a compiler version-specific issue.

gicmo commented 7 years ago

Looks good to me, expect I would have used NIX_PACKED instead of NEO_PACKED.

muffgaga commented 7 years ago

@gicmo ACK, fixed.