octave: better specification of MKL and AMDFFTW libraries (#35935)

This commit is contained in:
nkgh77 2023-03-13 10:06:42 +01:00 committed by GitHub
parent ff019f868b
commit ee1ea1f430
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -223,6 +223,34 @@ def configure_args(self):
if "+fftw" in spec:
fftw_string = "fftw-api"
if ("^intel-mkl" in spec) or ("^intel-oneapi-mkl" in spec):
config_args.extend(
[
"--with-fftw3={0}".format(spec[fftw_string].libs.ld_flags),
"--with-fftw3f={0}".format(spec[fftw_string].libs.ld_flags),
]
)
elif "^amdfftw" in spec:
specAmdfftw = spec[fftw_string].token[0]
AMD_FFTW3_LIBS = "-lfftw3"
AMD_FFTW3F_LIBS = "-lfftw3f"
if "+openmp" in specAmdfftw:
AMD_FFTW3_LIBS += " -lfftw3_omp"
AMD_FFTW3F_LIBS += " -lfftw3f_omp"
if "+threads" in specAmdfftw:
AMD_FFTW3_LIBS += " -lfftw3_threads"
AMD_FFTW3F_LIBS += " -lfftw3f_threads"
config_args.extend(
[
"--with-fftw3=-L{0} {1}".format(
spec[fftw_string].libs.directories[0], AMD_FFTW3_LIBS
),
"--with-fftw3f=-L{0} {1}".format(
spec[fftw_string].libs.directories[0], AMD_FFTW3F_LIBS
),
]
)
else:
config_args.extend(
[
"--with-fftw3-includedir=%s" % spec[fftw_string].prefix.include,