cmake: modify FindMPI.cmake to treat Fujitsu MPI correctly (#16864)

This commit is contained in:
Tomoki, Karatsu 2020-06-05 20:25:02 +09:00 committed by GitHub
parent 8be7823cc5
commit c3be6d903a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 9 deletions

View File

@ -238,3 +238,9 @@ def test(self):
def install(self, spec, prefix): def install(self, spec, prefix):
make('install') make('install')
if spec.satisfies('%fj'):
for f in find(self.prefix, 'FindMPI.cmake', recursive=True):
filter_file('mpcc_r)', 'mpcc_r mpifcc)', f, string=True)
filter_file('mpc++_r)', 'mpc++_r mpiFCC)', f, string=True)
filter_file('mpifc)', 'mpifc mpifrt)', f, string=True)

View File

@ -82,15 +82,6 @@ def cmake_args(self):
"-DCMAKE_Fortran_FLAGS=%s" % self.compiler.fc_pic_flag "-DCMAKE_Fortran_FLAGS=%s" % self.compiler.fc_pic_flag
]) ])
# Specify Fujitsu-MPI's location
if spec.satisfies('%fj') and '^fujitsu-mpi' in spec:
options.extend([
'-DMPI_C_COMPILER=%s' % spec['mpi'].mpicc,
'-DMPI_CXX_COMPILER=%s' % spec['mpi'].mpicxx,
'-DMPI_Fortran_COMPILER=%s' % spec['mpi'].mpifc,
'-DMPI_BASE_DIR=%s' % spec['mpi'].prefix
])
return options return options
@run_after('install') @run_after('install')