Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

black reformat these python files #233

Merged
merged 1 commit into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions cime_config/buildlib
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ def buildlib(bldroot, libroot, case):

logger.info("Running cmake for CDEPS")
srcpath = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
cmake_flags = get_standard_cmake_args(
case, os.path.join(sharedpath, "cdeps")
)
cmake_flags = get_standard_cmake_args(case, os.path.join(sharedpath, "cdeps"))
# base path of install to be completed by setting DESTDIR in make install
cmake_flags += " -DCMAKE_INSTALL_PREFIX:PATH=/"
cmake_flags += " -DLIBROOT={} ".format(libroot)
Expand Down
22 changes: 15 additions & 7 deletions cime_config/buildlib_comps
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,44 @@ if _CIMEROOT is None:
raise SystemExit("ERROR: must set CIMEROOT environment variable")
sys.path.append(os.path.join(_CIMEROOT, "CIME", "Tools"))

_LIBDIR = os.path.join(_CIMEROOT, "scripts", "lib")
_LIBDIR = os.path.join(_CIMEROOT, "CIME")
sys.path.append(_LIBDIR)

from standard_script_setup import *
from CIME.buildlib import parse_input
from CIME.case import Case
from CIME.utils import run_cmd, symlink_force, expect

# pragma pylint: disable=unused-argument,undefined-variable

logger = logging.getLogger(__name__)


def buildlib(bldroot, libroot, case, compname=None):
if not compname:
expect(bldroot.endswith("obj"),
"It appears that buildlib_comps is being called for the main CDEPS build\n"
"(the main CDEPS build should use buildlib, not buildlib_comps)")
compname = os.path.basename(os.path.abspath(os.path.join(bldroot,os.pardir)))
expect(
bldroot.endswith("obj"),
"It appears that buildlib_comps is being called for the main CDEPS build\n"
"(the main CDEPS build should use buildlib, not buildlib_comps)",
)
compname = os.path.basename(os.path.abspath(os.path.join(bldroot, os.pardir)))

_, o, e = run_cmd("make d{}".format(compname), from_dir=bldroot, verbose=True)
libname = "lib{}.a".format(compname)
dlibname = "libd{}.a".format(compname)
dlibpath = os.path.join(bldroot, dlibname)
if os.path.exists(dlibpath):
symlink_force(os.path.join(bldroot,dlibname), os.path.join(libroot,libname))
symlink_force(os.path.join(bldroot, dlibname), os.path.join(libroot, libname))
else:
expect(False, "ERROR in {} build {} {}".format(compname,o,e))
expect(False, "ERROR in {} build {} {}".format(compname, o, e))
logger.info(f"build successful for comp={compname}")


def _main_func(args):
caseroot, libroot, bldroot = parse_input(args)
with Case(caseroot) as case:
buildlib(bldroot, libroot, case)


if __name__ == "__main__":
_main_func(sys.argv)
Loading