configure.ac 3.02 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.63])
AC_INIT([sds-tests], [0.1], [],[],[]) 
AC_CONFIG_MACRO_DIR([m4])
LT_INIT

AC_CANONICAL_TARGET
AC_CANONICAL_SYSTEM
AC_CANONICAL_HOST

AM_INIT_AUTOMAKE([foreign subdir-objects -Wall])

# we should remove this soon, only needed for automake 1.10 and older
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AC_CONFIG_SRCDIR([README.md])
19
AC_CONFIG_HEADERS([sds-tests-config.h])
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_CXXCPP

AC_PROG_MKDIR_P
AC_REQUIRE_CPP

AC_CHECK_SIZEOF([long int])

dnl
dnl Verify pkg-config
dnl
PKG_PROG_PKG_CONFIG
if test "x$PKG_CONFIG" == "x"; then
   AC_MSG_ERROR([Could not find pkg-config utility!])
fi

Philip Carns's avatar
Philip Carns committed
40 41
PKG_CHECK_MODULES([MARGO],[margo],[have_margo=1],
   [AC_MSG_WARN([Could not find working margo installation])])
42 43 44 45
LIBS="$MARGO_LIBS $LIBS"
CPPFLAGS="$MARGO_CFLAGS $CPPFLAGS"
CFLAGS="$MARGO_CFLAGS $CFLAGS"

Philip Carns's avatar
Philip Carns committed
46 47
PKG_CHECK_MODULES([SSG],[ssg],[have_ssg=1],
   [AC_MSG_WARN([Could not find working ssg installation])])
48 49 50 51
LIBS="$SSG_LIBS $LIBS"
CPPFLAGS="$SSG_CFLAGS $CPPFLAGS"
CFLAGS="$SSG_CFLAGS $CFLAGS"

Philip Carns's avatar
Philip Carns committed
52 53
AC_CHECK_HEADERS(ssg-mpi.h,[have_ssg_mpi=1],
  [AC_MSG_WARN([Could not find ssg-mpi.h for MPI support in SSG])])
54

Philip Carns's avatar
Philip Carns committed
55 56
PKG_CHECK_MODULES([BAKESERVER],[bake-server],[have_bake_server=1],
        AC_MSG_WARN([Could not find working BAKE server installation]) )
Philip Carns's avatar
Philip Carns committed
57 58 59 60
LIBS="$BAKESERVER_LIBS $LIBS"
CPPFLAGS="$BAKESERVER_CFLAGS $CPPFLAGS"
CFLAGS="$BAKESERVER_CFLAGS $CFLAGS"

Philip Carns's avatar
Philip Carns committed
61 62
PKG_CHECK_MODULES([BAKECLIENT],[bake-client],[have_bake_client=1],
        AC_MSG_WARN([Could not find working BAKE client installation]) )
Philip Carns's avatar
Philip Carns committed
63 64 65 66
LIBS="$BAKECLIENT_LIBS $LIBS"
CPPFLAGS="$BAKECLIENT_CFLAGS $CPPFLAGS"
CFLAGS="$BAKECLIENT_CFLAGS $CFLAGS"

Philip Carns's avatar
Philip Carns committed
67 68 69 70 71 72 73 74
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])])
75 76 77 78
LIBS="$LIBPMEMOBJ_LIBS $LIBS"
CPPFLAGS="$LIBPMEMOBJ_CFLAGS $CPPFLAGS"
CFLAGS="$LIBPMEMOBJ_CFLAGS $CFLAGS"

79 80 81
AC_MSG_CHECKING([If MPI programs can be compiled])
AC_LINK_IFELSE(
    [AC_LANG_PROGRAM([[#include<mpi.h>]], [[MPI_Init(0,0);]])],
Philip Carns's avatar
Philip Carns committed
82
    [have_mpi=1
83
     AC_MSG_RESULT([yes])],
Philip Carns's avatar
Philip Carns committed
84 85 86 87 88 89 90
    [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])
91 92 93 94

AC_CONFIG_FILES([Makefile])
AC_OUTPUT