@@ -1097,49 +1097,31 @@ subroutine mpi_compiler_match(language,wrappers,compiler,which_one,mpilib,error)
10971097 which_one = i
10981098 return
10991099 end if
1100-
1101- ! Because the intel mpi library does not support llvm_ compiler wrappers yet,
1102- ! we must check for that manually
1103- if (same_vendor== 0 .and. mpi_compiler% is_intel() .and. compiler% is_intel()) then
1104- same_vendor = i
1105- vendor_mpilib = mpilib
1106- end if
1107-
11081100 case (LANG_C)
11091101 ! For other languages, we can only hope that the name matches the expected one
11101102 if (screen% s== compiler% cc .or. screen% s== compiler% fc) then
11111103 which_one = i
11121104 return
11131105 end if
1114-
1115- ! Because the intel mpi library does not support llvm_ compiler wrappers yet,
1116- ! we must check for that manually
1117- if (same_vendor== 0 .and. screen% s==' icc' .and. compiler% cc==' icx' ) then
1118- same_vendor = i
1119- vendor_mpilib = mpilib
1120- end if
1121-
11221106 case (LANG_CXX)
11231107 if (screen% s== compiler% cxx .or. screen% s== compiler% fc) then
11241108 which_one = i
11251109 return
11261110 end if
1127-
1128- ! Because the intel mpi library does not support llvm_ compiler wrappers yet,
1129- ! we must check for that manually
1130- if (same_vendor== 0 .and. screen% s==' icpc' .and. compiler% cc==' icpx' ) then
1131- same_vendor = i
1132- vendor_mpilib = mpilib
1133- end if
1134-
11351111 end select
11361112
1113+ ! Because the intel mpi library does not support llvm_ compiler wrappers yet,
1114+ ! we must check for that manually
1115+ if (is_intel_classic_option(language,same_vendor,screen,compiler,mpi_compiler)) then
1116+ same_vendor = i
1117+ vendor_mpilib = mpilib
1118+ end if
11371119 end do
11381120
11391121 ! Intel compiler: if an exact match is not found, attempt closest wrapper
11401122 if (which_one== 0 .and. same_vendor> 0 ) then
11411123 which_one = same_vendor
1142- mpilib = vendor_mpilib
1124+ mpilib = vendor_mpilib
11431125 end if
11441126
11451127 ! None of the available wrappers matched the current Fortran compiler
@@ -1149,6 +1131,26 @@ subroutine mpi_compiler_match(language,wrappers,compiler,which_one,mpilib,error)
11491131
11501132end subroutine mpi_compiler_match
11511133
1134+ ! > Because the Intel mpi library does not support llvm_ compiler wrappers yet,
1135+ ! > we must save the Intel-classic option and later manually replace it
1136+ logical function is_intel_classic_option (language ,same_vendor_ID ,screen_out ,compiler ,mpi_compiler )
1137+ integer , intent (in ) :: language,same_vendor_ID
1138+ type (string_t), intent (in ) :: screen_out
1139+ type (compiler_t), intent (in ) :: compiler,mpi_compiler
1140+
1141+ if (same_vendor_ID/= 0 ) return
1142+
1143+ select case (language)
1144+ case (LANG_FORTRAN)
1145+ is_intel_classic_option = mpi_compiler% is_intel() .and. compiler% is_intel()
1146+ case (LANG_C)
1147+ is_intel_classic_option = screen_out% s==' icc' .and. compiler% cc==' icx'
1148+ case (LANG_CXX)
1149+ is_intel_classic_option = screen_out% s==' icpc' .and. compiler% cc==' icpx'
1150+ end select
1151+
1152+ end function is_intel_classic_option
1153+
11521154! > Return library version from the MPI wrapper command
11531155type (version_t) function mpi_version_get(mpilib,wrapper,error)
11541156 integer , intent (in ) :: mpilib
0 commit comments