configure.ac 2.22 KB
Newer Older
1
# see semver.org for version info
2 3 4 5 6 7 8 9 10 11
m4_define([VERSION_MAJOR], [0])
m4_define([VERSION_MINOR], [1])
m4_define([VERSION_PATCH], [0])
m4_define([VERSION_STRING], VERSION_MAJOR.VERSION_MINOR.VERSION_PATCH)

AC_INIT([aml],[VERSION_STRING],[swann@anl.gov])

AC_SUBST([PACKAGE_VERSION_MAJOR],[VERSION_MAJOR])
AC_SUBST([PACKAGE_VERSION_MINOR],[VERSION_MINOR])
AC_SUBST([PACKAGE_VERSION_PATCH],[VERSION_PATCH])
12 13

# are we in the right source dir ?
14
AC_CONFIG_SRCDIR([include/aml.h])
15 16 17 18 19 20

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

# automake should fail on any error
21
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects 1.12])
22 23 24 25 26 27 28 29 30
AM_PROG_AR

# check for libtool
LT_INIT

# check for programs
AC_LANG([C])
AC_PROG_CC
AC_PROG_CC_STDC
31
AM_PROG_CC_C_O
32 33
AC_PROG_CPP
AC_TYPE_SIZE_T
34
AC_TYPE_INTPTR_T
35 36 37 38 39 40 41 42 43 44 45 46 47 48

# 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])

49 50 51 52 53 54
# 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
55
	AC_OPENMP
56 57 58 59 60
	AC_CHECK_LIB(m, sqrt)
fi
AM_CONDITIONAL([ADD_BENCHMARKS],[test "x$benchmarks" = xtrue])


61 62 63
# dependencies
AC_CHECK_HEADERS(numa.h)
AC_CHECK_LIB(numa, move_pages)
64 65 66 67 68 69 70 71
AC_CHECK_LIB(dl, dlopen)

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

72

73
# internal jemalloc
74
ac_configure_args="$ac_configure_args \
75
			'--with-jemalloc-prefix=jemk_aml_' \
76
			'--with-install-suffix=-aml'"
77
AC_CONFIG_SUBDIRS([jemalloc])
78

79
AC_CONFIG_HEADERS([include/config.h])
80 81 82

AC_CONFIG_FILES([Makefile
		 src/Makefile
83 84 85 86 87 88 89 90
		 src/area/Makefile
		 src/dma/Makefile
		 src/tiling/Makefile
		 src/binding/Makefile
		 src/scratch/Makefile
		 src/arena/Makefile
		 src/utils/Makefile
		 include/Makefile
91
		 tests/Makefile
92
		 benchmarks/Makefile
93 94
		 aml.pc
		 include/aml/utils/version.h])
95
AC_OUTPUT