Skip to content

Commit

Permalink
add make shared fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
Krande committed Jan 3, 2025
1 parent 32742fb commit d26f672
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions run_aster/toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand Down

0 comments on commit d26f672

Please sign in to comment.