configure.ac 4.76 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
LT_PREREQ([2.2])
AM_PROG_AR
LT_INIT([dlopen])

# checks for programs
AC_PROG_CC
AM_PROG_CC_C_O
Matthieu Dorier's avatar
Matthieu Dorier committed
15
AC_PROG_CXX
Rob Latham's avatar
Rob Latham committed
16 17
AC_PROG_INSTALL

18 19 20
# check for C++14
AX_CXX_COMPILE_STDCXX_14

Rob Latham's avatar
Rob Latham committed
21
# checks for libraires
22
# pkg-config and libraries supporting that
Rob Latham's avatar
Rob Latham committed
23 24 25 26
PKG_PROG_PKG_CONFIG
if test "x$PKG_CONFIG" == "x"; then
	AC_MSG_ERROR([Could not find pkg-config utility!])
fi
27

28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
# 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

50 51 52 53 54 55 56 57
# 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!])])

58 59 60
dnl seems like this should be a function but my first stab at m4 exploded
dnl mightily...

Rob Latham's avatar
Rob Latham committed
61 62 63 64 65 66 67 68 69 70 71 72
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"

73 74 75 76 77
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
78

79
PKG_CHECK_MODULES([SDSKEYVALSERVER],[sdskv-server],[],
80
	AC_MSG_ERROR([Could not find working sds-keyval server installation!]) )
Matthieu Dorier's avatar
Matthieu Dorier committed
81
SERVER_LIBS="$SDSKEYVALSERVER_LIBS $SERVER_LIBS"
82 83
SERVER_CPPFLAGS="$SDSKEYVALSERVER_CFLAGS $SERVER_CPPFLAGS"
SERVER_CFLAGS="$SDSKEYVALSERVER_CFLAGS $SERVER_CFLAGS"
84

85
PKG_CHECK_MODULES([SDSKEYVALCLIENT],[sdskv-client],[],
86
	AC_MSG_ERROR([Could not find working sds-keyval client installation!]) )
87 88 89
SERVER_LIBS="$SDSKEYVALCLIENT_LIBS $SERVER_LIBS"
SERVER_CPPFLAGS="$SDSKEYVALCLIENT_CFLAGS $SERVER_CPPFLAGS"
SERVER_CFLAGS="$SDSKEYVALCLIENT_CFLAGS $SERVER_CFLAGS"
90

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

97
PKG_CHECK_MODULES([BAKESERVER],[bake-server],[],
98 99 100 101 102
	AC_MSG_ERROR([Could not find working BAKE server installation!]) )
SERVER_LIBS="$BAKESERVER_LIBS $SERVER_LIBS"
SERVER_CPPFLAGS="$BAKESERVER_CFLAGS $SERVER_CPPFLAGS"
SERVER_CFLAGS="$BAKESERVER_CFLAGS $SERVER_CFLAGS"

103
PKG_CHECK_MODULES([BAKECLIENT],[bake-client],[],
104 105 106 107
	AC_MSG_ERROR([Could not find working BAKE client installation!]) )
SERVER_LIBS="$BAKECLIENT_LIBS $SERVER_LIBS"
SERVER_CPPFLAGS="$BAKECLIENT_CFLAGS $SERVER_CPPFLAGS"
SERVER_CFLAGS="$BAKECLIENT_CFLAGS $SERVER_CFLAGS"
108

109 110 111 112 113
PKG_CHECK_MODULES([CHPLACEMENT], [ch-placement], [],
	AC_MSG_ERROR([Could not find ch-placement]) )
CLIENT_CFLAGS="$CHPLACEMENT_CFLAGS $CLIENT_CFLAGS"
CLIENT_LIBS="$CHPLACEMENT_LIBS $CLIENT_LIBS"

114 115 116 117
# 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!])])
118

119 120 121 122 123 124
# 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
125
    AC_CHECK_HEADERS([rados/librados.h rados/rados_types.h],
126 127 128 129 130 131 132 133
        [],
        [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
134

135 136 137
# both found, set output to additionally build tests against RADOS
AM_CONDITIONAL(HAVE_RADOS, test x"$with_rados" == "xyes")

138 139
AC_SUBST(SERVER_LIBS)
AC_SUBST(CLIENT_LIBS)
140 141 142 143
AC_SUBST(SERVER_CPPFLAGS)
AC_SUBST(CLIENT_CPPFLAGS)
AC_SUBST(SERVER_CFLAGS)
AC_SUBST(CLIENT_CFLAGS)
Matthieu Dorier's avatar
Matthieu Dorier committed
144
AC_CONFIG_FILES([Makefile maint/mobject-store.pc maint/mobject-server.pc])
Rob Latham's avatar
Rob Latham committed
145
AC_OUTPUT