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()
156
156
find_package ( MPI )
157
157
158
158
if ( (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
+ )
159
166
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
161
168
HINTS "${FTN_COMPILER_DIR} " "${C_COMPILER_DIR} "
162
169
PATH_SUFFIXES bin )
163
170
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()
23
23
# Set CC to the MPI implementation's gcc command...
24
24
CC=" ${MPICC_show[0]} "
25
25
# 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' ) )
27
28
if ! (( ${# MPIEXEC_CANDIDATES[@]} >= 1 )) ; then
28
29
emergency " Could not find a suitable \` mpiexec\` in directory containing mpi wrappers (${MPICC%/* } )"
29
30
else
You can’t perform that action at this time.
0 commit comments