Compiling Parmmg with other software with mpi

Hello,

I am trying to compile ParMMG with the FEM Elmer. I am using the ParMMG Fortran API embedded within the Elmer code. However since Elmer has its own mpi interface based off the same mpif.h file there are lots of conflicts eg

Error: Symbol ‘ompi_major_version’ at (1) conflicts with symbol from module ‘sparitercomm’, use-associated at (2)
mpif-config.h:34:34:

I wonder if you have any advice on how to resolve this issue.

Thanks for any help!

Iain

Hi,

Maybe you can try to comment the FIND_PACKAGE( MPI COMPONENTS C CXX OPTIONAL_COMPONENTS Fortran ) line of the CMakeLists.txt file of ParMmg and to pass the mpi headers and libraries used by Elmer to ParMmg ?

If if doesn’t work, is it possible to attach both the include directories and libraries used by Elmer and Mmg.

Best Regards,
Algiane

Hi Algiane,

Elmer and ParMmg are using the exact same libraries so the conflict is from the duplication of mpif.h symbols. I thought I’d solved the issue by using the libparmmgf.h file (which calls mpif.h) in the Elmer mpi routines. This works fine, however, I still get the same conflicts if I include libparmmg.h in the module I am working. I suppose this is because mpif.h is still called twice.

Best,
Iain

I’ve managed to compile! I had to define the parmmg input variables in fortran in the Elmer mpi module after including the libparmmgf.h file. When I ‘use’ this module in other areas of Elmer, I will now have access to these variables. They were not passed previously by just including the libparmmgf.h file in the Elmer mpi module. I can include the libparmmgtypesf.h file to get the other definitions so avoiding the second mpif.h call.

Thanks!
Iain

Thank you for the feedback!

I am not sure that I have understand your issue but I am glad that you manage to fix it ;-)!

Best Regards,
Algiane