adios2: fix to build on Fujitsu MPI and Fujitsu compiler (#17034)

This commit is contained in:
Toyohisa Kameyama 2020-06-10 21:53:09 +09:00 committed by GitHub
parent 0de12be52a
commit f6020d259a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,10 +119,20 @@ class Adios2(CMakePackage):
# See https://github.com/ornladios/ADIOS2/pull/1899
patch('2.5-fix-clear_cache.patch', when='@2.5.0')
@when('%fj')
def patch(self):
""" add fujitsu mpi commands #16864 """
f = join_path('cmake', 'upstream', 'FindMPI.cmake')
filter_file('mpcc_r)', 'mpcc_r mpifcc)', f, string=True)
filter_file('mpc++_r)', 'mpcc_r mpiFCC)', f, string=True)
filter_file('mpf77_r', 'mpf77_r mpifrt', f, string=True)
def setup_build_environment(self, env):
# https://github.com/ornladios/ADIOS2/issues/2228
if self.spec.satisfies('%gcc@10: +fortran'):
env.set('FFLAGS', '-fallow-argument-mismatch')
elif self.spec.satisfies('%fj +fortran'):
env.set('FFLAGS', '-Ccpp')
def cmake_args(self):
spec = self.spec
@ -185,6 +195,12 @@ def cmake_args(self):
args.append('-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL={0}'.format(
'ON' if '+pic' in spec else 'OFF'))
if spec.satisfies('%fj'):
args.extend([
'-DCMAKE_Fortran_SUBMODULE_EXT=.smod',
'-DCMAKE_Fortran_SUBMODULE_SEP=.'
])
if spec.satisfies('+python') or self.run_tests:
args.append('-DPYTHON_EXECUTABLE:FILEPATH=%s'
% spec['python'].command.path)