Skip to content

Commit

Permalink
build: adds PerfFlow Aspect support via a new m4 macro
Browse files Browse the repository at this point in the history
  • Loading branch information
ilumsden committed Aug 2, 2022
1 parent 0e6fd83 commit 95abde7
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 208 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,5 @@ compile_flags.txt

# ignore installable version of dyadrun
dyadrun
cpa_dump
flux_barrier
18 changes: 18 additions & 0 deletions config/ax_perfflow_aspect.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
AC_DEFUN([AX_PERFFLOW_ASPECT], [
PKG_CHECK_MODULES([$1], [perfflowaspect],
[
$1_WEAVEPASS=`pkg-config --variable=weavepass perfflowaspect`
if test ! -e "${$1_WEAVEPASS}"; then
AC_MSG_ERROR([Cannot find libWeavePass.so!])
fi
$1_PLUGIN_CPPFLAGS="-Xclang -load -Xclang ${$1_WEAVEPASS} -fPIC"
AC_MSG_NOTICE([Flags are ${$1_PLUGIN_CPPFLAGS}])
AC_SUBST($1_WEAVEPASS)
AC_SUBST($1_PLUGIN_CPPFLAGS)
$2
],
[
$3
]
)
])
14 changes: 14 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ AC_ARG_ENABLE([urpc],
[enable_urpc=$enableval],
[enable_urpc=no]
)
AC_ARG_ENABLE([perfflow],
[AS_HELP_STRING([--enable-perfflow],
[enable performance measurement with PerfFlow Aspect])],
[enable_perfflow=$enableval],
[enable_perfflow=no]
)
# TODO Add support for libb64 back once base64 encoding/decoding is fully complete
# AC_ARG_VAR([LIBB64_DIR], [root directory for libb64])

Expand All @@ -88,6 +94,14 @@ if test "x$enable_urpc" = "xyes" && test "x$pkg_check_jansson_found" = "xno"; th
AC_MSG_ERROR([jansson cannot be located, but it is required when '--enable-urpc' is provided])
fi
AM_CONDITIONAL([URPC], [test "x$enable_urpc" = "xyes"])
AX_PERFFLOW_ASPECT([PERFFLOW],
[pkg_check_perfflow_found=yes],
[pkg_check_perfflow_found=no]
)
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
AM_CONDITIONAL([PERFFLOW], [test "x$enable_perfflow" = "xyes"])

###########################
# Checks for header files #
Expand Down
8 changes: 0 additions & 8 deletions old_makefiles/Makefile

This file was deleted.

16 changes: 0 additions & 16 deletions old_makefiles/src/Makefile

This file was deleted.

26 changes: 0 additions & 26 deletions old_makefiles/src/common/Makefile

This file was deleted.

16 changes: 0 additions & 16 deletions old_makefiles/src/common/libtap/Makefile

This file was deleted.

52 changes: 0 additions & 52 deletions old_makefiles/src/lib/Makefile

This file was deleted.

40 changes: 0 additions & 40 deletions old_makefiles/src/modules/Makefile

This file was deleted.

50 changes: 0 additions & 50 deletions old_makefiles/src/wrapper/Makefile

This file was deleted.

8 changes: 8 additions & 0 deletions src/lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@ lib_LTLIBRARIES = libdyad_fstream.la
libdyad_fstream_la_SOURCES = dyad_stream_core.cpp
libdyad_fstream_la_LIBADD = $(FLUX_CORE_LIBS) $(top_builddir)/src/common/libutils.la $(top_builddir)/src/common/libmurmur3.la
libdyad_fstream_la_CPPFLAGS = $(FLUX_CORE_CFLAGS) -DDYAD_CHECK=1 -I$(top_builddir)/src/common
if PERFFLOW
libdyad_fstream_la_LIBADD += $(PERFFLOW_LIBS)
libdyad_fstream_la_CPPFLAGS += $(PERFFLOW_PLUGIN_CPPFLAGS) $(PERFFLOW_CFLAGS) -DDYAD_PERFFLOW=1
endif

if URPC
lib_LTLIBRARIES += liburpc_client.la
liburpc_client_la_SOURCES = urpc_client.c urpc_client.hpp
liburpc_client_la_LIBADD = $(FLUX_CORE_LIBS) $(top_builddir)/src/common/libutils.la
liburpc_client_la_CPPFLAGS = $(FLUX_CORE_CFLAGS) -DURPC_CHECK=1 -I$(top_builddir)/src/common
if PERFFLOW
liburpc_client_la_LIBADD += $(PERFFLOW_LIBS)
liburpc_client_la_CPPFLAGS += $(PERFFLOW_PLUGIN_CPPFLAGS) $(PERFFLOW_CFLAGS) -DDYAD_PERFFLOW=1
endif
endif

include_HEADERS = dyad_stream_core.hpp dyad_stream_api.hpp dyad_params.hpp
9 changes: 9 additions & 0 deletions src/modules/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ dyad_la_SOURCES = dyad.c read_all.c dyad_ctx.h read_all.h
dyad_la_LDFLAGS = -module -avoid-version -no-undefined
dyad_la_LIBADD = $(top_builddir)/src/common/libutils.la $(FLUX_CORE_LIBS)
dyad_la_CPPFLAGS = $(FLUX_CORE_CFLAGS) -I$(top_builddir)/src/common
if PERFFLOW
dyad_la_LIBADD += $(PERFFLOW_LIBS)
dyad_la_CPPFLAGS += $(PERFFLOW_PLUGIN_CPPFLAGS) $(PERFFLOW_CFLAGS) -DDYAD_PERFFLOW=1
endif

if URPC
lib_LTLIBRARIES += urpc.la
urpc_la_SOURCES = read_all.c urpc.c urpc_ctx.h
Expand All @@ -15,4 +20,8 @@ urpc_la_LIBADD = $(top_builddir)/src/common/libutils.la $(FLUX_CORE_LIBS) $(JANS
# TODO replace current CPPFLAGS rule with this one once libb64 is required
# urpc_la_CPPFLAGS = $(FLUX_CORE_CFLAGS) $(JANSSON_CFLAGS) -I$(LIBB64_DIR)/include -I$(top_builddir)/src/common
urpc_la_CPPFLAGS = $(FLUX_CORE_CFLAGS) $(JANSSON_CFLAGS) -I$(top_builddir)/src/common
if PERFFLOW
urpc_la_LIBADD += $(PERFFLOW_LIBS)
urpc_la_CPPFLAGS += $(PERFFLOW_PLUGIN_CPPFLAGS) $(PERFFLOW_CFLAGS) -DDYAD_PERFFLOW=1
endif
endif
4 changes: 4 additions & 0 deletions src/wrapper/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ lib_LTLIBRARIES = libdyad_sync.la
libdyad_sync_la_SOURCES = wrapper.c wrapper.h dyad_ctx.h
libdyad_sync_la_LIBADD = $(top_builddir)/src/common/libutils.la $(top_builddir)/src/common/libmurmur3.la $(FLUX_CORE_LIBS)
libdyad_sync_la_CPPFLAGS = $(FLUX_CORE_CFLAGS) -DDYAD_CHECK=1 -I$(top_builddir)/src/common
if PERFFLOW
libdyad_sync_la_LIBADD += $(PERFFLOW_LIBS)
libdyad_sync_la_CPPFLAGS += $(PERFFLOW_PLUGIN_CPPFLAGS) $(PERFFLOW_CFLAGS) -DDYAD_PERFFLOW=1
endif

bin_PROGRAMS = flux_barrier
flux_barrier_SOURCES = flux_barrier.c
Expand Down

0 comments on commit 95abde7

Please sign in to comment.