Wrong mpirun copied to utilities directory in MPI thorn

Issue #1776 resolved
Ian Hinder created an issue

On Mac OS, if I set MPI_DIR=BUILD in order to build OpenMPI using the MPI thorn, Cactus should copy the built version of mpirun into exe/<config>. However, if it finds one in /usr/local/bin, it copies that one instead.

NB: to compile OpenMPI, you need gnu99 or later in CFLAGS, as OpenMPI needs the 'asm' directive, which is a GNU extension.

Keyword: ExternalLibraries/MPI

Comments (5)

  1. Roland Haas
    • removed comment

    The recipe for the utilities (MPI/src/make.configuration.defn) reads:

    ALL_UTILS += $(shell cd $(MPI_DIR)/bin 2>/dev/null && ls mpirun ompi-clean ompi-iof ompi-probe ompi-profiler ompi-ps ompi-server ompi-top ompi_info 2>/dev/null)
    

    and (MPI/src/make.configuration.deps)

    $(UTIL_DIR)/%: $(MPI_DIR)/bin/%
        @echo "Copying $* from $< to $(UTIL_DIR)"
        -$(MKDIR) $(MKDIRFLAGS) $(UTIL_DIR) 2> /dev/null
        cp $< $@
    

    so as long as MPI_DIR is set properly (and detect.pl seems to do so) it should copy the correct executables. Can you check if perhaps homebrew itself sets and MPI_DIR environment variable which make take precendence?

  2. Ian Hinder reporter
    • removed comment

    I checked that there was no MPI_DIR set in the shell which I used to launch the build. I agree that detect.pl seems to be setting MPI_DIR correctly; the output indicates that the install location is correct, and from the code, this seems to propagate directly to the setting of MPI_DIR. Nonetheless, the wrong executable is copied, suggesting that by the time the code above gets called, something has changed MPI_DIR, or the code above is not working how it's supposed to. It's possible that if you put a dummy executable in /usr/local/bin/mpirun, you might be able to trigger the same behaviour on any system.

  3. Log in to comment