2 # --------------------------------------------------------------
3 # Should we used libnuma? (yes, no, or auto.)
6 # - UseLibNuma: [YES|NO]
7 # - LibNumaLibDir: optional path
8 # - LibNumaIncludeDir: optional path
9 AC_DEFUN([FP_FIND_LIBNUMA],
11 AC_ARG_WITH([libnuma-libraries],
12 [AS_HELP_STRING([--with-libnuma-libraries=ARG],
13 [Find libraries for libnuma in ARG [default=system default]])
16 LibNumaLibDir="$withval"
17 LIBNUMA_LDFLAGS="-L$withval"
20 AC_ARG_WITH([libnuma-includes],
21 [AS_HELP_STRING([--with-libnuma-includes=ARG],
22 [Find includes for libnuma in ARG [default=system default]])
25 LibNumaIncludeDir="$withval"
26 LIBNUMA_CFLAGS="-I$withval"
30 [AS_HELP_STRING([--enable-numa],
31 [Enable NUMA memory policy and thread affinity support in the
32 runtime system via numactl's libnuma [default=auto]])],
37 if test "$enable_numa" != "no" ; then
39 CFLAGS="$LIBNUMA_CFLAGS $CFLAGS"
41 LDFLAGS="$LIBNUMA_LDFLAGS $LDFLAGS"
43 AC_CHECK_HEADERS([numa.h numaif.h])
45 if test "$ac_cv_header_numa_h:$ac_cv_header_numaif_h" = "yes:yes" ; then
46 AC_CHECK_LIB([numa], [numa_available], [UseLibNuma=YES])
48 if test "$enable_numa:$UseLibNuma" = "yes:NO" ; then
49 AC_MSG_ERROR([Cannot find system libnuma (required by --enable-numa)])