Blame src/components/nvml/configure.in

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