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

Caliper Integration #39

Closed
wants to merge 18 commits into from
Closed
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: 2 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ AllowShortLoopsOnASingleLine : false
BinPackParameters : false
AllowAllParametersOfDeclarationOnNextLine : false
AlignTrailingComments : true
ColumnLimit : 80
ColumnLimit : 88

# do not put all arguments on one line unless it's the same line as the call
PenaltyBreakBeforeFirstCallParameter : 10000000
Expand All @@ -20,7 +20,7 @@ PenaltyBreakString : 10
# These improve formatting results but require clang 3.6/7 or higher
BreakBeforeBinaryOperators : NonAssignment
AlignAfterOpenBracket: true
BinPackArguments : true
BinPackArguments : false
AlignOperands : true
BreakBeforeTernaryOperators : true
AllowAllParametersOfDeclarationOnNextLine : false
59 changes: 54 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,56 @@ AC_ARG_ENABLE([perfflow],
[enable_perfflow=$enableval],
[enable_perfflow=no]
)
AC_ARG_ENABLE(caliper,
[AS_HELP_STRING([--enable-caliper[=OPTS]],
[Use caliper for profiling. [default=no] [OPTS=no/yes]])],
,
[enable_caliper="no"]
)
# TODO Add support for libb64 back once base64 encoding/decoding is fully complete
# AC_ARG_VAR([LIBB64_DIR], [root directory for libb64])

#############################################
# Define PKG_CHECK_VAR if it does not exist #
#############################################

# Macro is copied from https://github.com/pkgconf/pkgconf/blob/master/pkg.m4
# with minor modifications to change comments from using 'dnl' to '#'
m4_ifndef([PKG_CHECK_VAR], [
# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# -------------------------------------------
# Since: 0.28
#
# Retrieves the value of the pkg-config variable for the given module.
AC_DEFUN([PKG_CHECK_VAR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])# End of PKG_CHECK_VAR
])

########################
# Checks for libraries #
########################
# Check for the dl library (specifically, the "dlsym" function)
AC_CHECK_LIB([dl], [dlsym])
# FIXME: Replace 'main' with a function in '-ldyad_fstream':
# AC_CHECK_LIB([dyad_fstream], [main])
# FIXME: Replace 'main' with a function in '-ltap':
# AC_CHECK_LIB([tap], [main])
# Check for UCX v1.6.0 or higher (Required)
# TODO: make UCX optional based on a new AC_ARG_ENABLE flag
PKG_CHECK_MODULES([UCX],
[ucx >= 1.6.0]
)
PKG_CHECK_VAR([UCX_LIBDIR],
[ucx >= 1.6.0],
[libdir],
[],
[AC_MSG_FAILURE([Could not find libdir for UCX])]
)
AS_IF([test "x$UCX_LIBDIR" = "x"],
[AC_MSG_FAILURE([check_var succeeded, but value is incorrect])]
)
# Find and get info for Flux-Core using pkg-config
AX_FLUX_CORE
PKG_CHECK_MODULES([JANSSON],
Expand All @@ -102,6 +140,14 @@ AX_PERFFLOW_ASPECT([PERFFLOW],
if test "x$enable_perfflow" = "xyes" && test "x$pkg_check_perfflow_found" = "xno"; then
AC_MSG_ERROR([requested PerfFlow Aspect support, but cannot find PerfFlow Aspect with pkg-config])
fi
if test "$enable_caliper" = "yes"; then
PKG_CHECK_MODULES([CALIPER], [caliper], [], [])
CFLAGS="${CFLAGS} ${CALIPER_CFLAGS} "
CXXFLAGS="${CXXFLAGS} ${CALIPER_CFLAGS} "
# Do not use CALIPER_LIBS, only link to libcaliper-stub
LIBS="${LIBS} ${CALIPER_LIBS} -lrt "
AC_DEFINE([HAVE_CALIPER], [1], [Define if you have libcaliper])
fi
AM_CONDITIONAL([PERFFLOW], [test "x$enable_perfflow" = "xyes"])

###########################
Expand Down Expand Up @@ -153,7 +199,8 @@ AC_CHECK_FUNCS( \
# Add any necessary compilation flags #
#######################################
if test "x$enable_debug" = xyes; then
CPPFLAGS="$CPPFLAGS -DDYAD_FULL_DEBUG=1 -DDYAD_LOGGING_ON=1"
CFLAGS="$CFLAGS -DDYAD_FULL_DEBUG=1 -DDYAD_LOGGING_ON=1"
CXXFLAGS="$CXXFLAGS -DDYAD_FULL_DEBUG=1 -DDYAD_LOGGING_ON=1"
fi

########################
Expand All @@ -162,7 +209,9 @@ fi
AC_CONFIG_FILES([Makefile
src/Makefile
src/utils/Makefile
src/utils/base64/Makefile
src/utils/libtap/Makefile
src/dtl/Makefile
src/core/Makefile
src/stream/Makefile
src/modules/Makefile
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SUBDIRS = utils modules core wrapper stream
SUBDIRS = utils dtl modules core wrapper stream
30 changes: 24 additions & 6 deletions src/core/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
lib_LTLIBRARIES = libdyad_core.la
libdyad_core_la_SOURCES = dyad_core.c
libdyad_core_la_LIBADD = $(top_builddir)/src/utils/libutils.la $(top_builddir)/src/utils/libmurmur3.la $(FLUX_CORE_LIBS)
libdyad_core_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_builddir)/src/utils $(FLUX_CORE_CFLAGS)
libdyad_core_la_LDFLAGS = -export-symbols dyad_core.sym $(AM_LDFLAGS)
libdyad_core_la_SOURCES = \
dyad_core.c
libdyad_core_la_LIBADD = \
$(top_builddir)/src/dtl/libdyad_dtl.la \
$(UCX_LIBS) \
$(JANSSON_LIBS) \
$(FLUX_CORE_LIBS)
libdyad_core_la_CFLAGS = \
$(AM_CFLAGS) \
-I$(top_srcdir)/src/utils \
-I$(top_srcdir)/src/utils/base64 \
-I$(top_srcdir)/src/dtl \
$(UCX_CFLAGS) \
$(JANSSON_CFLAGS) \
$(FLUX_CORE_CFLAGS) \
-DBUILDING_DYAD=1 \
-fvisibility=hidden
libdyad_core_la_CPPFLAGS =
libdyad_core_la_LDFLAGS = \
-Wl,-rpath,'$(UCX_LIBDIR)' \
$(AM_LDFLAGS)
if PERFFLOW
libdyad_core_la_LIBADD += $(PERFFLOW_LIBS)
libdyad_core_la_CPPFLAGS += $(PERFFLOW_PLUGIN_CPPFLAGS) $(PERFFLOW_CFLAGS) -DDYAD_PERFFLOW=1
libdyad_core_la_CFLAGS += $(PERFFLOW_CFLAGS) -DDYAD_PERFFLOW=1
libdyad_core_la_CPPFLAGS += $(PERFFLOW_PLUGIN_CPPFLAGS)
endif

include_HEADERS = dyad_core.h dyad_envs.h dyad_rc.h dyad_flux_log.h
include_HEADERS = dyad_core.h dyad_envs.h
Loading