Commit 7f9e061c authored by Philip Carns's avatar Philip Carns

conditionally compile tests

- check separately for requirements for the pmdk, margo, and bake benchmarks
- compile whichever ones are compatible with the environment
- this is meant to make it easier to run certain benchmarks in
  incomplete environments
parent 5d6999e7
......@@ -37,36 +37,41 @@ if test "x$PKG_CONFIG" == "x"; then
AC_MSG_ERROR([Could not find pkg-config utility!])
fi
PKG_CHECK_MODULES([MARGO],[margo],[],
[AC_MSG_ERROR([Could not find working margo installation!])])
PKG_CHECK_MODULES([MARGO],[margo],[have_margo=1],
[AC_MSG_WARN([Could not find working margo installation])])
LIBS="$MARGO_LIBS $LIBS"
CPPFLAGS="$MARGO_CFLAGS $CPPFLAGS"
CFLAGS="$MARGO_CFLAGS $CFLAGS"
PKG_CHECK_MODULES([SSG],[ssg],[],
[AC_MSG_ERROR([Could not find working ssg installation!])])
PKG_CHECK_MODULES([SSG],[ssg],[have_ssg=1],
[AC_MSG_WARN([Could not find working ssg installation])])
LIBS="$SSG_LIBS $LIBS"
CPPFLAGS="$SSG_CFLAGS $CPPFLAGS"
CFLAGS="$SSG_CFLAGS $CFLAGS"
AC_CHECK_HEADERS(ssg-mpi.h,[],
[AC_MSG_ERROR([Could not find ssg-mpi.h for MPI support in
SSG])])
AC_CHECK_HEADERS(ssg-mpi.h,[have_ssg_mpi=1],
[AC_MSG_WARN([Could not find ssg-mpi.h for MPI support in SSG])])
PKG_CHECK_MODULES([BAKESERVER],[bake-server],[],
AC_MSG_ERROR([Could not find working BAKE server installation!]) )
PKG_CHECK_MODULES([BAKESERVER],[bake-server],[have_bake_server=1],
AC_MSG_WARN([Could not find working BAKE server installation]) )
LIBS="$BAKESERVER_LIBS $LIBS"
CPPFLAGS="$BAKESERVER_CFLAGS $CPPFLAGS"
CFLAGS="$BAKESERVER_CFLAGS $CFLAGS"
PKG_CHECK_MODULES([BAKECLIENT],[bake-client],[],
AC_MSG_ERROR([Could not find working BAKE client installation!]) )
PKG_CHECK_MODULES([BAKECLIENT],[bake-client],[have_bake_client=1],
AC_MSG_WARN([Could not find working BAKE client installation]) )
LIBS="$BAKECLIENT_LIBS $LIBS"
CPPFLAGS="$BAKECLIENT_CFLAGS $CPPFLAGS"
CFLAGS="$BAKECLIENT_CFLAGS $CFLAGS"
PKG_CHECK_MODULES([LIBPMEMOBJ],[libpmemobj],[],
[AC_MSG_ERROR([Could not find working libpmemobj installation!])])
PKG_CHECK_MODULES([ARGOBOTS],[argobots],[have_argobots=1],
AC_MSG_WARN([Could not find working Argobots installation]) )
LIBS="$ARGOBOTS_LIBS $LIBS"
CPPFLAGS="$ARGOBOTS_CFLAGS $CPPFLAGS"
CFLAGS="$ARGOBOTS_CFLAGS $CFLAGS"
PKG_CHECK_MODULES([LIBPMEMOBJ],[libpmemobj],[have_libpmemobj=1],
[AC_MSG_WARN([Could not find working libpmemobj installation])])
LIBS="$LIBPMEMOBJ_LIBS $LIBS"
CPPFLAGS="$LIBPMEMOBJ_CFLAGS $CPPFLAGS"
CFLAGS="$LIBPMEMOBJ_CFLAGS $CFLAGS"
......@@ -74,9 +79,15 @@ CFLAGS="$LIBPMEMOBJ_CFLAGS $CFLAGS"
AC_MSG_CHECKING([If MPI programs can be compiled])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include<mpi.h>]], [[MPI_Init(0,0);]])],
[AC_DEFINE([HAVE_MPI], [1], [Define to 1 if compiled with MPI support])
[have_mpi=1
AC_MSG_RESULT([yes])],
[AC_MSG_ERROR([Unable to compile MPI programs, try CC=mpicc])])
[AC_MSG_WARN([Unable to compile MPI programs, try CC=mpicc])])
# enable or disable test programs that depend on different combinations of
# functionality
AM_CONDITIONAL([HAVE_MARGO], [test "x${have_mpi}" = x1 && test "x${have_margo}" = x1 && test "x${have_ssg}" = x1 && test "x${have_ssg_mpi}" = x1])
AM_CONDITIONAL([HAVE_BAKE], [test "x${have_mpi}" = x1 && test "x${have_bake_client}" = x1 && test "x${have_bake_server}" = x1 && test "x${have_ssg}" = x1 && test "x${have_ssg_mpi}" = x1])
AM_CONDITIONAL([HAVE_PMDK], [test "x${have_libpmemobj}" = x1 && test "x${have_argobots}" = x1])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
......
bin_PROGRAMS += perf-regression/margo-p2p-latency perf-regression/margo-p2p-bw perf-regression/bake-p2p-bw perf-regression/pmdk-bw
if HAVE_MARGO
bin_PROGRAMS += perf-regression/margo-p2p-latency perf-regression/margo-p2p-bw
endif
if HAVE_BAKE
bin_PROGRAMS += perf-regression/bake-p2p-bw
endif
if HAVE_PMDK
bin_PROGRAMS += perf-regression/pmdk-bw
endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment