Commit 56cda368 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Implement fall-back search for cudart

parent f0f6d979
Loading
Loading
Loading
Loading
+66 −52
Original line number Diff line number Diff line
@@ -25366,6 +25366,7 @@ then :
    fi # end of 64-bit decision tree
    pkg-config --version > /dev/null
    use_pkg_config=$?
    if test "x${CUDAFLAGS}${CUDALDFLAGS}" = "x"; then
      if test "x$use_pkg_config" = "x0"; then
        # pkg-config is available
        declare -a pkg_array=$(pkg-config --list-all | grep cudart)
@@ -25377,6 +25378,11 @@ then :
    	CUDAFLAGS=$(pkg-config --cflags ${cuda_pkg})
    	CUDALDFLAGS=$(pkg-config --libs ${cuda_pkg})
        fi # end of CUDA runtime decision tree
        echo $CUDALDFLAGS | grep cudart > /dev/null
        cudart_check=$?
        if test "x${cudart_check}" != "x0"; then
          CUDALDFLAGS="$CUDALDFLAGS -lcudart"
        fi
      else
        # pkg-config is not available
        if test -f /usr/local/cuda/include/cuda.h; then
@@ -25390,9 +25396,10 @@ then :
          CUDALDFLAGS="-L${CUDA_HOME}/lib64 -lcudart"
        fi
      fi # end of pkg-config decision tree
    fi # end of CUDAFLAGS user override protection
    if test "x${MAGMA_ROOT}${MAGMA_HOME}${MAGMA_DIR}" = "x"; then
      # MAGMA environment is not defined
      if "x$use_pkg_config" = "x0"; then
      if test "x$use_pkg_config" = "x0"; then
        # use pkg-config to search for MAGMA
        declare -a pkg_array=$(pkg-config --list-all | grep magma)
        for i in "${pkg_array[@]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep magma > /dev/null
