#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.
#1653: ExternalLibraries/MPI missing C++ library names ------------------------------------+--------------------------------------- Reporter: barry.wardell | Owner: Type: defect | Status: new Priority: major | Milestone: Component: EinsteinToolkit thorn | Version: development version Resolution: | Keywords: ------------------------------------+---------------------------------------
Comment (by knarf):
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.
#1653: ExternalLibraries/MPI missing C++ library names ------------------------------------+--------------------------------------- Reporter: barry.wardell | Owner: Type: defect | Status: new Priority: major | Milestone: Component: EinsteinToolkit thorn | Version: development version Resolution: | Keywords: ------------------------------------+---------------------------------------
Comment (by sbrandt):
Fix attached.
#1653: ExternalLibraries/MPI missing C++ library names ------------------------------------+--------------------------------------- Reporter: barry.wardell | Owner: Type: defect | Status: review Priority: major | Milestone: Component: EinsteinToolkit thorn | Version: development version Resolution: | Keywords: ------------------------------------+--------------------------------------- Changes (by knarf):
* status: new => review
Comment:
Looks good.
#1653: ExternalLibraries/MPI missing C++ library names ------------------------------------+--------------------------------------- Reporter: barry.wardell | Owner: Type: defect | Status: reviewed_ok Priority: major | Milestone: Component: EinsteinToolkit thorn | Version: development version Resolution: | Keywords: ------------------------------------+--------------------------------------- Changes (by knarf):
* status: review => reviewed_ok
#1653: ExternalLibraries/MPI missing C++ library names ------------------------------------+--------------------------------------- Reporter: barry.wardell | Owner: Type: defect | Status: closed Priority: major | Milestone: Component: EinsteinToolkit thorn | Version: development version Resolution: fixed | Keywords: ------------------------------------+--------------------------------------- Changes (by sbrandt):
* status: reviewed_ok => closed * resolution: => fixed
Comment:
committed to revision 47 of https://svn.cactuscode.org/projects/ExternalLibraries/MPI/trunk
trac@lists.einsteintoolkit.org