Skip to content

Commit 813257c

Browse files
Build.sh use cmake --build to drive build system invocation (rapidsai#686)
Closes rapidsai#685 By using `cmake --build` instead of explicitly invoking the presumed underlying build system we allow for different CMake generators to be supported. Authors: - Robert Maynard (@robertmaynard) Approvers: - Keith Kraus (@kkraus14) URL: rapidsai#686
1 parent 55f59fa commit 813257c

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

build.sh

+7-8
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ RMM_BUILD_DIR=${REPODIR}/python/build
3737
BUILD_DIRS="${LIBRMM_BUILD_DIR} ${RMM_BUILD_DIR}"
3838

3939
# Set defaults for vars modified by flags to this script
40-
VERBOSE=""
40+
VERBOSE_FLAG=""
4141
BUILD_TYPE=Release
4242
INSTALL_TARGET=install
4343
CUDA_STATIC_RUNTIME=OFF
@@ -54,17 +54,16 @@ function hasArg {
5454
(( NUMARGS != 0 )) && (echo " ${ARGS} " | grep -q " $1 ")
5555
}
5656

57-
# Runs cmake if it has not been run already. Bash work directory
58-
# is always build directory after calling this function
57+
# Runs cmake if it has not been run already for build directory
58+
# LIBRMM_BUILD_DIR
5959
function ensureCMakeRan {
6060
mkdir -p "${LIBRMM_BUILD_DIR}"
61-
cd "${LIBRMM_BUILD_DIR}"
6261
if (( RAN_CMAKE == 0 )); then
6362
echo "Executing cmake for librmm..."
6463
cmake -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \
6564
-DCUDA_STATIC_RUNTIME="${CUDA_STATIC_RUNTIME}" \
6665
-DPER_THREAD_DEFAULT_STREAM="${PER_THREAD_DEFAULT_STREAM}" \
67-
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} ..
66+
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} -B "${LIBRMM_BUILD_DIR}" -S .
6867
RAN_CMAKE=1
6968
fi
7069
}
@@ -86,7 +85,7 @@ fi
8685

8786
# Process flags
8887
if hasArg -v; then
89-
VERBOSE=1
88+
VERBOSE_FLAG=-v
9089
set -x
9190
fi
9291
if hasArg -g; then
@@ -121,10 +120,10 @@ fi
121120
if (( NUMARGS == 0 )) || hasArg librmm; then
122121
ensureCMakeRan
123122
echo "building librmm..."
124-
make -j${PARALLEL_LEVEL} VERBOSE=${VERBOSE}
123+
cmake --build "${LIBRMM_BUILD_DIR}" -j${PARALLEL_LEVEL} ${VERBOSE_FLAG}
125124
if [[ ${INSTALL_TARGET} != "" ]]; then
126125
echo "installing librmm..."
127-
make -j${PARALLEL_LEVEL} VERBOSE=${VERBOSE} install
126+
cmake --build "${LIBRMM_BUILD_DIR}" --target install -v ${VERBOSE_FLAG}
128127
fi
129128
fi
130129

0 commit comments

Comments
 (0)