Skip to content
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
27 changes: 22 additions & 5 deletions buildlib.csm_share
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
import sys,os
cimeroot = os.getenv("CIMEROOT")
sys.path.append(os.path.join(cimeroot,"scripts","Tools"))
_CIMEROOT = os.getenv("CIMEROOT")
sys.path.append(os.path.join(_CIMEROOT,"scripts","Tools"))

from standard_script_setup import *
from CIME.utils import copyifnewer, run_bld_cmd_ensure_logging, expect, symlink_force
Expand Down Expand Up @@ -50,7 +50,6 @@ def buildlib(bldroot, installpath, case):
###############################################################################
gmake_args = get_standard_makefile_args(case, shared_lib=True)
comp_interface = case.get_value("COMP_INTERFACE")
cimeroot = case.get_value("CIMEROOT")
srcroot = case.get_value("SRCROOT")
caseroot = case.get_value("CASEROOT")
libroot = case.get_value("LIBROOT")
Expand All @@ -71,17 +70,35 @@ def buildlib(bldroot, installpath, case):
if comp_interface == "nuopc":
filepath.append(os.path.join(srcroot,"share","cmeps"))
filepath.append(os.path.join(srcroot,"components","cmeps", "nuopc_cap_share"))
#
# Provide an interface to the CrayLabs SmartSim tools, if the tools are not used
# then build a stub interface. See cime/tools/smartsim/README.md for details
#
if case.get_value("USE_SMARTSIM"):
smartredis_lib = os.getenv("SMARTREDIS_LIB")
expect(smartredis_lib," Expect path to SMARTREDIS in env variable SMARTREDIS_LIB - is the module loaded?")
fortran_src_path = os.getenv("SMARTREDIS_FSRC")
expect(fortran_src_path," Expect path to SMARTREDIS fortran source code in env variable SMARTREDIS_FSRC - is the module loaded?")
redis_include_path = os.getenv("SMARTREDIS_INCLUDE")
expect(os.path.isdir(redis_include_path), "Could not find or read directory {}".format(redis_include_path))
os.environ["USER_INCLDIR"] = "-I" + redis_include_path
gmake_args += " USE_SMARTSIM=TRUE "
else:
fortran_src_path = os.path.join(srcroot,"share","src","stubs","smartredis")

expect(os.path.isdir(fortran_src_path), "Could not find or read directory {}".format(fortran_src_path))
filepath.append(fortran_src_path)

elif comp_interface != "mct":
expect(False, "driver value of {} not supported".format(comp_interface))

if case.get_value("USE_ESMF_LIB"):
if comp_interface == "nuopc" or case.get_value("USE_ESMF_LIB"):
use_esmf = "esmf"
else:
use_esmf = "noesmf"
filepath.append(os.path.join(srcroot,"share","src","esmf_wrf_timemgr"))


comp_interface = case.get_value("COMP_INTERFACE")
ninst_value = case.get_value("NINST_VALUE")
libdir = os.path.join(bldroot,comp_interface,use_esmf, ninst_value,"csm_share")
if not os.path.isdir(libdir):
Expand Down
2 changes: 2 additions & 0 deletions src/stubs/smartredis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This is a stub interface to the SmartRedis tools and should only be used when
CESM is built without SmartRedis.
Loading