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