From de7e3aad3b9102f515382984dcdb80b4ffcbfe9a Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 28 Aug 2019 10:23:25 -0500 Subject: [PATCH] Introduce fortran_libraries arg to run_fortran to accommodate gfortran 9's new strictness --- dagrt/utils.py | 7 +++++-- test/test_codegen_fortran.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dagrt/utils.py b/dagrt/utils.py index bda4714..bd8df2e 100644 --- a/dagrt/utils.py +++ b/dagrt/utils.py @@ -174,9 +174,11 @@ class TemporaryDirectory(object): # {{{ run_fortran -def run_fortran(sources, fortran_options=None): +def run_fortran(sources, fortran_options=None, fortran_libraries=None): if fortran_options is None: fortran_options = [] + if fortran_libraries is None: + fortran_libraries = [] from os.path import join @@ -198,7 +200,8 @@ def run_fortran(sources, fortran_options=None): "-Wno-maybe-uninitialized", "-g", "-oruntest"] + fortran_options - + list(source_names), + + list(source_names) + + ["-l"+lib for lib in fortran_libraries], cwd=tmpdir) p = Popen([join(tmpdir, "runtest")], stdout=PIPE, stderr=PIPE, diff --git a/test/test_codegen_fortran.py b/test/test_codegen_fortran.py index df4cf82..bbca5ca 100755 --- a/test/test_codegen_fortran.py +++ b/test/test_codegen_fortran.py @@ -118,7 +118,7 @@ def test_arrays_and_linalg(): ("arrays.f90", code_str), ("test_arrays_and_linalg.f90", read_file("test_arrays_and_linalg.f90")), ], - fortran_options=["-llapack", "-lblas"]) + fortran_libraries=["lapack", "blas"]) if __name__ == "__main__": -- GitLab