a first version which handles AMD cards as well.
This commit is contained in:
parent
2d4697c750
commit
40337b00ad
80
configure.ac
80
configure.ac
@ -1,7 +1,7 @@
|
||||
AC_REVISION([m4_esyscmd_s([git describe --always])])
|
||||
|
||||
AC_PREREQ(2.63)
|
||||
AC_INIT([musrfit],[0.18.0],[andreas.suter@psi.ch])
|
||||
AC_INIT([musrfit],[1.0.0],[andreas.suter@psi.ch])
|
||||
AC_CONFIG_AUX_DIR(admin)
|
||||
AC_CANONICAL_HOST
|
||||
#AC_MSG_RESULT([${host} ${host_cpu} ${host_vendor} ${host_os}])
|
||||
@ -34,8 +34,8 @@ dnl -----------------------------------------------
|
||||
|
||||
|
||||
#release versioning
|
||||
MUSR_MAJOR_VERSION=0
|
||||
MUSR_MINOR_VERSION=18
|
||||
MUSR_MAJOR_VERSION=1
|
||||
MUSR_MINOR_VERSION=0
|
||||
MUSR_MICRO_VERSION=0
|
||||
|
||||
#release versioning
|
||||
@ -875,8 +875,7 @@ AC_ARG_ENABLE([dks], [AS_HELP_STRING([--enable-dks],[build musrfit with DKS (GPU
|
||||
DKS_CFLAGS=""
|
||||
|
||||
dnl ---------------------------------------------
|
||||
dnl Check (i) that Cuda is found. (ii) that DKS is found
|
||||
dnl Eventually also openCL only should be tested, i.e. DKS without Cuda
|
||||
dnl Check (i) that Cuda is found, if not check OpenCL. (ii) that DKS is found
|
||||
dnl This could also mean openCL without GPU, e.g. on Mac OS X
|
||||
dnl ---------------------------------------------
|
||||
|
||||
@ -902,22 +901,59 @@ AC_ARG_ENABLE([dks], [AS_HELP_STRING([--enable-dks],[build musrfit with DKS (GPU
|
||||
if test -x "$cuda_prefix/bin/nvcc"; then
|
||||
AC_MSG_RESULT([found])
|
||||
AC_DEFINE_UNQUOTED([NVCC_PATH], ["$cuda_prefix/bin/nvcc"], [path to nvcc binary])
|
||||
CUDA_FOUND="true"
|
||||
CUDA_CFLAGS="-I$cuda_prefix/include"
|
||||
CXXFLAGS="$CUDA_CFLAGS $CXXFLAGS"
|
||||
CUDA_LDFLAGS="-L$cuda_prefix/lib64"
|
||||
LDFLAGS="$CUDA_LDFLAGS $LDFLAGS"
|
||||
else
|
||||
AC_MSG_RESULT([not found!])
|
||||
AC_MSG_FAILURE([nvcc was not found in $cuda_prefix/bin])
|
||||
AC_MSG_WARN([nvcc was not found in $cuda_prefix/bin])
|
||||
fi
|
||||
|
||||
CUDA_CFLAGS="-I$cuda_prefix/include"
|
||||
CXXFLAGS="$CUDA_CFLAGS $CXXFLAGS"
|
||||
CUDA_LDFLAGS="-L$cuda_prefix/lib64"
|
||||
LDFLAGS="$CUDA_LDFLAGS $LDFLAGS"
|
||||
dnl if cuda has been found check the header and the lib
|
||||
if test "$CUDA_FOUND" == "yes"; then
|
||||
AC_CHECK_HEADER([cuda.h], [], AC_MSG_FAILURE([Couldn't find cuda.h]), [#include <cuda.h>])
|
||||
AC_CHECK_LIB([cuda], [cuInit], [], AC_MSG_FAILURE([Couldn't find libcuda]))
|
||||
fi
|
||||
|
||||
dnl And the header and the lib
|
||||
AC_CHECK_HEADER([cuda.h], [], AC_MSG_FAILURE([Couldn't find cuda.h]), [#include <cuda.h>])
|
||||
AC_CHECK_LIB([cuda], [cuInit], [], AC_MSG_FAILURE([Couldn't find libcuda]))
|
||||
dnl ---------------------------------------------
|
||||
dnl check for openCL in case CUDA is not found
|
||||
dnl ---------------------------------------------
|
||||
AC_ARG_WITH([opencl],
|
||||
[AS_HELP_STRING([--with-opencl],[prefix of the OpenCL installation, e.g. /opt/AMDAPPSDK-3.0/])],
|
||||
[opencl_prefix=$withval],
|
||||
[opencl_prefix="/opt/AMDAPPSDK-3.0"])
|
||||
|
||||
if test ! "$CUDA_FOUND" == "yes"; then
|
||||
AC_MSG_NOTICE([CUDA not found, will try to find OpenCL])
|
||||
AC_MSG_CHECKING([whether OpenCL is installed in a standard location])
|
||||
if test "$opencl_prefix" == "yes"; then
|
||||
if test "$withval" == "yes"; then
|
||||
opencl_prefix="/opt/AMDAPPSDK-3.0"
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT([${opencl_prefix}])
|
||||
|
||||
dnl Checking for opencl.h and libOpenCL.so
|
||||
if test ! "$ARCH" = "DARWIN"; then
|
||||
AC_MSG_NOTICE([linux like system])
|
||||
if test -x "$opencl_prefix/include/CL/opencl.h"; then
|
||||
OPENCL_CFLAGS="-I$opencl_prefix/include/"
|
||||
CXXFLAGS="$OPENCL_CFLAGS $CXXFLAGS"
|
||||
OPENCL_LDFLAGS="-L$opencl_prefix/lib/x86_64/"
|
||||
LDFLAGS="$OPENCL_LDFLAGS $LDFLAGS"
|
||||
else
|
||||
AC_MSG_RESULT([not found!])
|
||||
AC_MSG_FAILURE([neither CUDA nor OpenCL found])
|
||||
fi
|
||||
else
|
||||
AC_MSG_NOTICE([Apple macOS system, not yet implemented])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl -------------------------------------------
|
||||
dnl check for DKS
|
||||
dnl check for DKSlibOpenCL.so
|
||||
dnl -------------------------------------------
|
||||
AC_ARG_WITH([dks],
|
||||
[AS_HELP_STRING([--with-dks],[prefix of the DKS installation, e.g. /usr/local/DKS/build])],
|
||||
@ -940,12 +976,18 @@ AC_ARG_ENABLE([dks], [AS_HELP_STRING([--enable-dks],[build musrfit with DKS (GPU
|
||||
fi
|
||||
|
||||
AC_DEFINE([HAVE_DKS], [1], [Define to 1 if DKS is available])
|
||||
dnl AC_DEFINE([DKS_CUDA], [1], [Define to 1 if DKS Cuda is available])
|
||||
DKS_CUDADIR="$cuda_prefix"
|
||||
DKS_INCDIR="$dks_prefix/include"
|
||||
DKS_CFLAGS="-DDKS_OPENCL -DDKS_CUDA -I${DKS_INCDIR} ${CUDA_CFLAGS}"
|
||||
DKS_LIBDIR="$dks_prefix/lib"
|
||||
DKS_LIBS="${CUDA_LDFLAGS} -lOpenCL -L${DKS_LIBDIR} -ldksshared"
|
||||
if test "$CUDA_FOUND" == "yes"; then
|
||||
DKS_CUDADIR="$cuda_prefix"
|
||||
DKS_CFLAGS="-DDKS_OPENCL -DDKS_CUDA -I${DKS_INCDIR} ${CUDA_CFLAGS}"
|
||||
DKS_LIBS="${CUDA_LDFLAGS} -lOpenCL -L${DKS_LIBDIR} -ldksshared"
|
||||
else
|
||||
DKS_OPENCLDIR="$opencl_prefix"
|
||||
DKS_CFLAGS="-DDKS_OPENCL -I${DKS_INCDIR} ${OPENCL_CFLAGS}"
|
||||
DKS_LIBS="${OPENCL_LDFLAGS} -lOpenCL -L${DKS_LIBDIR} -ldksshared"
|
||||
fi
|
||||
|
||||
AC_SUBST(DKS_CFLAGS)
|
||||
AC_SUBST(DKS_LIBS)
|
||||
|
||||
@ -1452,7 +1494,7 @@ else
|
||||
fi
|
||||
echo ""
|
||||
if test "${DKS_ENABLED}" = "1"; then
|
||||
echo " DKS enabled"
|
||||
echo " DKS enabled and found at ${dks_prefix}"
|
||||
else
|
||||
echo " DKS disabled"
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user