diff --git a/build.sh b/build.sh index 76a29eb4cb..0b97542b3e 100755 --- a/build.sh +++ b/build.sh @@ -48,6 +48,8 @@ HELP="$0 [ ...] [ ...] [--cmake-args=\"\"] [--cache-tool=\\\" - pass arbitrary list of CMake configuration options (escape all quotes in argument) --cache-tool= - pass the build cache tool (eg: ccache, sccache, distcc) that will be used to speedup the build process. + --logging-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 @@ -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;\ @@ -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="${ARGS//--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 @@ -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 @@ -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[@]}"