#1653: ExternalLibraries/MPI missing C++ library names -----------------------------------+---------------------------------------- Reporter: barry.wardell | Owner: Type: defect | Status: new Priority: major | Milestone: Component: EinsteinToolkit thorn | Version: development version Keywords: | -----------------------------------+---------------------------------------- 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.