configure.ac 2.94 KB
Newer Older
1 2 3
# See semver.org for version info
#################################

4 5 6 7 8
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)

9 10
# Init build tools
##################
11

12
AC_INIT([aml],[VERSION_STRING],[swann@anl.gov])
13
AC_CONFIG_SRCDIR([include/aml.h])
14 15 16
AC_CONFIG_AUX_DIR([m4])
AC_CONFIG_MACRO_DIR([m4])
# automake should fail on any error
17
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects 1.12])
18

19 20
# Detect features
#################
21 22

AC_LANG([C])
23
AC_USE_SYSTEM_EXTENSIONS
24
AC_PROG_CC
25
AC_PROG_CC_C99
26
AM_PROG_CC_C_O
27 28
AC_PROG_CPP
AC_TYPE_SIZE_T
29
AC_TYPE_INTPTR_T
30

31 32 33 34 35 36 37 38 39 40 41
AM_PROG_AR
LT_INIT

# Extra dependencies, configuration
###################################

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


42 43 44 45 46 47 48 49 50 51 52 53 54
# 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])

55 56 57 58 59 60
# 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
61
	AC_OPENMP
62 63 64 65
	AC_CHECK_LIB(m, sqrt)
fi
AM_CONDITIONAL([ADD_BENCHMARKS],[test "x$benchmarks" = xtrue])

66 67
AC_CHECK_LIB(dl, dlopen)

68 69
# add pthread support.
# doc in m4/ax_pthread.m4. Defines automake PTHREAD_CFLAGS and PTHREAD_LIBS
70
AX_PTHREAD([],[AC_MSG_ERROR([Cannot find how to compile with pthreads.])])
71 72
CC="$PTHREAD_CC"

73 74 75 76
# NUMA support
AC_CHECK_HEADERS([numa.h],,[AC_MSG_ERROR([AML requires libnuma headers.])])
AC_CHECK_HEADERS([numaif.h],,[AC_MSG_ERROR([AML requires libnuma headers.])])
AC_CHECK_LIB(numa, mbind,,[AC_MSG_ERROR([AML requires libnuma.])])
77

78

79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
# check doxygen + sphinx for documentation build
AC_CHECK_PROG([DOXYGEN], [doxygen], [doxygen], [no])
AC_CHECK_PROG([SPHINXBUILD], [sphinx-build], [sphinx-build], [no])
if [[ "x$DOXYGEN" != xno ]]; then
	if [[ "x$SPHINXBUILD" != xno ]]; then
		AC_MSG_NOTICE([Doxygen and Sphinx found, documentation will be build])
		BUILD_DOCS=yes
	else
		AC_MSG_NOTICE([Sphinx not found, cannot build documentation])
		BUILD_DOCS=no
	fi
else
	AC_MSG_NOTICE([Doxygen not found, cannot build documentation])
	BUILD_DOCS=no
fi
AM_CONDITIONAL([BUILD_DOCS],[ test "x$BUILD_DOCS" = xyes ])

96 97
# Output
########
98

99
AC_CONFIG_HEADERS([include/config.h])
100 101 102

AC_CONFIG_FILES([Makefile
		 src/Makefile
103 104 105 106 107 108
		 src/area/Makefile
		 src/dma/Makefile
		 src/tiling/Makefile
		 src/scratch/Makefile
		 src/utils/Makefile
		 include/Makefile
109
		 tests/Makefile
110
		 doc/Makefile
111
		 benchmarks/Makefile
112 113
		 aml.pc
		 include/aml/utils/version.h])
114
AC_OUTPUT