@@ -25401,7 +25408,7 @@ then :
	  # MAGMA was found
	  magma_pkg=$(for i in "${pkg_array[@]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep magma)
	  MAGMA_INCLUDE=$(pkg-config --cflags-only-I ${magma_pkg})
	  MAGMA_LIBS_DIR=$(pkg-config --cflags-only-L ${magma_pkg})
	  MAGMA_LIBS_DIR=$(pkg-config --libs-only-L ${magma_pkg})
          export MAGMAFLAGS="-DUSE_MAGMA ${MAGMA_ILP64_FLAG} $CUDAFLAGS ${MAGMA_INCLUDE}"
          export MAGMALDFLAGS="$CUDALDFLAGS ${MAGMA_LIBS_DIR} -lmagma"
	fi # end of MAGMA decision tree
@@ -25459,6 +25466,7 @@ else case e in #(
    fi # end of 64-bit decision tree
    pkg-config --version > /dev/null
    use_pkg_config=$?
    if test "x${CUDAFLAGS}${CUDALDFLAGS}" = "x"; then
      if test "x$use_pkg_config" = "x0"; then
        # pkg-config is available
        declare -a pkg_array=$(pkg-config --list-all | grep cudart)
@@ -25470,6 +25478,11 @@ else case e in #(
    	CUDAFLAGS=$(pkg-config --cflags ${cuda_pkg})
    	CUDALDFLAGS=$(pkg-config --libs ${cuda_pkg})
        fi # end of CUDA runtime decision tree
        echo $CUDALDFLAGS | grep cudart > /dev/null
        cudart_check=$?
        if test "x${cudart_check}" != "x0"; then
          CUDALDFLAGS="$CUDALDFLAGS -lcudart"
        fi
      else
        # pkg-config is not available
        if test -f /usr/local/cuda/include/cuda.h; then
@@ -25483,9 +25496,10 @@ else case e in #(
          CUDALDFLAGS="-L${CUDA_HOME}/lib64 -lcudart"
        fi
      fi # end of pkg-config decision tree
    fi # end of CUDAFLAGS user override protection
    if test "x${MAGMA_ROOT}${MAGMA_HOME}${MAGMA_DIR}" = "x"; then
      # MAGMA environment is not defined
      if "x$use_pkg_config" = "x0"; then
      if test "x$use_pkg_config" = "x0"; then
        # use pkg-config to search for MAGMA
        declare -a pkg_array=$(pkg-config --list-all | grep magma)
        for i in "${pkg_array[@]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep magma > /dev/null
@@ -25494,7 +25508,7 @@ else case e in #(
	  # MAGMA was found
	  magma_pkg=$(for i in "${pkg_array[@]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep magma)
	  MAGMA_INCLUDE=$(pkg-config --cflags-only-I ${magma_pkg})
	  MAGMA_LIBS_DIR=$(pkg-config --cflags-only-L ${magma_pkg})
	  MAGMA_LIBS_DIR=$(pkg-config --libs-only-L ${magma_pkg})
          export MAGMAFLAGS="-DUSE_MAGMA ${MAGMA_ILP64_FLAG} $CUDAFLAGS ${MAGMA_INCLUDE}"
          export MAGMALDFLAGS="$CUDALDFLAGS ${MAGMA_LIBS_DIR} -lmagma"
	fi # end of MAGMA decision tree
+33 −26
Original line number Diff line number Diff line
@@ -160,6 +160,7 @@ m4_define(
    fi # end of 64-bit decision tree
    pkg-config --version > /dev/null
    use_pkg_config=$?
    if test "x${CUDAFLAGS}${CUDALDFLAGS}" = "x"; then
      if test "x$use_pkg_config" = "x0"; then
        # pkg-config is available
        declare -a pkg_array=$(pkg-config --list-all | grep cudart)
@@ -171,6 +172,11 @@ m4_define(
    	CUDAFLAGS=$(pkg-config --cflags ${cuda_pkg})
    	CUDALDFLAGS=$(pkg-config --libs ${cuda_pkg})
        fi # end of CUDA runtime decision tree
        echo $CUDALDFLAGS | grep cudart > /dev/null
        cudart_check=$?
        if test "x${cudart_check}" != "x0"; then
          CUDALDFLAGS="$CUDALDFLAGS -lcudart"
        fi
      else
        # pkg-config is not available
        if test -f /usr/local/cuda/include/cuda.h; then
@@ -184,9 +190,10 @@ m4_define(
          CUDALDFLAGS="-L${CUDA_HOME}/lib64 -lcudart"
        fi
      fi # end of pkg-config decision tree
    fi # end of CUDAFLAGS user override protection
    if test "x${MAGMA_ROOT}${MAGMA_HOME}${MAGMA_DIR}" = "x"; then
      # MAGMA environment is not defined
      if "x$use_pkg_config" = "x0"; then
      if test "x$use_pkg_config" = "x0"; then
        # use pkg-config to search for MAGMA
        declare -a pkg_array=$(pkg-config --list-all | grep magma)
        for i in "${pkg_array[[@]]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep magma > /dev/null
@@ -195,7 +202,7 @@ m4_define(
	  # MAGMA was found
	  magma_pkg=$(for i in "${pkg_array[[@]]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep magma)
	  MAGMA_INCLUDE=$(pkg-config --cflags-only-I ${magma_pkg})
	  MAGMA_LIBS_DIR=$(pkg-config --cflags-only-L ${magma_pkg})
	  MAGMA_LIBS_DIR=$(pkg-config --libs-only-L ${magma_pkg})
          export MAGMAFLAGS="-DUSE_MAGMA ${MAGMA_ILP64_FLAG} $CUDAFLAGS ${MAGMA_INCLUDE}"
          export MAGMALDFLAGS="$CUDALDFLAGS ${MAGMA_LIBS_DIR} -lmagma"
	fi # end of MAGMA decision tree