Skip to content

Commit

Permalink
update compiler logic
Browse files Browse the repository at this point in the history
  • Loading branch information
wortiz committed Aug 8, 2024
1 parent 5cd2fa9 commit 654450b
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions tpls/install-tpls.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,31 +83,45 @@
if args.cc:
if CC:
logger.log(
"CC {} is environment variable, overriding with --cc={}".format(
"CC {} is an environment variable, overriding with --cc={}".format(
CC, args.cc
)
)
CC = str(args.cc)
if args.cxx:
CXX = str(args.cxx)
logger.log(
"CXX {} is environment variable, overriding with --cxx={}".format(
CXX, args.cxx
if CXX:
logger.log(
"CXX {} is an environment variable, overriding with --cxx={}".format(
CXX, args.cxx
)
)
)
CXX = str(args.cxx)
if args.fc:
if FC:
logger.log(
"FC {} is an environment variable, overriding with --fc={}".format(FC, args.fc)
)
FC = str(args.fc)
logger.log(
"FC {} is environment variable, overriding with --fc={}".format(FC, args.fc)
)

if CC:
tpl_registry.set_environment_variable("CC", CC)
else:
print("C compiler not set, defaulting to gcc, set with --cc")
tpl_registry.set_environment_variable("CC", "gcc")

if CXX:
tpl_registry.set_environment_variable("CXX", CXX)
else:
print("C++ compiler not set, defaulting to g++, set with --cxx")
tpl_registry.set_environment_variable("CXX", "g++")

if FC:
tpl_registry.set_environment_variable("FC", FC)
tpl_registry.set_environment_variable("F77", FC)
else:
print("Fortran compiler not set, defaulting to gfortan set with --fc")
tpl_registry.set_environment_variable("FC", "gfortran")
tpl_registry.set_environment_variable("F77", "gfortran")

for p in packages:
pm = importlib.import_module("tpl_tools." + ".".join(["packages", p]))
Expand Down

0 comments on commit 654450b

Please sign in to comment.