Skip to content

Commit

Permalink
Merge branch 'sarich/enable-moab' (PR #1720)
Browse files Browse the repository at this point in the history
Introduces the xml elements USE_MOAB and MOAB_PATH.

Appends appropriate compile and link flags if USE_MOAB is set. Actual code to interface with
MOAB will be added later.

[BFB]
  • Loading branch information
rljacob authored Aug 17, 2017
2 parents 1c7e4a6 + 2008773 commit bee6d17
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1 deletion.
27 changes: 27 additions & 0 deletions config/acme/machines/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,25 @@ ifeq ($(strip $(USE_ALBANY)), TRUE)
include $(ALBANY_PATH)/export_albany.in
endif

# Set MOAB info if it is being used
ifeq ($(strip $(USE_MOAB)), TRUE)
ifdef MOAB_PATH
CPPDEFS += -DHAVE_MOAB
ifndef INC_MOAB
INC_MOAB:=$(MOAB_PATH)/include
endif
ifndef LIB_MOAB
LIB_MOAB:=$(MOAB_PATH)/lib
endif
else
$(error MOAB_PATH must be defined when USE_MOAB is TRUE)
endif

# get the "IMESH_LIBS" list as an env var
include $(LIB_MOAB)/iMesh-Defs.inc

endif

# Set HAVE_SLASHPROC on LINUX systems which are not bluegene or Darwin (OSx)

ifeq ($(findstring -DLINUX,$(CPPDEFS)),-DLINUX)
Expand Down Expand Up @@ -390,6 +409,9 @@ endif
ifdef INC_ALBANY
INCLDIR += -I$(INC_ALBANY)
endif
ifdef INC_MOAB
INCLDIR += -I$(INC_MOAB)
endif

ifeq ($(MODEL),driver)
INCLDIR += -I$(EXEROOT)/atm/obj -I$(EXEROOT)/ice/obj -I$(EXEROOT)/ocn/obj -I$(EXEROOT)/glc/obj -I$(EXEROOT)/rof/obj -I$(EXEROOT)/wav/obj -I$(EXEROOT)/esp/obj
Expand Down Expand Up @@ -556,6 +578,11 @@ ifeq ($(strip $(USE_ALBANY)), TRUE)
SLIBS += $(ALBANY_LINK_LIBS)
endif

# Add MOAB libraries. These are defined in the MOAB_LINK_LIBS env var that was included above
ifeq ($(strip $(USE_MOAB)), TRUE)
SLIBS += $(IMESH_LIBS)
endif

# Add libraries and flags that we need on the link line when C++ code is included
# We need to do these additions after CONFIG_ARGS is set, because they can sometimes break configure for mct, etc.,
# if they are added to LDFLAGS in CONFIG_ARGS.
Expand Down
1 change: 1 addition & 0 deletions config/xml_schemas/config_compilers_v2.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
<xs:element name="LD" type="systemPath"/>
<xs:element name="LDFLAGS" type="flagsVar"/>
<xs:element name="MLIBS" type="flagsVar"/>
<xs:element name="MOAB_PATH" type="systemPath"/>
<xs:element name="MPI_LIB_NAME" type="systemPath"/>
<xs:element name="MPI_PATH" type="systemPath"/>
<xs:element name="MPICC" type="systemPath"/>
Expand Down
2 changes: 2 additions & 0 deletions scripts/lib/CIME/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ def _case_build_impl(caseroot, case, sharedlib_only, model_only):
clm_use_petsc = case.get_value("CLM_USE_PETSC")
cism_use_trilinos = case.get_value("CISM_USE_TRILINOS")
mpasli_use_albany = case.get_value("MPASLI_USE_ALBANY")
use_moab = case.get_value("USE_MOAB")
clm_config_opts = case.get_value("CLM_CONFIG_OPTS")
cam_config_opts = case.get_value("CAM_CONFIG_OPTS")
pio_config_opts = case.get_value("PIO_CONFIG_OPTS")
Expand Down Expand Up @@ -460,6 +461,7 @@ def _case_build_impl(caseroot, case, sharedlib_only, model_only):
os.environ["CLM_USE_PETSC"] = stringify_bool(clm_use_petsc)
os.environ["CISM_USE_TRILINOS"] = stringify_bool(cism_use_trilinos)
os.environ["MPASLI_USE_ALBANY"] = stringify_bool(mpasli_use_albany)
os.environ["USE_MOAB"] = stringify_bool(use_moab)

if get_model() == "acme" and mach == "titan" and compiler == "pgiacc":
case.set_value("CAM_TARGET", "preqx_acc")
Expand Down
9 changes: 9 additions & 0 deletions src/drivers/mct/cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,15 @@
machines.</desc>
</entry>

<entry id="USE_MOAB">
<type>logical</type>
<valid_values>TRUE,FALSE</valid_values>
<default_value>FALSE</default_value>
<group>build_def</group>
<file>env_build.xml</file>
<desc>TRUE implies linking to the MOAB library</desc>
</entry>

<entry id="USE_TRILINOS">
<type>logical</type>
<valid_values>TRUE,FALSE</valid_values>
Expand Down
2 changes: 1 addition & 1 deletion utils/perl5lib/compilers_translation_tool.pl
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ sub two_spaces_node {
"MPI_PATH", "MPICC", "MPICXX", "MPIFC", "NETCDF_PATH",
"PAPI_INC", "PAPI_LIB", "PETSC_PATH", "PFUNIT_PATH",
"PIO_FILESYSTEM_HINTS", "PNETCDF_PATH", "SCC", "SCXX",
"SFC", "SUPPORTS_CXX", "TRILINOS_PATH");
"SFC", "SUPPORTS_CXX", "TRILINOS_PATH", "MOAB_PATH");

# Function to merge a compiler element from the old format into the new one.
sub merge_element {
Expand Down

0 comments on commit bee6d17

Please sign in to comment.