configure.ac 4.08 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
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
18
# pkg-config and libraries supporting that
Rob Latham's avatar
Rob Latham committed
19 20 21 22
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45
# coreutils checks for OSX
AC_ARG_VAR([TIMEOUT], timeout program)
AC_ARG_VAR([MKTEMP], mktemp program)

if test -z "$TIMEOUT" ; then
    AC_CHECK_PROGS(TIMEOUT, [timeout gtimeout])
    if test -z "$TIMEOUT" ; then
        AC_MSG_ERROR([Could not find timeout command (can optionally provide via the TIMEOUT variable)])
    fi
else
    AC_SUBST([TIMEOUT], ["$TIMEOUT"])
fi

if test -z "$MKTEMP" ; then
    AC_CHECK_PROGS(MKTEMP, [mktemp gmktemp])
    if test -z "$MKTEMP" ; then
        AC_MSG_ERROR([Could not find mktemp command (can optionally provide via the MKTEMP variable)])
    fi
else
    AC_SUBST([MKTEMP], ["$MKTEMP"])
fi

46 47 48 49 50 51 52 53
# 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!])])

54 55 56
dnl seems like this should be a function but my first stab at m4 exploded
dnl mightily...

Rob Latham's avatar
Rob Latham committed
57 58 59 60 61 62 63 64 65 66 67 68
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"

69 70 71 72 73
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
74

75
PKG_CHECK_MODULES([SDSKEYVALSERVER],[kv-server],[],
76
	AC_MSG_ERROR([Could not find working sds-keyval server installation!]) )
77 78 79
SERVER_LIBS="$SDSKEYVALSERVER_LIBS $SERVER_LIBS"
SERVER_CPPFLAGS="$SDSKEYVALSERVER_CFLAGS $SERVER_CPPFLAGS"
SERVER_CFLAGS="$SDSKEYVALSERVER_CFLAGS $SERVER_CFLAGS"
80 81 82

PKG_CHECK_MODULES([SDSKEYVALCLIENT],[kv-client],[],
	AC_MSG_ERROR([Could not find working sds-keyval client installation!]) )
83 84 85
SERVER_LIBS="$SDSKEYVALCLIENT_LIBS $SERVER_LIBS"
SERVER_CPPFLAGS="$SDSKEYVALCLIENT_CFLAGS $SERVER_CPPFLAGS"
SERVER_CFLAGS="$SDSKEYVALCLIENT_CFLAGS $SERVER_CFLAGS"
86

87 88
PKG_CHECK_MODULES([PMEM],[libpmemobj],[],
	AC_MSG_ERROR([Could not find working libpmemobj installation!]) )
89 90 91
SERVER_LIBS="$PMEM_LIBS $SERVER_LIBS"
SERVER_CPPFLAGS="$PMEM_CFLAGS $SERVER_CPPFLAGS"
SERVER_CFLAGS="$PMEM_CFLAGS $SERVER_CFLAGS"
92 93 94

PKG_CHECK_MODULES([BAKE],[bake-bulk-server],[],
	AC_MSG_ERROR([Could not find working BAKE installation!]) )
95
SERVER_LIBS="$BAKE_LIBS $SERVER_LIBS"
96 97
SERVER_CPPFLAGS="$BAKE_CFLAGS $SERVER_CPPFLAGS"
SERVER_CFLAGS="$BAKE_CFLAGS $SERVER_CFLAGS"
98

99 100 101 102
# 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!])])
103

104 105 106 107 108 109
# 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
110
    AC_CHECK_HEADERS([rados/librados.h rados/rados_types.h],
111 112 113 114 115 116 117 118
        [],
        [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
119

120 121 122
# both found, set output to additionally build tests against RADOS
AM_CONDITIONAL(HAVE_RADOS, test x"$with_rados" == "xyes")

123 124
AC_SUBST(SERVER_LIBS)
AC_SUBST(CLIENT_LIBS)
Rob Latham's avatar
Rob Latham committed
125 126
AC_CONFIG_FILES([Makefile])
AC_OUTPUT