From 6a3a9bee12bd9576e8a79e75779c3cd82e700559 Mon Sep 17 00:00:00 2001 From: Dominik Christ Date: Tue, 29 Oct 2013 13:32:13 +0000 Subject: [PATCH] Updated cuda parameters in makefiles --- Allwmake.firstInstall | 27 ++++++++++++++++++++++++++- src/cudaSolvers/Allwmake | 12 ++++++++---- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/Allwmake.firstInstall b/Allwmake.firstInstall index d7f5703a4..d66ed7c66 100755 --- a/Allwmake.firstInstall +++ b/Allwmake.firstInstall @@ -33,7 +33,32 @@ then then exit 0 fi -fi +fi + +# Check whether we will be compiling cudaSolvers +if [ -f $CUDA_BIN_DIR/nvcc ] +then + echo + echo "Cuda compiler detected at $CUDA_BIN_DIR/nvcc;" + echo "cudaSolvers will be compiled by default." + echo + + # If yes, check presence of $CUDA_ARCH + if [ -z "$CUDA_ARCH" ] + then + echo + echo "\$CUDA_ARCH is required by nvcc compiler but not set." + echo "Check section '-gpu-architecture' in 'man nvcc' for details." + echo + read -r -p "Proceed without compiling cudaSolvers? [Y/n] " response + if [[ $response =~ ^([nN][oO]|[nN])$ ]] + then + exit 0 + fi + export CUDA_IGNORE + fi + echo "Cuda architecture set to: $CUDA_ARCH" +fi # wmake is required for subsequent targets ( cd wmake/src && make ) diff --git a/src/cudaSolvers/Allwmake b/src/cudaSolvers/Allwmake index 479f97dc5..77d376d04 100755 --- a/src/cudaSolvers/Allwmake +++ b/src/cudaSolvers/Allwmake @@ -1,13 +1,17 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory -if [ -f $CUDA_BIN_DIR/nvcc ] +if [ -f $CUDA_BIN_DIR/nvcc ] then - echo "Found nvcc -- enabling CUDA support." - wmake libso + if [ -z $CUDA_IGNORE ] + then + echo "Found nvcc but \$CUDA_IGNORE set -- not enabling CUDA support." + else + echo "Found nvcc -- enabling CUDA support." + wmake libso + fi else echo "No nvcc - CUDA not available." fi - # ----------------------------------------------------------------- end-of-file