diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-02-25 10:43:43 +0100 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-02-25 10:52:57 +0100 |
commit | e8de27710cf8786fd2f09e22e209fa61eb72cb2c (patch) | |
tree | e9f2656076d018d0ab4d929c4916459b3a8e3c63 | |
parent | 8df1ed4c66ac41d1c44fabdadd7be5b771098963 (diff) | |
download | astra-e8de27710cf8786fd2f09e22e209fa61eb72cb2c.tar.gz astra-e8de27710cf8786fd2f09e22e209fa61eb72cb2c.tar.bz2 astra-e8de27710cf8786fd2f09e22e209fa61eb72cb2c.tar.xz astra-e8de27710cf8786fd2f09e22e209fa61eb72cb2c.zip |
Clean up configure check for nvcc
-rw-r--r-- | build/linux/configure.ac | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/build/linux/configure.ac b/build/linux/configure.ac index a33b0bc..bf033f4 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -92,48 +92,41 @@ else AC_MSG_RESULT([yes, libboost_unit_test_framework-mt]) LIBS_BOOSTUTF="-lboost_unit_test_framework-mt" fi -# TODO: do something with the result # nvcc, cuda AC_ARG_WITH(cuda, [[ --with-cuda=path path of CUDA SDK (optional)]],,) -NVCC_PATH=$PATH -if test x"$with_cuda" != x; then - NVCC_PATH="$with_cuda/bin:$NVCC_PATH" +if test x"$with_cuda" != xno; then + NVCC_PATH=$PATH + if test x"$with_cuda" != x -a x"$with_cuda" != xyes; then + NVCC_PATH="$with_cuda/bin:$NVCC_PATH" + fi + AC_PATH_PROG([NVCC], [nvcc], [no], [$NVCC_PATH]) +else + NVCC=no fi -AC_PATH_PROG([NVCC], [nvcc], [no], [$NVCC_PATH]) -# TODO: do something with the result HAVECUDA=no if test x"$NVCC" != xno; then HAVECUDA=yes BACKUP_CUDA_LDFLAGS="$LDFLAGS" - if test x"$with_cuda" != x; then - LDFLAGS_CUDA="-L$with_cuda/lib" + if test x"$with_cuda" != x -a x"$with_cuda" != xyes; then + case $host_cpu in + x86_64) + LDFLAGS_CUDA="-L$with_cuda/lib64" + ;; + *) + LDFLAGS_CUDA="-L$with_cuda/lib" + ;; + esac CPPFLAGS_CUDA="-I$with_cuda/include" LDFLAGS="$LDFLAGS $LDFLAGS_CUDA" fi AC_CHECK_LIB(cudart,cudaMalloc, ,HAVECUDA=no) AC_CHECK_LIB(cufft,cufftPlan1d, ,HAVECUDA=no) - if test x"$HAVECUDA" = xno; then - # try lib64 instead of lib - - HAVECUDA=yes - LDFLAGS="$BACKUP_CUDA_LDFLAGS" - - # prevent cached values from being used - unset ac_cv_lib_cudart_cudaMalloc - unset ac_cv_lib_cufft_cufftPlan1d - - LDFLAGS_CUDA="-L$with_cuda/lib64" - LDFLAGS="$LDFLAGS $LDFLAGS_CUDA" - AC_CHECK_LIB(cudart,cudaMalloc, ,HAVECUDA=no) - AC_CHECK_LIB(cufft,cufftPlan1d, ,HAVECUDA=no) - fi - LDFLAGS="$BACKUP_CUDA_LDFLAGS" unset BACKUP_CUDA_LDFLAGS # TODO: check for cuda headers? @@ -142,11 +135,11 @@ if test x"$NVCC" != xno; then fi NVCCFLAGS="" -AC_MSG_CHECKING([if nvcc works]) if test x"$HAVECUDA" = xyes; then + AC_MSG_CHECKING([if nvcc works]) ASTRA_CHECK_NVCC(HAVECUDA,NVCCFLAGS) + AC_MSG_RESULT($HAVECUDA) fi -AC_MSG_RESULT($HAVECUDA) AC_ARG_WITH(cuda_compute, [[ --with-cuda-compute=archs comma separated list of CUDA compute models (optional)]],,) if test x"$HAVECUDA" = xyes; then |