configure.ac 3.37 KB
Newer Older
Rob Latham's avatar
Rob Latham committed
1 2 3 4 5
AC_PREREQ([2.69])
AC_INIT([mobject], [0.1], [ssio-services@lists.mcs.anl.gov])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects silent-rules])
AM_SILENT_RULES([yes])
AC_CONFIG_MACRO_DIR([m4])
6 7
AC_CONFIG_SRCDIR([include/libmobject-store.h])
AC_CONFIG_HEADER([src/mobject-store-config.h])
Rob Latham's avatar
Rob Latham committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
LT_PREREQ([2.2])
AM_PROG_AR
LT_INIT([dlopen])

# checks for programs
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL

# checks for libraires
#pkg-config and libraries supporting that
PKG_PROG_PKG_CONFIG
if test "x$PKG_CONFIG" == "x"; then
	AC_MSG_ERROR([Could not find pkg-config utility!])
fi
23

24 25 26 27 28 29 30 31
# check for MPI -- currently required for SSG on server daemons
AC_MSG_CHECKING([If MPI programs can be compiled])
AC_LINK_IFELSE(
    [AC_LANG_PROGRAM([[#include<mpi.h>]], [[MPI_Init(0,0);]])],
    [AC_MSG_RESULT([yes])],
    [AC_MSG_RESULT([no])]
    [AC_MSG_ERROR([MPI compiler support currently required!])])

32 33 34 35 36
dnl seems like this should be a function but my first stab at m4 exploded
dnl mightily...
dnl also, we need to separate client libraries from server libraries.  Just jam
dnl it all into one set of flags for now

Rob Latham's avatar
Rob Latham committed
37 38 39 40 41 42 43 44 45 46 47 48
PKG_CHECK_MODULES([MARGO],[margo],[],
	AC_MSG_ERROR([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!]) )
LIBS="$SSG_LIBS $LIBS"
CPPFLAGS="$SSG_CFLAGS $CPPFLAGS"
CFLAGS="$SSG_CFLAGS $CFLAGS"

49 50 51 52 53
PKG_CHECK_MODULES([ARGOBOTS],[argobots],[],
	AC_MSG_ERROR([Could not find working argobots installation!]) )
LIBS="$ARGOBOTS_LIBS $LIBS"
CPPFLAGS="$ARGOBOTS_CFLAGS $CPPFLAGS"
CFLAGS="$ARGOBOTS_CFLAGS $CFLAGS"
Rob Latham's avatar
Rob Latham committed
54

55
PKG_CHECK_MODULES([SDSKEYVALSERVER],[kv-server],[],
56
	AC_MSG_ERROR([Could not find working sds-keyval server installation!]) )
57 58 59 60 61 62 63 64 65 66
LIBS="$SDSKEYVALSERVER_LIBS $LIBS"
CPPFLAGS="$SDSKEYVALSERVER_CFLAGS $CPPFLAGS"
CFLAGS="$SDSKEYVALSERVER_CFLAGS $CFLAGS"

PKG_CHECK_MODULES([SDSKEYVALCLIENT],[kv-client],[],
	AC_MSG_ERROR([Could not find working sds-keyval client installation!]) )
LIBS="$SDSKEYVALCLIENT_LIBS $LIBS"
CPPFLAGS="$SDSKEYVALCLIENT_CFLAGS $CPPFLAGS"
CFLAGS="$SDSKEYVALCLIENT_CFLAGS $CFLAGS"

67 68 69 70 71 72 73 74 75 76 77 78
PKG_CHECK_MODULES([PMEM],[libpmemobj],[],
	AC_MSG_ERROR([Could not find working libpmemobj installation!]) )
LIBS="$PMEM_LIBS $LIBS"
CPPFLAGS="$PMEM_CFLAGS $CPPFLAGS"
CFLAGS="$PMEM_CFLAGS $CFLAGS"

PKG_CHECK_MODULES([BAKE],[bake-bulk-server],[],
	AC_MSG_ERROR([Could not find working BAKE installation!]) )
LIBS="$BAKE_LIBS $LIBS"
CPPFLAGS="$BAKE_CFLAGS $CPPFLAGS"
CFLAGS="$BAKE_CFLAGS $CFLAGS"

79 80 81 82
# check that SSG was compiled with MPI support
AC_CHECK_LIB([ssg], [ssg_group_create_mpi],
    [],
    [AC_MSG_ERROR([SSG must be built with MPI support!])])
83

84 85 86 87 88 89
# check for RADOS
AC_ARG_WITH([rados],
    AS_HELP_STRING([--with_rados], [Additionally build tests against librados (default is no)]),
    [], [])
if test x"$with_rados" == "xyes" ; then
    # check for RADOS headers and libraries
90
    AC_CHECK_HEADERS([rados/librados.h rados/rados_types.h],
91 92 93 94 95 96 97 98
        [],
        [AC_MSG_ERROR([RADOS support requested but could not find RADOS headers!])],
        [])
    AC_CHECK_LIB([rados], [rados_create],
        [],
        [AC_MSG_ERROR([RADOS support requested but could not link against librados!])])

fi
Rob Latham's avatar
Rob Latham committed
99

100 101 102
# both found, set output to additionally build tests against RADOS
AM_CONDITIONAL(HAVE_RADOS, test x"$with_rados" == "xyes")

Rob Latham's avatar
Rob Latham committed
103 104
AC_CONFIG_FILES([Makefile])
AC_OUTPUT