Skip to content
Snippets Groups Projects
Commit 407c119b authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Enable alternative search of cudart and fix bug in MAGMA library search

parent 35d21dbc
No related branches found
No related tags found
No related merge requests found
...@@ -25366,6 +25366,7 @@ then : ...@@ -25366,6 +25366,7 @@ then :
fi # end of 64-bit decision tree fi # end of 64-bit decision tree
pkg-config --version > /dev/null pkg-config --version > /dev/null
use_pkg_config=$? use_pkg_config=$?
if test "x${CUDAFLAGS}${CUDALDFLAGS}" = "x"; then
if test "x$use_pkg_config" = "x0"; then if test "x$use_pkg_config" = "x0"; then
# pkg-config is available # pkg-config is available
declare -a pkg_array=$(pkg-config --list-all | grep cudart) declare -a pkg_array=$(pkg-config --list-all | grep cudart)
...@@ -25377,6 +25378,11 @@ then : ...@@ -25377,6 +25378,11 @@ then :
CUDAFLAGS=$(pkg-config --cflags ${cuda_pkg}) CUDAFLAGS=$(pkg-config --cflags ${cuda_pkg})
CUDALDFLAGS=$(pkg-config --libs ${cuda_pkg}) CUDALDFLAGS=$(pkg-config --libs ${cuda_pkg})
fi # end of CUDA runtime decision tree 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 else
# pkg-config is not available # pkg-config is not available
if test -f /usr/local/cuda/include/cuda.h; then if test -f /usr/local/cuda/include/cuda.h; then
...@@ -25390,9 +25396,10 @@ then : ...@@ -25390,9 +25396,10 @@ then :
CUDALDFLAGS="-L${CUDA_HOME}/lib64 -lcudart" CUDALDFLAGS="-L${CUDA_HOME}/lib64 -lcudart"
fi fi
fi # end of pkg-config decision tree 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 if test "x${MAGMA_ROOT}${MAGMA_HOME}${MAGMA_DIR}" = "x"; then
# MAGMA environment is not defined # 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 # use pkg-config to search for MAGMA
declare -a pkg_array=$(pkg-config --list-all | grep 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 for i in "${pkg_array[@]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep magma > /dev/null
...@@ -25401,7 +25408,7 @@ then : ...@@ -25401,7 +25408,7 @@ then :
# MAGMA was found # MAGMA was found
magma_pkg=$(for i in "${pkg_array[@]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep magma) 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_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 MAGMAFLAGS="-DUSE_MAGMA ${MAGMA_ILP64_FLAG} $CUDAFLAGS ${MAGMA_INCLUDE}"
export MAGMALDFLAGS="$CUDALDFLAGS ${MAGMA_LIBS_DIR} -lmagma" export MAGMALDFLAGS="$CUDALDFLAGS ${MAGMA_LIBS_DIR} -lmagma"
fi # end of MAGMA decision tree fi # end of MAGMA decision tree
...@@ -25459,6 +25466,7 @@ else case e in #( ...@@ -25459,6 +25466,7 @@ else case e in #(
fi # end of 64-bit decision tree fi # end of 64-bit decision tree
pkg-config --version > /dev/null pkg-config --version > /dev/null
use_pkg_config=$? use_pkg_config=$?
if test "x${CUDAFLAGS}${CUDALDFLAGS}" = "x"; then
if test "x$use_pkg_config" = "x0"; then if test "x$use_pkg_config" = "x0"; then
# pkg-config is available # pkg-config is available
declare -a pkg_array=$(pkg-config --list-all | grep cudart) declare -a pkg_array=$(pkg-config --list-all | grep cudart)
...@@ -25470,6 +25478,11 @@ else case e in #( ...@@ -25470,6 +25478,11 @@ else case e in #(
CUDAFLAGS=$(pkg-config --cflags ${cuda_pkg}) CUDAFLAGS=$(pkg-config --cflags ${cuda_pkg})
CUDALDFLAGS=$(pkg-config --libs ${cuda_pkg}) CUDALDFLAGS=$(pkg-config --libs ${cuda_pkg})
fi # end of CUDA runtime decision tree 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 else
# pkg-config is not available # pkg-config is not available
if test -f /usr/local/cuda/include/cuda.h; then if test -f /usr/local/cuda/include/cuda.h; then
...@@ -25483,9 +25496,10 @@ else case e in #( ...@@ -25483,9 +25496,10 @@ else case e in #(
CUDALDFLAGS="-L${CUDA_HOME}/lib64 -lcudart" CUDALDFLAGS="-L${CUDA_HOME}/lib64 -lcudart"
fi fi
fi # end of pkg-config decision tree 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 if test "x${MAGMA_ROOT}${MAGMA_HOME}${MAGMA_DIR}" = "x"; then
# MAGMA environment is not defined # 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 # use pkg-config to search for MAGMA
declare -a pkg_array=$(pkg-config --list-all | grep 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 for i in "${pkg_array[@]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep magma > /dev/null
...@@ -25494,7 +25508,7 @@ else case e in #( ...@@ -25494,7 +25508,7 @@ else case e in #(
# MAGMA was found # MAGMA was found
magma_pkg=$(for i in "${pkg_array[@]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep magma) 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_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 MAGMAFLAGS="-DUSE_MAGMA ${MAGMA_ILP64_FLAG} $CUDAFLAGS ${MAGMA_INCLUDE}"
export MAGMALDFLAGS="$CUDALDFLAGS ${MAGMA_LIBS_DIR} -lmagma" export MAGMALDFLAGS="$CUDALDFLAGS ${MAGMA_LIBS_DIR} -lmagma"
fi # end of MAGMA decision tree fi # end of MAGMA decision tree
......
...@@ -160,6 +160,7 @@ m4_define( ...@@ -160,6 +160,7 @@ m4_define(
fi # end of 64-bit decision tree fi # end of 64-bit decision tree
pkg-config --version > /dev/null pkg-config --version > /dev/null
use_pkg_config=$? use_pkg_config=$?
if test "x${CUDAFLAGS}${CUDALDFLAGS}" = "x"; then
if test "x$use_pkg_config" = "x0"; then if test "x$use_pkg_config" = "x0"; then
# pkg-config is available # pkg-config is available
declare -a pkg_array=$(pkg-config --list-all | grep cudart) declare -a pkg_array=$(pkg-config --list-all | grep cudart)
...@@ -171,6 +172,11 @@ m4_define( ...@@ -171,6 +172,11 @@ m4_define(
CUDAFLAGS=$(pkg-config --cflags ${cuda_pkg}) CUDAFLAGS=$(pkg-config --cflags ${cuda_pkg})
CUDALDFLAGS=$(pkg-config --libs ${cuda_pkg}) CUDALDFLAGS=$(pkg-config --libs ${cuda_pkg})
fi # end of CUDA runtime decision tree 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 else
# pkg-config is not available # pkg-config is not available
if test -f /usr/local/cuda/include/cuda.h; then if test -f /usr/local/cuda/include/cuda.h; then
...@@ -184,9 +190,10 @@ m4_define( ...@@ -184,9 +190,10 @@ m4_define(
CUDALDFLAGS="-L${CUDA_HOME}/lib64 -lcudart" CUDALDFLAGS="-L${CUDA_HOME}/lib64 -lcudart"
fi fi
fi # end of pkg-config decision tree 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 if test "x${MAGMA_ROOT}${MAGMA_HOME}${MAGMA_DIR}" = "x"; then
# MAGMA environment is not defined # 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 # use pkg-config to search for MAGMA
declare -a pkg_array=$(pkg-config --list-all | grep 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 for i in "${pkg_array[[@]]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep magma > /dev/null
...@@ -195,7 +202,7 @@ m4_define( ...@@ -195,7 +202,7 @@ m4_define(
# MAGMA was found # MAGMA was found
magma_pkg=$(for i in "${pkg_array[[@]]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep magma) 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_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 MAGMAFLAGS="-DUSE_MAGMA ${MAGMA_ILP64_FLAG} $CUDAFLAGS ${MAGMA_INCLUDE}"
export MAGMALDFLAGS="$CUDALDFLAGS ${MAGMA_LIBS_DIR} -lmagma" export MAGMALDFLAGS="$CUDALDFLAGS ${MAGMA_LIBS_DIR} -lmagma"
fi # end of MAGMA decision tree fi # end of MAGMA decision tree
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment