@@ -16,7 +16,7 @@ ARGS=$*
1616
1717# NOTE: ensure all dir changes are relative to the location of this
1818# script, and that this script resides in the repo dir!
19- REPODIR=$( cd $( dirname $0 ) ; pwd)
19+ REPODIR=$( cd " $( dirname " $0 " ) " ; pwd)
2020
2121VALIDARGS=" clean librmm rmm -v -g -n -s --ptds -h tests benchmarks"
2222HELP=" $0 [clean] [librmm] [rmm] [-v] [-g] [-n] [-s] [--ptds] [--cmake-args=\" <args>\" ] [-h]
@@ -61,24 +61,25 @@ function hasArg {
6161
6262function cmakeArgs {
6363 # Check for multiple cmake args options
64- if [[ $( echo $ARGS | { grep -Eo " \-\-cmake\-args" || true ; } | wc -l ) -gt 1 ]]; then
64+ if [[ $( echo " $ARGS " | { grep -Eo " \-\-cmake\-args" || true ; } | wc -l ) -gt 1 ]]; then
6565 echo " Multiple --cmake-args options were provided, please provide only one: ${ARGS} "
6666 exit 1
6767 fi
6868
6969 # Check for cmake args option
70- if [[ -n $( echo $ARGS | { grep -E " \-\-cmake\-args" || true ; } ) ]]; then
70+ if [[ -n $( echo " $ARGS " | { grep -E " \-\-cmake\-args" || true ; } ) ]]; then
7171 # There are possible weird edge cases that may cause this regex filter to output nothing and fail silently
7272 # the true pipe will catch any weird edge cases that may happen and will cause the program to fall back
7373 # on the invalid option error
74- EXTRA_CMAKE_ARGS=$( echo $ARGS | { grep -Eo " \-\-cmake\-args=\" .+\" " || true ; })
74+ EXTRA_CMAKE_ARGS=$( echo " $ARGS " | { grep -Eo " \-\-cmake\-args=\" .+\" " || true ; })
7575 if [[ -n ${EXTRA_CMAKE_ARGS} ]]; then
7676 # Remove the full EXTRA_CMAKE_ARGS argument from list of args so that it passes validArgs function
7777 ARGS=${ARGS// $EXTRA_CMAKE_ARGS / }
7878 # Filter the full argument down to just the extra string that will be added to cmake call
79- EXTRA_CMAKE_ARGS=$( echo $EXTRA_CMAKE_ARGS | grep -Eo " \" .+\" " | sed -e ' s/^"//' -e ' s/"$//' )
79+ EXTRA_CMAKE_ARGS=$( echo " $EXTRA_CMAKE_ARGS " | grep -Eo " \" .+\" " | sed -e ' s/^"//' -e ' s/"$//' )
8080 fi
8181 fi
82+ read -ra EXTRA_CMAKE_ARGS <<< " $EXTRA_CMAKE_ARGS"
8283}
8384
8485
@@ -88,14 +89,14 @@ function ensureCMakeRan {
8889 mkdir -p " ${LIBRMM_BUILD_DIR} "
8990 if (( RAN_CMAKE == 0 )) ; then
9091 echo " Executing cmake for librmm..."
91- cmake -S ${REPODIR} /cpp -B " ${LIBRMM_BUILD_DIR} " \
92+ cmake -S " ${REPODIR} " /cpp -B " ${LIBRMM_BUILD_DIR} " \
9293 -DCMAKE_INSTALL_PREFIX=" ${INSTALL_PREFIX} " \
9394 -DCUDA_STATIC_RUNTIME=" ${CUDA_STATIC_RUNTIME} " \
9495 -DPER_THREAD_DEFAULT_STREAM=" ${PER_THREAD_DEFAULT_STREAM} " \
9596 -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
9697 -DBUILD_TESTS=${BUILD_TESTS} \
9798 -DBUILD_BENCHMARKS=${BUILD_BENCHMARKS} \
98- ${EXTRA_CMAKE_ARGS}
99+ " ${EXTRA_CMAKE_ARGS[@]} "
99100 RAN_CMAKE=1
100101 fi
101102}
@@ -106,7 +107,7 @@ if hasArg -h || hasArg --help; then
106107fi
107108
108109# Check for valid usage
109- if (( ${ NUMARGS} != 0 )) ; then
110+ if (( NUMARGS != 0 )) ; then
110111 # Check for cmake args
111112 cmakeArgs
112113 for a in ${ARGS} ; do
160161if (( NUMARGS == 0 )) || hasArg librmm; then
161162 ensureCMakeRan
162163 echo " building librmm..."
163- cmake --build " ${LIBRMM_BUILD_DIR} " -j${PARALLEL_LEVEL} ${VERBOSE_FLAG}
164+ cmake --build " ${LIBRMM_BUILD_DIR} " -j" ${PARALLEL_LEVEL} " ${VERBOSE_FLAG}
164165 if [[ ${INSTALL_TARGET} != " " ]]; then
165166 echo " installing librmm..."
166167 cmake --build " ${LIBRMM_BUILD_DIR} " --target install -v ${VERBOSE_FLAG}
170171# Build and install the rmm Python package
171172if (( NUMARGS == 0 )) || hasArg rmm; then
172173 echo " building and installing rmm..."
173- SKBUILD_CMAKE_ARGS=" -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} ;${EXTRA_CMAKE_ARGS} " python -m pip install \
174+ SKBUILD_CMAKE_ARGS=" -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} ;$( IFS= ' ; ' ; echo " $ {EXTRA_CMAKE_ARGS[*]} " ) " python -m pip install \
174175 --no-build-isolation \
175176 --no-deps \
176177 --config-settings rapidsai.disable-cuda=true \
177- ${REPODIR} /python/rmm
178+ " ${REPODIR} " /python/rmm
178179fi
0 commit comments