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

Add interactive SST-info #1033

Merged
merged 3 commits into from
Jan 24, 2024
Merged
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
37 changes: 37 additions & 0 deletions config/ax_require_defined.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_require_defined.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_REQUIRE_DEFINED(MACRO)
#
# DESCRIPTION
#
# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
# been defined and thus are available for use. This avoids random issues
# where a macro isn't expanded. Instead the configure script emits a
# non-fatal:
#
# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
#
# It's like AC_REQUIRE except it doesn't expand the required macro.
#
# Here's an example:
#
# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
#
# LICENSE
#
# Copyright (c) 2014 Mike Frysinger <[email protected]>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 2

AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
])dnl AX_REQUIRE_DEFINED
52 changes: 52 additions & 0 deletions config/sst_check_curses.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
AC_DEFUN([SST_CHECK_CURSES],
[
sst_check_curses_happy="yes"

AC_ARG_WITH([curses],
[AS_HELP_STRING([--with-ncurses@<:@=DIR@:>@],
[Use ncurses library found in DIR])])

AS_IF([test "$with_curses" = "no"], [sst_check_curses_happy="no"])

CPPFLAGS_saved="$CPPFLAGS"
LDFLAGS_saved="$LDFLAGS"

dnl Use user-defined curses library
AS_IF([test "$sst_check_curses_happy" = "yes"], [
AS_IF([test ! -z "$with_curses" -a "$with_curses" != "yes"],
[CURSES_CPPFLAGS="-I$with_curses/include"
CPPFLAGS="$CURSES_CPPFLAGS $CPPFLAGS"
CURSES_LDFLAGS="-L$with_curses/lib"
CURSES_LIBS="-lncurses",
LDFLAGS="$CURSES_LDFLAGS $LDFLAGS"],
[CURSES_CPPFLAGS=
CURSES_CPPFLAGS_LDFLAGS=
CURSES_LIBS=])])

dnl Check for curses.h header
AC_LANG_PUSH([C++])
AC_CHECK_HEADER([curses.h], [], [sst_check_curses_happy="no"])
AC_LANG_POP([C++])

dnl Check that library is usable
AS_IF([test "$sst_check_curses_happy" != "no"],
[AC_CHECK_LIB([ncursesw], [wprintw], [CURSES_LIBS="-lncursesw"],
[AC_CHECK_LIB([ncurses], [wprintw], [CURSES_LIBS="-lncurses"],
[AC_CHECK_LIB([curses], [wprintw], [CURSES_LIBS="-lcurses"], [sst_check_curses_happy = "no"])])])
])

CPPFLAGS="$CPPFLAGS_saved"
LDFLAGS="$LDFLAGS_saved"

AC_SUBST([CURSES_CPPFLAGS])
AC_SUBST([CURSES_LDFLAGS])
AC_SUBST([CURSES_LIBS])
AS_IF([test "x$sst_check_curses_happy" = "xyes"], [AC_DEFINE([HAVE_CURSES], [1], [Defines whether we have the curses library])])
AM_CONDITIONAL([USE_CURSES], [test "x$sst_check_curses_happy" = "xyes"])

AC_MSG_CHECKING([for curses library])
AC_MSG_RESULT([$sst_check_curses_happy])

AS_IF([test "$sst_check_curses_happy" = "no" -a ! -z "$with_curses" -a "$with_curses" != "no"], [$3])
AS_IF([test "$sst_check_curses_happy" = "yes"], [$1], [$2])
])
8 changes: 8 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ SST_CHECK_MPI([], [AC_MSG_ERROR([Could not find MPI package])])

SST_CHECK_PYTHON([], [AC_MSG_ERROR([Could not find Python, this is required for SST to build])])
SST_CHECK_LIBZ([have_zlib="yes"],[have_zlib="no"],[AC_MSG_ERROR([zlib was requested but could not be found.])])
SST_CHECK_CURSES()
dnl AC_MSG_ERROR([Could not find curses, this is required for utility sst-info to build])])
SST_CHECK_BACKTRACE()
SST_CHECK_HDF5()
SST_CHECK_MEM_POOL()
Expand Down Expand Up @@ -237,4 +239,10 @@ else
printf "%38s : No\n" "libz compression library"
fi

if test "x$sst_check_curses_happy" = "xyes" ; then
printf "%38s : Yes\n" "curses library"
else
printf "%38s : No\n" "curses library"
fi

echo "-------------------------------------------------------"
6 changes: 6 additions & 0 deletions src/sst/core/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,12 @@ sstsim_x_LDADD += $(LIBZ_LIBS)
sstinfo_x_LDADD += $(LIBZ_LIBS)
endif

if USE_CURSES
AM_CPPFLAGS += $(CURSES_CFPPLAGS)
sstinfo_x_LDADD += $(CURSES_LIBS)
sstinfo_x_LDFLAGS += $(CURSES_LDFLAGS)
endif

if USE_HDF5
AM_CPPFLAGS += $(HDF5_CFLAGS)
sstsim_x_SOURCES += statapi/statoutputhdf5.cc
Expand Down
Loading
Loading