Skip to content

Commit 177fdd0

Browse files
committed
Query install.sh 4 default mpich install location
Update CMakeLists.txt to check default install location used by install.sh for installing MPICH when having trouble locating MPI.
1 parent c374b03 commit 177fdd0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,15 @@ endif()
156156
find_package( MPI )
157157

158158
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+
)
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}/.." )

0 commit comments

Comments
 (0)