-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
executable file
·132 lines (109 loc) · 4.03 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT([mochi-quintain], [0.3.0], [],[],[])
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])
AC_CONFIG_HEADERS([mochi-quintain-config.h])
# 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
# 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
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([JSONC],[json-c],[],
[AC_MSG_ERROR([Could not find working json-c installation!])])
LIBS="$JSONC_LIBS $LIBS"
dnl
dnl Note that pkg-config may report an include path that contains a
dnl "/json-c" component. If so, strip it out. We prefer to use an explicit
dnl subdir path in the source to to avoid potential header name conflicts
dnl with other json libraries.
dnl
JSONC_CFLAGS=`echo $JSONC_CFLAGS | sed 's/\/include\/json-c/\/include/g'`
CPPFLAGS="$JSONC_CFLAGS $CPPFLAGS"
CFLAGS="$JSONC_CFLAGS $CFLAGS"
PKG_CHECK_MODULES([BEDROCK], [bedrock-server >= 0.14.0],[],
[AC_MSG_ERROR([Could not find working bedrock installation!])])
LIBS="$BEDROCK_LIBS $LIBS"
CPPFLAGS="$BEDROCK_CFLAGS $CPPFLAGS"
CFLAGS="$BEDROCK_CFLAGS $CFLAGS"
PKG_CHECK_MODULES([FLOCK], [flock-client >= 0.4.1],[],
[AC_MSG_ERROR([Could not find working Flock installation v0.3.0 or higher])])
LIBS="$FLOCK_LIBS $LIBS"
CPPFLAGS="$FLOCK_CFLAGS $CPPFLAGS"
CFLAGS="$FLOCK_CFLAGS $CFLAGS"
# need zlib output file
PKG_CHECK_MODULES([ZLIB], [zlib],[],
[AC_MSG_ERROR([Could not find working zlib installation!])])
LIBS="$ZLIB_LIBS $LIBS"
CPPFLAGS="$ZLIB_CFLAGS $CPPFLAGS"
CFLAGS="$ZLIB_CFLAGS $CFLAGS"
AC_ARG_WITH([hpctoolkit],
[AS_HELP_STRING([--with-hpctoolkit],
[enable explicit support for HPCToolkit profiling control])],
[],
[with_hpctoolkit=no])
# if hpctoolkit support not disabled, check for header and library
if test x$with_hpctoolkit != xno; then
# guess that hpctoolkit might be in the spack env. Otherwise the user
# needs to set LDFLAGS appropriately at configure time
LIBS="-L$SPACK_ENV/.spack-env/view/lib/hpctoolkit $LIBS"
AC_CHECK_HEADER([hpctoolkit.h],
[AC_CHECK_LIB(hpctoolkit, hpctoolkit_sampling_start,
[AC_DEFINE(HAVE_HPCTOOLKIT, 1, [HPCToolkit support enabled])
LIBS="-lhpctoolkit $LIBS"],
[AC_MSG_ERROR(Cannot find required hpctoolkit_sampling_start() in libhpctoolkit)])],
[AC_MSG_ERROR(Cannot find hpctoolkit headers)])
fi
# optional mpi; this will cause the benchmark program to be built as well,
# in addition to the provider piece
AC_MSG_CHECKING([If MPI programs can be compiled])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include<mpi.h>]], [[MPI_Init(0,0);]])],
[have_mpi=1
AC_MSG_RESULT([yes])],
[AC_MSG_WARN([Unable to compile MPI programs, try CC=mpicc])])
AM_CONDITIONAL([HAVE_MPI], [test "x${have_mpi}" = x1])
AC_CONFIG_FILES([Makefile maint/mochi-quintain-server.pc])
AC_OUTPUT