diff --git a/config/sst_core_check_install.m4 b/config/sst_core_check_install.m4 index a1300e250a..21e5f9a317 100644 --- a/config/sst_core_check_install.m4 +++ b/config/sst_core_check_install.m4 @@ -8,6 +8,7 @@ AC_DEFUN([SST_CORE_CHECK_INSTALL], [ SST_CONFIG_TOOL="" SST_REGISTER_TOOL="" + SST_SNIPPETS_TOOL="" AS_IF( [test x"$with_sst_core" = "x/bin"], [AC_MSG_ERROR([User undefined path while using --with-sst-core], [1])], @@ -31,6 +32,13 @@ AC_DEFUN([SST_CORE_CHECK_INSTALL], [ [AC_MSG_RESULT([found $SST_REGISTER_TOOL])], [AC_MSG_ERROR([Unable to find sst-register in $with_sst_core], [1])]) + AC_PATH_PROG([SST_SNIPPETS_TOOL], [sst-snippets.py], [], [$with_sst_core]) + + AC_MSG_CHECKING([for sst-snippets.py tool available]) + AS_IF([test -x "$SST_SNIPPETS_TOOL"], + [AC_MSG_RESULT([found $SST_SNIPPETS_TOOL])], + [AC_MSG_ERROR([Unable to find sst-snippets.py in $with_sst_core], [1])]) + SST_CC=`$SST_CONFIG_TOOL --CC` SST_CXX=`$SST_CONFIG_TOOL --CXX` SST_MPICC=`$SST_CONFIG_TOOL --MPICC` @@ -65,6 +73,7 @@ AC_DEFUN([SST_CORE_CHECK_INSTALL], [ AC_SUBST([SST_CONFIG_TOOL]) AC_SUBST([SST_REGISTER_TOOL]) + AC_SUBST([SST_SNIPPETS_TOOL]) AC_SUBST([SST_PREFIX]) AM_CONDITIONAL([SST_ENABLE_PREVIEW_BUILD], [test "x$SST_PREVIEW_BUILD" = "xyes"]) diff --git a/configure.ac b/configure.ac index 017a19672f..485106ac1e 100644 --- a/configure.ac +++ b/configure.ac @@ -58,6 +58,8 @@ AS_IF([test "x$use_picky" = "xyes"], AM_CFLAGS="$AM_CFLAGS $WARNFLAGS" AM_CXXFLAGS="$AM_CXXFLAGS $WARNFLAGS" +AM_EXTRA_RECURSIVE_TARGETS([snippets]) + AC_MSG_CHECKING([for SST-Elements Git Branch, Head SHA and Commit Count]) if test -d ".git" ; then SSTELEMENTS_GIT_BRANCH=`git rev-parse --abbrev-ref HEAD` diff --git a/src/sst/elements/simpleElementExample/Makefile.am b/src/sst/elements/simpleElementExample/Makefile.am index 928e40105a..07a5f61453 100644 --- a/src/sst/elements/simpleElementExample/Makefile.am +++ b/src/sst/elements/simpleElementExample/Makefile.am @@ -73,6 +73,9 @@ install-exec-hook: $(SST_REGISTER_TOOL) SST_ELEMENT_SOURCE simpleElementExample=$(abs_srcdir) $(SST_REGISTER_TOOL) SST_ELEMENT_TESTS simpleElementExample=$(abs_srcdir)/tests +.PHONY: snippets +snippets: + $(SST_SNIPPETS_TOOL) $(abs_srcdir)/sst-snippets.json - - +clean-local: + -rm -rf snippets diff --git a/src/sst/elements/simpleElementExample/basicSimLifeCycle.h b/src/sst/elements/simpleElementExample/basicSimLifeCycle.h index cc2af213e5..07fba128e3 100644 --- a/src/sst/elements/simpleElementExample/basicSimLifeCycle.h +++ b/src/sst/elements/simpleElementExample/basicSimLifeCycle.h @@ -57,18 +57,21 @@ * - Use of printStatus() and emergencyShutdown() */ +// SSTSnippet::component-header::start #include #include - +// SSTSnippet::component-header::pause namespace SST { namespace simpleElementExample { // Components inherit from SST::Component +// SSTSnippet::component-header::start class basicSimLifeCycle : public SST::Component { public: +// SSTSnippet::component-header::pause /* * SST Registration macros register Components with the SST Core and @@ -105,11 +108,15 @@ class basicSimLifeCycle : public SST::Component // Class members // Constructor. Components receive a unique ID and the set of parameters that were assigned in the Python input. +// SSTSnippet::component-header::start basicSimLifeCycle(SST::ComponentId_t id, SST::Params& params); +// SSTSnippet::component-header::pause // Destructor +// SSTSnippet::component-header::start virtual ~basicSimLifeCycle(); +// SSTSnippet::component-header::pause // Called by SST during SST's init() lifecycle phase virtual void init(unsigned phase) override; @@ -132,10 +139,13 @@ class basicSimLifeCycle : public SST::Component void handleEvent(SST::Event *ev); +// SSTSnippet::component-header::start private: // Parameters unsigned eventsToSend; +// SSTSnippet::component-header::pause bool verbose; +// SSTSnippet::component-header::start // Component state unsigned eventsReceived; // Number of events we've received @@ -154,6 +164,7 @@ class basicSimLifeCycle : public SST::Component SST::Link* leftLink; SST::Link* rightLink; }; +// SSTSnippet::component-header::end } // namespace simpleElementExample } // namespace SST diff --git a/src/sst/elements/simpleElementExample/sst-snippets.json b/src/sst/elements/simpleElementExample/sst-snippets.json new file mode 100644 index 0000000000..f9a03f51e7 --- /dev/null +++ b/src/sst/elements/simpleElementExample/sst-snippets.json @@ -0,0 +1,6 @@ +{ "snippets" : { + "component-header" : { + "file" : "basicSimLifeCycle.h" + } + } +}