OSDN Git Service

CUDA
[eos/hostdependX86LINUX64.git] / util / X86LINUX64 / cuda-6.5 / bin / cuda-install-samples-6.5.sh
1 #!/bin/sh
2 PATH=/usr/bin:/bin:/usr/sbin:/sbin;
3 SAMPLES_SRC=`dirname $0`/../samples;
4
5 if [ -z "$1" ]; then
6     echo "Error: target directory missing";
7     echo "Usage: cuda-install-samples-6.5.sh <target directory>";
8     echo "       Will append NVIDIA_CUDA-6.5_Samples to <target directory>";
9     exit 1;
10 fi
11
12 SAMPLES_DIR=$1;
13 echo $SAMPLES_DIR | grep -q "/$"
14 if [ $? -ne 0 ]; then
15     SAMPLES_DIR=$SAMPLES_DIR"/";
16 fi
17 SAMPLES_DIR=$SAMPLES_DIR"NVIDIA_CUDA-6.5_Samples";
18
19 mkdir -p "$SAMPLES_DIR" >/dev/null 2>&1;
20
21 if [ -d "$SAMPLES_DIR" -a -w "$SAMPLES_DIR" ]; then
22     echo "Copying samples to $SAMPLES_DIR now...";
23     cp -R $SAMPLES_SRC/* "$SAMPLES_DIR";
24     echo "Finished copying samples.";
25 else
26     echo "Do not have permissions to write to $SAMPLES_DIR";
27     exit 1;
28 fi
29
30 exit 0;