File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,18 @@ endif()
106106#----------------------------------------------------------------------------
107107# Find MPI and set some flags so that FC and CC can point to gfortran and gcc
108108#----------------------------------------------------------------------------
109- find_package (MPI REQUIRED)
109+
110+ # If the user passes FC=mpif90 etc. check and prefer that location
111+ get_filename_component ( FTN_MPI_DIR "${CMAKE_Fortran_COMPILER} "
112+ REALPATH )
113+ get_filename_component ( C_MPI_DIR "${CMAKE_C_COMPILER} "
114+ REALPATH )
115+ set ( MPI_HOME "${MPI_HOME} " "${FTN_MPI_DIR} /.." "${C_MPI_DIR} /.." )
116+
117+ # Check the install.sh defaut mpich installation directories
118+ set ( MPI_HOME "${MPI_HOME} " "${CMAKE_SOURCE_DIR} /prerequisites/installations/mpich/3.1.4" "${CMAKE_SOURCE_DIR} /prerequisites/installations/mpich/*" )
119+
120+ find_package ( MPI REQUIRED )
110121
111122set (CMAKE_C_COMPILE_FLAGS ${CMAKE_C_COMPILE_FLAGS} ${MPI_C_COMPILE_FLAGS} )
112123set (CMAKE_C_LINK_FLAGS ${CMAKE_C_LINK_FLAGS} ${MPI_C_LINK_FLAGS} )
You can’t perform that action at this time.
0 commit comments