Blame src/components/nvml/configure.in

Packit Service a1973e
# Process this file with autoconf to produce a configure script.
Packit Service a1973e
# File: components/nvml/configure.in
Packit Service a1973e
Packit Service a1973e
AC_INIT
Packit Service a1973e
Packit Service a1973e
AC_ARG_WITH(nvml_dir,
Packit Service a1973e
            [  --with-nvml-dir=<path>   Specify prefix to nvml libraries and headers ],
Packit Service a1973e
            [nvml_dir=$withval])
Packit Service a1973e
AC_ARG_WITH(nvml_incdir,
Packit Service a1973e
           [  --with-nvml-incdir=<path>         Specify directory of nvml header files (nvml.h) in a specific location ],
Packit Service a1973e
           [nvml_incdir=$withval])
Packit Service a1973e
AC_ARG_WITH(nvml_libdir,
Packit Service a1973e
           [  --with-nvml-libdir=<path>         Specify directory of nvml library (libnvidia-ml.so) in a specific location ],
Packit Service a1973e
           [nvml_libdir=$withval])
Packit Service a1973e
Packit Service a1973e
nvml_dotest=0
Packit Service a1973e
if test "x$nvml_dir" != "x"; then
Packit Service a1973e
    nvml_incdir="$nvml_dir/include"
Packit Service a1973e
    nvml_libdir="$nvml_dir/lib64"
Packit Service a1973e
    nvml_dotest=1
Packit Service a1973e
else
Packit Service a1973e
   if test "x$nvml_libdir" != "x"; then
Packit Service a1973e
      LIBS="-L$nvml_libdir"
Packit Service a1973e
      nvml_dotest=1
Packit Service a1973e
    fi
Packit Service a1973e
    if test "x$nvml_incdir" != "x"; then
Packit Service a1973e
      CPPFLAGS="-I$nvml_incdir"
Packit Service a1973e
      nvml_dotest=1
Packit Service a1973e
    fi
Packit Service a1973e
fi
Packit Service a1973e
Packit Service a1973e
CFLAGS="$CFLAGS -I$nvml_incdir"
Packit Service a1973e
AC_CHECK_HEADER( [nvml.h], [], [AC_MSG_ERROR([NVML component: nvml.h not found: use configure flags to set the path ])], )
Packit Service a1973e
LDFLAGS="$LDFLAGS -L$nvml_libdir -Wl,-rpath,$nvml_libdir" 
Packit Service a1973e
AC_CHECK_LIB( [nvidia-ml], [nvmlInit], [], [AC_MSG_ERROR([NVML component: libnvidia-ml.so not found: use configure flags to set the path])] )
Packit Service a1973e
NVML_INCDIR=$nvml_incdir
Packit Service a1973e
NVML_LIBDIR=$nvml_libdir
Packit Service a1973e
Packit Service a1973e
AC_ARG_WITH(cuda-dir, 
Packit Service a1973e
    [--with-cuda-dir=<path> Specify path to cuda root directory], 
Packit Service a1973e
    [ CUDA_DIR=$withval
Packit Service a1973e
        LDFLAGS="$LDFLAGS -L$withval/lib64 -Wl,-rpath,$withval/lib64"
Packit Service a1973e
        AC_CHECK_LIB( [cudart], [cudaMalloc], [], [AC_MSG_ERROR([CUDA cudart library not found!])])],
Packit Service a1973e
    [ AC_MSG_ERROR([Component requires path to cuda library.])])
Packit Service a1973e
Packit Service a1973e
AC_CONFIG_FILES([Makefile.nvml])
Packit Service a1973e
AC_SUBST(NVML_INCDIR)
Packit Service a1973e
AC_SUBST(NVML_LIBDIR)
Packit Service a1973e
AC_SUBST(CUDA_DIR)
Packit Service a1973e
AC_OUTPUT