configure.ac 1.87 KB
Newer Older
1 2 3 4
# see semver.org for version info
AC_INIT([aml],[0.0.1],[swann@anl.gov])

# are we in the right source dir ?
5
AC_CONFIG_SRCDIR([include/aml.h])
6 7 8 9 10 11

# build artefacts in separate dir
AC_CONFIG_AUX_DIR([m4])
AC_CONFIG_MACRO_DIR([m4])

# automake should fail on any error
12
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects 1.12])
13 14 15 16 17 18 19 20 21
AM_PROG_AR

# check for libtool
LT_INIT

# check for programs
AC_LANG([C])
AC_PROG_CC
AC_PROG_CC_STDC
22
AM_PROG_CC_C_O
23 24
AC_PROG_CPP
AC_TYPE_SIZE_T
25
AC_TYPE_INTPTR_T
26 27 28 29 30 31 32 33 34 35 36 37 38 39

# support for testing with valgrind
AC_ARG_ENABLE(valgrind,
[AS_HELP_STRING([--enable-valgrind],[Also valgrind on checks (default is no).])],
[valgrind=true],[valgrind=false])

if [[ "x$valgrind" = xtrue ]]; then
	AC_PATH_PROG(VALGRIND, valgrind, no)
	if [[  "x$VALGRIND" = xno ]]; then
		AC_MSG_ERROR([Valgrind not found in PATH. ])
	fi
fi
AM_CONDITIONAL([TEST_VALGRIND],[test "x$valgrind" = xtrue])

40 41 42 43 44 45
# support for compiling benchmarks
AC_ARG_ENABLE(benchmarks,
[AS_HELP_STRING([--enable-benchmarks],[Compile additional benchmarks (default is no).])],
[benchmarks=true],[benchmarks=false])

if [[ "x$benchmarks" = xtrue ]]; then
46
	AC_OPENMP
47 48 49 50 51
	AC_CHECK_LIB(m, sqrt)
fi
AM_CONDITIONAL([ADD_BENCHMARKS],[test "x$benchmarks" = xtrue])


52 53 54
# dependencies
AC_CHECK_HEADERS(numa.h)
AC_CHECK_LIB(numa, move_pages)
55 56 57 58 59 60 61 62
AC_CHECK_LIB(dl, dlopen)

# add pthread support
AX_PTHREAD
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"

63

64
# internal jemalloc
65
ac_configure_args="$ac_configure_args \
66
			'--with-jemalloc-prefix=jemk_aml_' \
67
			'--with-install-suffix=-aml'"
68
AC_CONFIG_SUBDIRS([jemalloc])
69

70 71 72 73
AC_CONFIG_HEADERS([src/config.h])

AC_CONFIG_FILES([Makefile
		 src/Makefile
74 75 76 77 78 79 80 81
		 src/area/Makefile
		 src/dma/Makefile
		 src/tiling/Makefile
		 src/binding/Makefile
		 src/scratch/Makefile
		 src/arena/Makefile
		 src/utils/Makefile
		 include/Makefile
82
		 tests/Makefile
83
		 benchmarks/Makefile
84 85
		 aml.pc])
AC_OUTPUT