code: def check_nccl_version(compiler, settings):
      global _nccl_version
  
      # NCCL 1.x does not provide version information.
      try:
          out = build_and_run(
              compiler,
              """
                              #ifndef CUPY_USE_HIP
                              #include <nccl.h>
                              #else
                              #include <rccl.h>
                              #endif
                              #include <stdio.h>
                              #ifdef NCCL_MAJOR
                              #ifndef NCCL_VERSION_CODE
                              #  define NCCL_VERSION_CODE \
                              (NCCL_MAJOR * 1000 + NCCL_MINOR * 100 + NCCL_PATCH)
                              #endif
                              #else
                              #  define NCCL_VERSION_CODE 0
                              #endif
                              int main() {
                                printf("%d", NCCL_VERSION_CODE);
                                return 0;
                              }
                              """,
              include_dirs=settings["include_dirs"],
              define_macros=settings["define_macros"],
          )
  
      except Exception as e:
          utils.print_warning("Cannot include NCCL\n{0}".format(e))
          return False
  
      _nccl_version = int(out)
  
      return True
  
imports: import contextlib
  import os
  import re
  import shlex
  import shutil
  import subprocess
  import sys
  import tempfile
  from typing import List, Set
  import cupy_builder
  import cupy_builder.install_utils
  from cupy_builder import _environment
  from cupy_builder._context import Context
label_desc: Use image node_id 18 for calling a global function with example usage: check_nccl_version(compiler, settings) and returns: True, False