GitLab maintenance scheduled for Today, 2019-12-05, from 17:00 to 18:00 CT - Services will be unavailable during this time.

configure.ac 8.19 KB
Newer Older
1 2 3 4
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.67])
5
AC_INIT([codes], [1.0.0], [http://trac.mcs.anl.gov/projects/codes/newticket],[],[http://www.mcs.anl.gov/projects/codes/])
6
LT_INIT
7

8 9

#WRAP SOME OPTION AROUND THIS - IT'S NOT REQUIRED FOR 99% OF CODES
Caitlin Ross's avatar
Caitlin Ross committed
10
#AX_BOOST_BASE([1.66])
11

12 13 14 15 16 17 18 19
AC_CANONICAL_TARGET
AC_CANONICAL_SYSTEM
AC_CANONICAL_HOST

AM_INIT_AUTOMAKE([foreign subdir-objects -Wall])

m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

20
AC_CONFIG_SRCDIR([doc/BUILD_STEPS])
21
AC_CONFIG_HEADERS([codes_config.h])
22 23 24 25 26 27 28 29 30 31 32

AX_PROG_BISON([],[AC_MSG_WARN([Could not find bison])])
AX_PROG_FLEX([],[AC_MSG_WARN([Could not find flex])])
AC_SUBST([BISON])
AC_SUBST([FLEX])

# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_CXXCPP
33
AX_CXX_COMPILE_STDCXX(11, noext, mandatory)
34 35
AC_PROG_RANLIB

36 37
PKG_PROG_PKG_CONFIG

38 39 40 41
if test -z "$PKG_CONFIG" ; then
    AC_MSG_ERROR([pkg-config is required. Please install the pkg-config program on your PATH or set the PKG_CONFIG environment variable to the appropriate package.])
fi

Jonathan Jenkins's avatar
Jonathan Jenkins committed
42 43 44
# Check for C99
AC_PROG_CC_C99

45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
AC_REQUIRE_CPP

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h unistd.h execinfo.h pthread.h malloc.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T

65 66 67 68 69
# Add warning flags by default
AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"])
AX_CHECK_COMPILE_FLAG([-Wextra], [CFLAGS="$CFLAGS -Wextra"])
AX_CHECK_COMPILE_FLAG([-Wshadow], [CFLAGS="$CFLAGS -Wshadow"])

70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
# Checks for library functions.
AC_CHECK_FUNCS([memset])
AC_CHECK_LIB([pthread],[pthread_create],,[AC_MSG_ERROR([Could not find pthread_create!])])
AC_CHECK_LIB([m],[sqrt],,[AC_MSG_ERROR([Could not find sqrt!])])


AX_PROG_BISON_CLFEATURES([],[AC_MSG_WARN([Could not find bison])],
[bison_ok="yes"], [bison_ok="no"])
AC_SUBST([bison_ok])

dnl Check to see if CC is an MPI compiler
AC_MSG_CHECKING(whether the mpicc compiler works)
AC_TRY_COMPILE([#include <mpi.h>], [int ret = MPI_Init(0, (void*)0)],
    AC_MSG_RESULT(yes),
    AC_MSG_RESULT(no)
85
    AC_MSG_ERROR(CC doesnt appear to be a valid MPI compiler.  See INSTALL document or try adding CC=mpicc to your configure command line.)
86 87
)

88 89 90
# check for ROSS
PKG_CHECK_MODULES_STATIC([ROSS], [ross], [],
                  [AC_MSG_ERROR([Could not find working ross installation via pkg-config])])
91

92 93 94 95
#check for Damaris
AC_ARG_WITH([damaris],[AS_HELP_STRING([--with-damaris],
                        [build with ROSS-Damaris in situ analysis support])],
                        [use_rdamaris=yes],[use_rdamaris=no])
96
if test "x${use_rdamaris}" = xyes ; then
97 98
    PKG_CHECK_MODULES_STATIC([ROSS_Damaris], [ross-damaris], [],
                             [AC_MSG_ERROR([Could not find working ROSS-Damaris installation via pkg-config])])
99 100
    PKG_CHECK_MODULES([rdplugins], [ross-damaris], [],
                             [AC_MSG_ERROR([Could not find the rdplugins library from ROSS-Damaris via pkg-config])])
101 102 103
fi
AM_CONDITIONAL(USE_RDAMARIS, [test "x${use_rdamaris}" = xyes])

Matthieu Dorier's avatar
Matthieu Dorier committed
104 105 106 107
# check for enable-g
AC_ARG_ENABLE([g],[AS_HELP_STRING([--enable-g],
			[Build with GDB symbols])],
		[use_debug=yes],[use_debug=no])
108
AM_CONDITIONAL(USE_DEBUG, [test "x${use_debug}" = xyes])
Matthieu Dorier's avatar
Matthieu Dorier committed
109

110
# check for Darshan
111 112 113 114 115 116
AC_ARG_WITH([darshan],[AS_HELP_STRING([--with-darshan],
                        [Build with the darshan workload support])],
                      [use_darshan=yes],[use_darshan=no])
if test "x${use_darshan}" = xyes ; then
    PKG_CHECK_MODULES_STATIC([DARSHAN], [darshan-util], [],
                      [AC_MSG_ERROR([Could not find working darshan installation via pkg-config])])
117 118 119
    DARSHAN_VER=`pkg-config --modversion darshan-util`
    AX_COMPARE_VERSION([$DARSHAN_VER],[ge],[2.3],[],
        [AC_MSG_ERROR([Found Darshan $DARSHAN_VER but 2.3 or greater is needed])])
120
fi
121
AM_CONDITIONAL(USE_DARSHAN, [test "x${use_darshan}" = xyes])
122

123

124 125 126 127
# check for Argobots
AC_ARG_WITH([online],[AS_HELP_STRING([--with-online@<:@=DIR@:>@],
                        [Build with the online workloads and argobots support])],
                      [use_online=yes],[use_online=no])
128
if test "x${use_online}" != "xno" ; then
129 130 131 132 133 134 135 136 137 138 139 140 141
    AM_CONDITIONAL(USE_ONLINE, true)
    PKG_CHECK_MODULES_STATIC([ARGOBOTS], [argobots], [],
                      [AC_MSG_ERROR([Could not find working argobots installation via pkg-config])])
    PKG_CHECK_MODULES_STATIC([SWM], [swm], [],
                      [AC_MSG_ERROR([Could not find working swm installation via pkg-config])])
    PKG_CHECK_VAR([SWM_DATAROOTDIR], [swm], [datarootdir], [],
              [AC_MSG_ERROR[Could not find shared directory in SWM]])
    AC_DEFINE_UNQUOTED([SWM_DATAROOTDIR], ["$SWM_DATAROOTDIR"], [if using json
                        data files])
else
    AM_CONDITIONAL(USE_ONLINE, false)
fi

142 143 144 145 146
# check for Recorder
AM_CONDITIONAL(USE_RECORDER, true)
RECORDER_CPPFLAGS="-DUSE_RECORDER=1"
AC_SUBST(RECORDER_CPPFLAGS)

147 148 149 150
#check for Dumpi
AC_ARG_WITH([dumpi],[AS_HELP_STRING([--with-dumpi@<:@=DIR@:>@],
                        [location of Dumpi installation])])
if test "x${with_dumpi}" != "x" ; then
151 152 153 154 155
	CFLAGS="-I${with_dumpi}/include"
	LIBS="-L${with_dumpi}/lib/ -lundumpi"
    AC_CHECK_LIB([undumpi],
                 [undumpi_open], [], [AC_MSG_ERROR(Could not find dumpi)])
    AM_CONDITIONAL(USE_DUMPI, true)
156
	DUMPI_CFLAGS="-I${with_dumpi}/include"
157
	DUMPI_LIBS="-L${with_dumpi}/lib/ -lundumpi"
158 159
    AC_SUBST(DUMPI_LIBS)
    AC_SUBST(DUMPI_CFLAGS)
160 161 162 163
else
	AM_CONDITIONAL(USE_DUMPI, false)
fi

164 165 166
# check for Cortex
AC_ARG_WITH([cortex],[AS_HELP_STRING([--with-cortex@<:@=DIR@:>@],
			[location of Cortex installation])])
167 168 169 170 171 172 173 174 175 176

# check for Python
AC_ARG_WITH([python],[AS_HELP_STRING([--with-python@<:@=DIR@:>@],
			[location of Python 2.7 installation])])

# check for Boost Python
AC_ARG_WITH([boost],[AS_HELP_STRING([--with-boost@<:@=DIR@:>@],
			[location of Boost Python installation])])

if [ test "x${with_python}" != "x" -a "x${with_boost}" != "x"] ; then
177
        AC_CHECK_FILES([${with_python}/lib/libpython2.7.so ${with_boost}/lib/libboost_python.a],
178 179 180 181 182 183 184 185 186 187
                AM_CONDITIONAL(USE_PYTHON, true),
                AC_MSG_ERROR(Could not find Python and/or Boost-Python libraries))
        PYTHON_CFLAGS="-I${with_python}/include -I${with_boost}/include"
        PYTHON_LIBS="-L${with_boost}/lib -lboost_python -L${with_python}/lib/ -lpython2.7"
        AC_SUBST(PYTHON_LIBS)
        AC_SUBST(PYTHON_CFLAGS)
else
        AM_CONDITIONAL(USE_PYTHON, false)
fi

188
if test "x${with_cortex}" != "x" ; then
189
	 AC_CHECK_FILES([${with_cortex}/lib/libcortex.a ${with_cortex}/lib/libcortex-mpich.a],
190
		AM_CONDITIONAL(USE_CORTEX, true),
191
		AC_MSG_ERROR(Could not find Cortex libraries libcortex.a and/or libcortex-mpich.a))
192
	CORTEX_CFLAGS="-I${with_cortex}/include"
193
	CORTEX_LIBS="-L${with_cortex}/lib/ -lcortex-mpich -lcortex -lstdc++"
194 195 196 197 198 199
	AC_SUBST(CORTEX_LIBS)
	AC_SUBST(CORTEX_CFLAGS)
else
	AM_CONDITIONAL(USE_CORTEX, false)
fi

200 201 202 203 204 205 206 207
if [ test "x${with_cortex}" != "x" -a "x${with_python}" != "x" -a "x${with_boost}" != "x"] ; then
	AC_CHECK_FILE([${with_cortex}/lib/libcortex-python.a],
		AM_CONDITIONAL(USE_CORTEX_PYTHON, true),
		AC_MSG_ERROR(Could not find library libcortex-python.a))
	CORTEX_PYTHON_CFLAGS="-I${with_cortex}/include"
	CORTEX_PYTHON_LIBS="-L${with_cortex}/lib/ -lcortex-python"
	AC_SUBST(CORTEX_PYTHON_LIBS)
	AC_SUBST(CORTEX_PYTHON_CFLAGS)
208
else
209
	AM_CONDITIONAL(USE_CORTEX_PYTHON, false)
210 211
fi

212 213 214 215 216 217 218 219 220 221 222 223 224
dnl ======================================================================
dnl  Try harder to be valgrind safe
dnl ======================================================================
AC_ARG_ENABLE(valgrind-clean,
        [AS_HELP_STRING(
                [--enable-valgrind-clean],
                [Try harder to avoid valgrind warnings])
        ])

AS_IF([test "x$enable_valgrind_clean" = "xyes"], [
      AC_DEFINE([VALGRIND], [1], [If enabling valgrind-clean build])
])

225

226
dnl AC_CONFIG_FILES([src/iokernellang/codesparser.y])
227 228 229
if test "x$srcdir" != "x."; then
    AC_CONFIG_LINKS([tests/conf:$srcdir/tests/conf])
fi
230 231 232

AC_CONFIG_FILES([Makefile])

233
AC_OUTPUT([maint/codes.pc])
234
AC_OUTPUT([src/network-workloads/conf/dragonfly-custom/modelnet-test-dragonfly-1728-nodes.conf])
235