From d26f672873661cd379c6d41ff95ceeab2c56c337 Mon Sep 17 00:00:00 2001 From: krande Date: Fri, 3 Jan 2025 15:10:34 +0100 Subject: [PATCH] add make shared fallback --- run_aster/toolbox.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/run_aster/toolbox.py b/run_aster/toolbox.py index 8e7af9d2f5c..f591522a307 100644 --- a/run_aster/toolbox.py +++ b/run_aster/toolbox.py @@ -22,10 +22,10 @@ ------------------------------------------------ """ - +import pathlib from .config import CFG from .utils import run_command - +import os def make_shared(lib, src, *args): """Build a shared library from a fortran source file. @@ -38,7 +38,11 @@ def make_shared(lib, src, *args): Returns: int: exit code. """ - cmd = [CFG.get("FC")] + fc = CFG.get("FC") + fcp = pathlib.Path(fc) + if not fcp.exists(): + fcp = pathlib.Path(os.getenv("FC")) + cmd = [fcp.as_posix()] cmd.extend(CFG.get("FCFLAGS")) cmd.extend(["-shared", "-o", lib, src]) cmd.extend(args)