Skip to content

Commit

Permalink
C++/Kokkos: Refine a few build pieces. (PR #2894)
Browse files Browse the repository at this point in the history
1. Add KOKOS_CXXFLAGS to CXXFLAGS.
2. Add CPPDEFS to CXXFLAGS.
3. Do not add CFLAGS to CXXFLAGS.
4. For default build (i.e., no KOKKOS_OPTIONS provided), build Kokkos --with-openmp only if case.get_build_threaded().

[BFB]
  • Loading branch information
jgfouca authored May 2, 2019
2 parents 4d4872c + e922850 commit 9057073
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/Tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ endif
ifeq ($(strip $(USE_KOKKOS)), TRUE)
include $(INSTALL_SHAREDPATH)/Makefile.kokkos
SLIBS += $(KOKKOS_LIBS)
CFLAGS += $(KOKKOS_CXXFLAGS)
CXXFLAGS += $(KOKKOS_CXXFLAGS)
CXX_LDFLAGS += $(KOKKOS_LDFLAGS)
endif

Expand Down Expand Up @@ -509,7 +509,7 @@ INCLDIR += -I$(INSTALL_SHAREDPATH)/include
# Use the MCT dir for the cache for all configure calls because it is the first one
#
CFLAGS+=$(CPPDEFS)
CXXFLAGS+=$(CFLAGS)
CXXFLAGS+=$(CPPDEFS)
CONFIG_ARGS += CC="$(CC)" FC="$(FC)" MPICC="$(MPICC)" \
MPIFC="$(MPIFC)" FCFLAGS="$(FFLAGS) $(FREEFLAGS) $(INCLDIR)" \
CPPDEFS="$(CPPDEFS)" CFLAGS="$(CFLAGS) -I.. $(INCLDIR)" \
Expand Down
9 changes: 7 additions & 2 deletions src/build_scripts/buildlib.kokkos
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ def buildlib(bldroot, installpath, case):
if stat == 0:
kokkos_options = output.split(":=")[-1].strip()
else:
kokkos_options = "--with-openmp --with-serial" # This is the default
logger.warning("Failed to find custom kokkos options, using default.")
# This is the default setup.
kokkos_options = "--with-serial"
build_threaded = case.get_build_threaded()
if build_threaded:
kokkos_options += " --with-openmp"
logger.warning("Failed to find custom kokkos options, using default: {:s}.".
format(kokkos_options))

cxx = run_cmd_no_fail("make -f Macros.make {} -p | grep SCXX".format(make_args)).split(":=")[-1].strip()

Expand Down

0 comments on commit 9057073

Please sign in to comment.