From 461e61d10e1ac966670ee1c40e80f94a07ade501 Mon Sep 17 00:00:00 2001 From: Arm Patinyasakdikul Date: Sun, 16 Nov 2025 22:35:06 -0800 Subject: [PATCH] Added install.sh flag to suppress warnings. (#2054) --- CMakeLists.txt | 12 ++++++++++++ install.sh | 11 ++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c27ea334b..892968cce3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,7 @@ option(PROFILE "Enable profiling" option(TIMETRACE "Enable time-trace during compilation" OFF) option(TRACE "Enable additional tracing" OFF) option(FAULT_INJECTION "Enable fault injection" ON) +option(QUIET_WARNINGS "Supress compiler warnings" OFF) # Default GPU architectures to build #================================================================================================== @@ -1160,6 +1161,17 @@ target_compile_options(rccl PRIVATE -Wno-format-nonliteral) target_compile_options(rccl PRIVATE -Wno-unused-function) target_compile_options(rccl PRIVATE -fgpu-rdc) +if(QUIET_WARNINGS) + target_compile_options(rccl PRIVATE -Wno-invalid-offsetof) + target_compile_options(rccl PRIVATE -Wno-unused-result) + target_compile_options(rccl PRIVATE -Wno-macro-redefined) + target_compile_options(rccl PRIVATE -Wno-unused-label) + target_compile_options(rccl PRIVATE -Wno-unused-variable) + target_compile_options(rccl PRIVATE -Wno-unused-private-field) + target_compile_options(rccl PRIVATE -Wno-null-conversion) + target_compile_options(rccl PRIVATE -Wno-missing-braces) +endif() + ## Set RCCL compile and linker options for unit tests and code coverage if(ENABLE_CODE_COVERAGE) if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") diff --git a/install.sh b/install.sh index 25ab0eb1ad..ac24aee79f 100755 --- a/install.sh +++ b/install.sh @@ -39,6 +39,7 @@ run_tests_all=false time_trace=false force_reduce_pipeline=false generate_sym_kernels=false +quiet_warnings=false # ################################################# # helper functions @@ -79,6 +80,7 @@ function display_help() echo " --verbose Show compile commands" echo " --force-reduce-pipeline Force reduce_copy sw pipeline to be used for every reduce-based collectives and datatypes" echo " --generate-sym-kernels Generate symmetric memory kernels" + echo " -q|--quiet-warnings Suppress majority of compiler warnings (not recommended)" } # ################################################# @@ -88,7 +90,7 @@ function display_help() # check if we have a modern version of getopt that can handle whitespace and long parameters getopt -T if [[ "$?" -eq 4 ]]; then - GETOPT_PARSE=$(getopt --name "${0}" --options cdfhij:lprt --longoptions address-sanitizer,dependencies,debug,dump-asm,enable-code-coverage,enable_backtrace,disable-colltrace,disable-msccl-kernel,enable-mscclpp,fast,help,install,jobs:,kernel-resource-use,local_gpu_only,amdgpu_targets:,no_clean,npkit-enable,log-trace,openmp-test-enable,roctx-enable,package_build,prefix:,rm-legacy-include-dir,run_tests_all,run_tests_quick,static,tests_build,time-trace,force-reduce-pipeline,generate-sym-kernels,verbose -- "$@") + GETOPT_PARSE=$(getopt --name "${0}" --options cdfhij:lprtq --longoptions address-sanitizer,dependencies,debug,dump-asm,enable-code-coverage,enable_backtrace,disable-colltrace,disable-msccl-kernel,enable-mscclpp,fast,help,install,jobs:,kernel-resource-use,local_gpu_only,amdgpu_targets:,no_clean,npkit-enable,log-trace,openmp-test-enable,roctx-enable,package_build,prefix:,rm-legacy-include-dir,run_tests_all,run_tests_quick,static,tests_build,time-trace,force-reduce-pipeline,generate-sym-kernels,quiet-warnings,verbose -- "$@") else echo "Need a new version of getopt" exit 1 @@ -135,6 +137,7 @@ while true; do --verbose) build_verbose=true; shift ;; --force-reduce-pipeline) force_reduce_pipeline=true; shift ;; --generate-sym-kernels) generate_sym_kernels=true; shift ;; + -q | --quiet-warnings) quiet_warnings=true; shift ;; --) shift ; break ;; *) echo "Unexpected command line parameter received; aborting"; exit 1 @@ -313,6 +316,12 @@ if [[ "${npkit_enabled}" == true ]]; then cmake_common_options="${cmake_common_options} -DENABLE_NPKIT=ON" fi +# Suppress Warnings +if [[ "${quiet_warnings}" == true ]]; then + cmake_common_options="${cmake_common_options} -DQUIET_WARNINGS=ON" +fi + + check_exit_code "$?" # Enable ninja build for time tracing