ExternalLibraries/MPI missing C++ library names

Create issue
Issue #1653 closed
Barry Wardell created an issue

The MPI thorn currently uses mpicc to automatically detect the list of libraries to link against. On my machine this causes '-lmpi' to be added to the list of libraries to link. This is wrong in cases where thorns use C++. In that case, '-lmpi_cxx' should also be included.

I have tested this using a simple hello world MPI program (code [http://mpitutorial.com/mpi-hello-world/ here]). When I compile this with gcc and '-lmpi' it works fine, but if I compile with g++ I also need to include '-lmpi_cxx'. This is on Mac OS X 10.9 with OpenMPI installed by Homebrew, but I would imagine it could also affect other systems.

A simple fix in my case is to replace mpicc with mpic++ in the configure.pl of the MPI thorn. In that case, both libraries are correctly included and I can compile Cactus without any problems.

Keyword:

Comments (6)

  1. Frank Löffler
    • removed comment

    I can confirm the problem, and that the proposed change fixes it. I think it should also be save to assume that C++ can be allowed to be required.

  2. Log in to comment