Skip to content

Commit cdfb66e

Browse files
committed
Add buildlib from CIME for xcomps
This is copied exactly from CIME/build_scripts/buildlib.internal_components from ESMCI/cime@5444eae316
1 parent 482b13d commit cdfb66e

8 files changed

Lines changed: 46 additions & 7 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../../../../build_scripts/buildlib.internal_components
1+
../../xshare/cime_config/buildlib
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../../../../build_scripts/buildlib.internal_components
1+
../../xshare/cime_config/buildlib
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../../../../build_scripts/buildlib.internal_components
1+
../../xshare/cime_config/buildlib
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../../../../build_scripts/buildlib.internal_components
1+
../../xshare/cime_config/buildlib
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../../../../build_scripts/buildlib.internal_components
1+
../../xshare/cime_config/buildlib
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../../../../build_scripts/buildlib.internal_components
1+
../../xshare/cime_config/buildlib
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env python3
2+
3+
"""
4+
build cime component model library. This buildlib script is used by all cime internal
5+
components.
6+
"""
7+
8+
import sys, os
9+
10+
_CIMEROOT = os.environ.get("CIMEROOT")
11+
if _CIMEROOT == None:
12+
raise ValueError("ERROR: CIMEROOT not defined in buildlib.internal_components.")
13+
sys.path.append(os.path.join(_CIMEROOT, "CIME", "Tools"))
14+
15+
from standard_script_setup import *
16+
from CIME.buildlib import build_cime_component_lib, parse_input
17+
from CIME.case import Case
18+
19+
20+
def buildlib(bldroot, libroot, case, compname=None):
21+
if compname is None:
22+
thisdir = os.path.dirname(os.path.abspath(__file__))
23+
path, dir1 = os.path.split(thisdir)
24+
_, dir2 = os.path.split(path)
25+
if dir1 == "cime_config":
26+
compname = dir2
27+
else:
28+
compname = dir1.split(".")[1]
29+
build_cime_component_lib(case, compname, libroot, bldroot)
30+
31+
32+
def _main_func(args):
33+
caseroot, libroot, bldroot = parse_input(args)
34+
with Case(caseroot) as case:
35+
buildlib(bldroot, libroot, case)
36+
37+
38+
if __name__ == "__main__":
39+
_main_func(sys.argv)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../../../../build_scripts/buildlib.internal_components
1+
../../xshare/cime_config/buildlib

0 commit comments

Comments
 (0)