[Gmsh] svn make clash on enabling MED and MPI

Geordie McBain gdmcbain at freeshell.org
Mon Mar 26 02:35:26 CEST 2012


Hello.  I was unable to compile an svn update to the Gmsh sources
today, so I started to investigate.   The make's error message begins:

%<------
$ make
[  0%] Building CXX object CMakeFiles/gmsh.dir/Geo/GModelIO_MED.cpp.o
In file included from
/usr/lib/openmpi/include/openmpi/ompi/mpi/cxx/mpicxx.h:202:0,
                 from /usr/lib/openmpi/include/mpi.h:1886,
                 from /usr/include/H5public.h:57,
                 from /usr/include/hdf5.h:24,
                 from /usr/include/med.h:22,
                 from /usr/local/stow/gmsh/Geo/GModelIO_MED.cpp:29:
/usr/lib/openmpi/include/openmpi/ompi/mpi/cxx/functions.h:61:6: error:
declaration of C function ‘void MPI::Init()’ conflicts with
/usr/lib/openmpi/include/openmpi/ompi/mpi/cxx/functions.h:58:1: error:
previous declaration ‘void MPI::Init(int&, char**&)’ here
...
-------------------------------------------->%

I'm not quite sure what's happened here (clearly C++ is being
interpreted as C, so maybe there's an inappropriate 'extern "C"'
somewhere along the line? but probably upstream of Gmsh).  Anyway, I
was able to avoid the problem for gmsh by unsetting ENABLE_MED in
cmake-gui.  This is fine for me, as I don't use MED, but I thought I'd
report it anyway as I know lots of people do.  I do have ENABLE_MPI,
which I could probably have shed too, but I didn't try that.