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)
import os.path
import re
import shutil
import sys
import tempfile
@ -160,9 +161,18 @@ def configure_args(self):
config_args = []
# 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([
"--with-blas=%s" % spec['blas'].libs.ld_flags,
"--with-lapack=%s" % spec['lapack'].libs.ld_flags
mkl_re.sub(r'\g<1>gf\g<2>',
'--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