File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
prerequisites/install-functions Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -156,8 +156,15 @@ endif()
156156find_package ( MPI )
157157
158158if ( (NOT MPI_C_FOUND) OR (NOT MPI_Fortran_FOUND) OR (NOT MPIEXEC))
159+ # Get default install location of MPICH from install.sh
160+ execute_process ( COMMAND "./install.sh" -P mpich
161+ WORKING_DIRECTORY "${CMAKE_SOURCE_DIR} "
162+ OUTPUT_VARIABLE DEFAULT_MPICH_INSTALL_LOC
163+ OUTPUT_QUIET
164+ OUTPUT_STRIP_TRAILING_WHITES_SPACE
165+ )
159166 find_program (MY_MPI_EXEC NAMES mpirun mpiexec lamexec srun
160- PATHS "${CMAKE_SOURCE_DIR/prerequisites/installations/mpich/3.1.4}" " ${CMAKE_SOURCE_DIR} /prerequisites/installations/mpich/* " ENV PATH
167+ PATHS "${DEFAULT_MPICH_INSTALL_LOC} " ENV PATH
161168 HINTS "${FTN_COMPILER_DIR} " "${C_COMPILER_DIR} "
162169 PATH_SUFFIXES bin)
163170 set ( MPI_HOME "${MPI_HOME} " "${MY_MPI_EXEC} " "${MY_MPI_EXEC} /.." )
Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ build_opencoarrays()
2323 # Set CC to the MPI implementation's gcc command...
2424 CC=" ${MPICC_show[0]} "
2525 # try to find mpiexec
26- MPIEXEC_CANDIDATES=($( find " ${MPICC%/* } " -name ' mpiexec' -o -name ' mpirun' -o -name ' lamexec' -o -name ' srun' ) )
26+ MPI_BIN_DIR=" $( type -P " ${MPICC} " ) "
27+ MPIEXEC_CANDIDATES=($( find " ${MPI_BIN_DIR%/* } " -name ' mpiexec' -o -name ' mpirun' -o -name ' lamexec' -o -name ' srun' ) )
2728 if ! (( ${# MPIEXEC_CANDIDATES[@]} >= 1 )) ; then
2829 emergency " Could not find a suitable \` mpiexec\` in directory containing mpi wrappers (${MPICC%/* } )"
2930 else
You can’t perform that action at this time.
0 commit comments