Skip to content

Commit 9090a13

Browse files
committed
make cuda installation customizable
1 parent 3b0e478 commit 9090a13

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

bin/aomp_common_vars

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ AOMP_INSTALL_DIR=${AOMP}_${AOMP_VERSION_STRING}
1818
# Clang repo is $HOME/aomp/clang
1919
AOMP_REPOS=${AOMP_REPOS:-$HOME/git/aomp}
2020

21+
CUDA=${CUDA:-/usr/local/cuda}
22+
CUDAT=${CUDAT:-$CUDA/targets}
23+
CUDAINCLUDE=${CUDAINCLUDE:-$CUDA/include}
24+
CUDABIN=${CUDAH:-$CUDA/bin}
25+
2126
# Set list of default nvptx subarchitectures to build
2227
# Only Cuda 9 and above supports sm_70
2328
NVPTXGPUS_DEFAULT="30,35,50,60,61"

bin/build_openmp.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ if [ "$PROC" == "aarch64" ] ; then
4343
NVPTXGPUS_DEFAULT=""
4444
NVPTXGPUS=""
4545
else
46-
CUDAH=`find /usr/local/cuda/targets -type f -name "cuda.h" 2>/dev/null`
46+
CUDAH=`find $CUDAT -type f -name "cuda.h" 2>/dev/null`
4747
if [ "$CUDAH" == "" ] ; then
48-
CUDAH=`find /usr/local/cuda/include -type f -name "cuda.h" 2>/dev/null`
48+
CUDAH=`find $CUDAINCLUDE -type f -name "cuda.h" 2>/dev/null`
4949
fi
5050
if [ "$CUDAH" == "" ] ; then
5151
echo
@@ -82,8 +82,8 @@ if [ ! -z `which "getconf"` ]; then
8282
fi
8383

8484
GCCMIN=5
85-
if [ -f /usr/local/cuda/bin/nvcc ] ; then
86-
CUDAVER=`/usr/local/cuda/bin/nvcc --version | grep compilation | cut -d" " -f5 | cut -d"." -f1 `
85+
if [ -f $CUDABIN/nvcc ] ; then
86+
CUDAVER=`$CUDABIN/nvcc --version | grep compilation | cut -d" " -f5 | cut -d"." -f1 `
8787
echo "CUDA VERSION IS $CUDAVER"
8888
if [ $CUDAVER -gt 8 ] ; then
8989
GCCMIN=7

0 commit comments

Comments
 (0)