diff --git a/dagrt/utils.py b/dagrt/utils.py index bda471464a86b83f579aaa8b57468dfdd3cba771..bd8df2e9fbec232b721e49eb4d59d66a4c0b2500 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 df4cf8289e1659a255594f8b4c164304d1dc68b3..bbca5ca725493d1a7e6cc34e7fdffaeb4b1a363c 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__":