octave: add support for MKL (#25952)

This commit is contained in:
mcuma 2021-10-04 06:57:57 -06:00 committed by GitHub
parent 4f1c195bf9
commit fa528c96e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os.path import os.path
import re
import shutil import shutil
import sys import sys
import tempfile import tempfile
@ -160,9 +161,18 @@ def configure_args(self):
config_args = [] config_args = []
# Required dependencies # Required dependencies
if '^mkl' in spec and 'gfortran' in self.compiler.fc:
mkl_re = re.compile(r'(mkl_)intel(_i?lp64\b)')
config_args.extend([ config_args.extend([
"--with-blas=%s" % spec['blas'].libs.ld_flags, mkl_re.sub(r'\g<1>gf\g<2>',
"--with-lapack=%s" % spec['lapack'].libs.ld_flags '--with-blas={0}'.format(
spec['blas'].libs.ld_flags)),
'--with-lapack'
])
else:
config_args.extend([
'--with-blas={0}'.format(spec['blas'].libs.ld_flags),
'--with-lapack={0}'.format(spec['lapack'].libs.ld_flags)
]) ])
# Strongly recommended dependencies # Strongly recommended dependencies