Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ HELP="$0 [<target> ...] [<flag> ...] [--cmake-args=\"<args>\"] [--cache-tool=<to
--cmake-args=\\\"<args>\\\" - pass arbitrary list of CMake configuration options (escape all quotes in argument)
--cache-tool=<tool> - pass the build cache tool (eg: ccache, sccache, distcc) that will be used
to speedup the build process.
--logging-level=<level> - set macro "RAFT_LOG_ACTIVE_LEVEL" to RAPIDS_LOGGER_LOG_LEVEL_{given_value}.
Valid values are (TRACE, DEBUG, INFO, WARN, ERROR, CRITICAL, OFF)
--time - Enable nvcc compilation time logging into cpp/build/nvcc_compile_log.csv.
Results can be interpreted with cpp/scripts/analyze_nvcc_log.py
-h - print this text
Expand All @@ -72,6 +74,7 @@ COMPILE_LIBRARY=OFF
INSTALL_TARGET=install
BUILD_REPORT_METRICS=""
BUILD_REPORT_INCL_CACHE_STATS=OFF
LIBRAFT_LOGGING_LEVEL=INFO

TEST_TARGETS="CORE_TEST;\
CORE_TEST_NOCUDA;\
Expand Down Expand Up @@ -193,6 +196,21 @@ function limitBench {
fi
}

function loggingLevel {
if [[ -n $(echo "$ARGS" | { grep -E "\-\-logging\-level" || true; } ) ]]; then
LIBRAFT_LOGGING_LEVEL=$(echo "$ARGS" | sed -e 's/.*--logging-level[= ]//' -e 's/ .*//')
if [[ -n ${LIBRAFT_LOGGING_LEVEL} ]]; then
ARGS=$(echo "$ARGS" | sed -e "s/--logging-level[= ]${LIBRAFT_LOGGING_LEVEL}//")
VALID_LEVELS="TRACE DEBUG INFO WARN ERROR CRITICAL OFF"
if [[ ! " ${VALID_LEVELS} " =~ " ${LIBRAFT_LOGGING_LEVEL} " ]]; then
echo "Invalid --logging-level value: '${LIBRAFT_LOGGING_LEVEL}'. Valid values are: ${VALID_LEVELS}"
exit 1
fi
echo "Set LIBRAFT_LOGGING_LEVEL to ${LIBRAFT_LOGGING_LEVEL}"
fi
fi
}

function buildMetrics {
# Check for multiple build-metrics options
if [[ $(echo "$ARGS" | { grep -Eo "\-\-build\-metrics" || true; } | wc -l ) -gt 1 ]]; then
Expand Down Expand Up @@ -223,6 +241,7 @@ if (( NUMARGS != 0 )); then
cacheTool
limitTests
limitBench
loggingLevel
buildMetrics
for a in ${ARGS}; do
if ! (echo " ${VALIDARGS} " | grep -q " ${a} "); then
Expand Down Expand Up @@ -406,6 +425,7 @@ if (( NUMARGS == 0 )) || hasArg libraft || hasArg docs || hasArg tests || hasArg
-DBUILD_TESTS=${BUILD_TESTS} \
-DBUILD_PRIMS_BENCH=${BUILD_PRIMS_BENCH} \
-DCMAKE_MESSAGE_LOG_LEVEL=${CMAKE_LOG_LEVEL} \
-DLIBRAFT_LOGGING_LEVEL=${LIBRAFT_LOGGING_LEVEL} \
"${CACHE_ARGS[@]}" \
"${EXTRA_CMAKE_ARGS[@]}"

Expand Down
Loading