Cannot compile on Mac OS

Create issue
Issue #1655 closed
Ian Hinder created an issue

I tried to compile the ET on Mac OS using a fresh checkout from yesterday, and got linker errors.

Undefined symbols for architecture x86_64:
 "_MPI_Abort", referenced from:
     _CactusDefaultAbort in libthorn_Cactus.a(CactusDefaultComm.c.o)
     MPI::Comm::Abort(int) in libthorn_PeriodicCarpet.a(periodic.cc.o)
     MPI::Comm::Abort(int) in libthorn_Carpet.a(helpers.cc.o)
     MPI::Comm::Abort(int) in libthorn_CarpetEvolutionMask.a(evolution_mask.cc.o)
     MPI::Comm::Abort(int) in libthorn_CarpetIOASCII.a(ioascii.cc.o)
     MPI::Comm::Abort(int) in libthorn_CarpetIOBasic.a(iobasic.cc.o)
     MPI::Comm::Abort(int) in libthorn_CarpetIOHDF5.a(Input.cc.o)

This used to work before the recent rewrite of the MPI configure script. I am using the simfactory optionlist osx-mountain-lion-macports-gcc.cfg and OpenMPI from MacPorts. The auto-detection logic in the MPI thorn won't work, as MacPorts uses nonstandard names for the compilation wrappers (mpicc-openmpi-mp mpicxx-openmpi-mp mpiexec-openmpi-mp mpif77-openmpi-mp mpif90-openmpi-mp). However, the optionlist specifies the library locations explicitly, and for some reason this is not working:

MPI_DIR = NO_BUILD MPI_INC_DIRS = /opt/local/include/openmpi-mp MPI_LIB_DIRS = /opt/local/lib/openmpi-mp

While it would be good for the script to be updated to find the configuration scripts that OpenMPI in MacPorts provides, we should also fix whatever is stopping the explicit settings from working. It should always be possible to configure using the explicit settings; this is more important than having the auto-detection working.

Keyword: MPI

Comments (4)

  1. Erik Schnetter
    • removed comment

    For auto-detection: Do you have an executable called "mpic++"? If not, what is it called on your system? Maybe "openmpic++"?

    For configuring manually: Can you set MPI_LIBS as well? Does this help?

  2. Ian Hinder reporter
    • marked as
    • removed comment

    Yes, setting

    MPI_LIBS = mpi_cxx mpi
    

    in the optionlist allows the link to succeed, and I can run the resulting executable. Thanks! I have committed the change to simfactory as revision 2407. According to Erik (by email), the old version of the MPI thorn configuration script set "MPI_LIBS = mpi_cxx mpi" by default, which is correct for OpenMPI, but not for other MPI implementations. The new version does not set these. Hence, with OpenMPI it is now necessary to set these explicitly.

    The executable for auto-detection is called mpicxx-openmpi-mp in MacPorts. This should be searched for by the configure script. Leaving the ticket open for this.

  3. Log in to comment